1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- src/oaiservr
|
---|
4 | # A component of the Greenstone digital library software
|
---|
5 | # from the New Zealand Digital Library Project at the
|
---|
6 | # University of Waikato, New Zealand.
|
---|
7 | #
|
---|
8 | # Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
9 | #
|
---|
10 | #
|
---|
11 | # This program is free software; you can redistribute it and/or modify
|
---|
12 | # it under the terms of the GNU General Public License as published by
|
---|
13 | # the Free Software Foundation; either version 2 of the License, or
|
---|
14 | # (at your option) any later version.
|
---|
15 | #
|
---|
16 | # This program is distributed in the hope that it will be useful,
|
---|
17 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
18 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
19 | # GNU General Public License for more details.
|
---|
20 | #
|
---|
21 | # You should have received a copy of the GNU General Public License
|
---|
22 | # along with this program; if not, write to the Free Software
|
---|
23 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
24 | #
|
---|
25 | ###########################################################################
|
---|
26 |
|
---|
27 | USE_Z3950 = @USE_Z3950@
|
---|
28 | ifeq ($(USE_Z3950), 1)
|
---|
29 | Z_CFLAGS=-DUSE_Z3950
|
---|
30 | else
|
---|
31 | Z_CFLAGS=
|
---|
32 | endif
|
---|
33 |
|
---|
34 | USE_CORBA = @USE_CORBA@
|
---|
35 | ifeq ($(USE_CORBA), 1)
|
---|
36 | CORBA_CFLAGS=-DUSE_CORBA
|
---|
37 | else
|
---|
38 | CORBA_CFLAGS=
|
---|
39 | endif
|
---|
40 |
|
---|
41 | srcDir = ../../src
|
---|
42 | recptDir = ../../src/recpt
|
---|
43 | colservrDir = ../../src/colservr
|
---|
44 |
|
---|
45 | AR = ar
|
---|
46 | CC = @CC@
|
---|
47 | CPP = @CXX@
|
---|
48 | #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
|
---|
49 |
|
---|
50 | CCFLAGS = $(Z_CFLAGS) $(CORBA_CFLAGS) @CFLAGS@
|
---|
51 |
|
---|
52 | # YAZ kit for z39.50
|
---|
53 | YAZDIR=../../packages/yaz
|
---|
54 |
|
---|
55 | USE_FASTCGI = @USE_FASTCGI@
|
---|
56 | ifneq ($(USE_FASTCGI), 1)
|
---|
57 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM @DEFS@
|
---|
58 | INCLUDES = -I../../lib -I. -I$(colservrDir) -I../../packages/mg \
|
---|
59 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
60 | -I$(srcDir)/mgpp/lib -I$(srcDir)/mgpp/text -I../.. -I$(recptDir)
|
---|
61 | else
|
---|
62 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI @DEFS@
|
---|
63 | INCLUDES = -I../../lib -I. -I$(colservrDir) -I../../packages/mg \
|
---|
64 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
65 | -I../../packages/fcgi/include -I$(srcDir)/mgpp/lib \
|
---|
66 | -I$(srcDir)/mgpp/text -I../.. -I$(srcDir)
|
---|
67 | endif
|
---|
68 | MICO_DIR = @MICO_DIR@
|
---|
69 | MICO_VER = @MICO_VER@
|
---|
70 | ifeq ($(MICO_DIR), yes)
|
---|
71 | MICO_INC =
|
---|
72 | MICO_LIB =
|
---|
73 | MICO_PATH =
|
---|
74 | else
|
---|
75 | ifeq ($(MICO_DIR), default)
|
---|
76 | MICO_DIR = ../../packages/mico/include
|
---|
77 | MICO_PATH = ../../bin/linux/
|
---|
78 | else
|
---|
79 | MICO_PATH =
|
---|
80 | endif
|
---|
81 | MICO_INC = -I$(MICO_DIR)
|
---|
82 | MICO_LIB = -L$(MICO_DIR)
|
---|
83 | endif
|
---|
84 | MINCLUDES = -I. -I../../lib -I$(colservrDir) $(MICO_INC)
|
---|
85 |
|
---|
86 | RANLIB = @RANLIB@
|
---|
87 | LDFLAGS = @LDFLAGS@
|
---|
88 | GDBM_LIBS=@GDBM_LIBPATH@ -lgdbm
|
---|
89 | LIBS = $(GDBM_LIBS) @LIBS@
|
---|
90 |
|
---|
91 | GSDLOS = @gsdlos@
|
---|
92 |
|
---|
93 | COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
94 | LINK = $(CC) $(LDFLAGS) -o $@
|
---|
95 |
|
---|
96 | CPPCOMPILE = $(CPP) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
97 | CPPLINK = $(CPP) $(LDFLAGS) -o $@
|
---|
98 |
|
---|
99 | MCOMPILE = $(MICO_PATH)mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c
|
---|
100 | MLINK = $(MICO_PATH)mico-ld -static $(LDFLAGS) $(MICO_LIB) -o $@
|
---|
101 | MLIBS = $(LIBS) -L../../lib/ -lmico$(MICO_VER) -lmicoaux$(MICO_VER)
|
---|
102 |
|
---|
103 | # in case gdbm.h/libgdbm.a are in a non-standard place...
|
---|
104 | GDBM_OBJS=argdb.o authenaction.o collectoraction.o infodbclass.o userdb.o usersaction.o historydb.o librarymain.o nullproto.o queryaction.o z3950proto.o
|
---|
105 |
|
---|
106 | ifeq ($(USE_CORBA), 1)
|
---|
107 | EXEC = oaiserver
|
---|
108 | else
|
---|
109 | EXEC = oaiserver
|
---|
110 | endif
|
---|
111 |
|
---|
112 | all: $(EXEC)
|
---|
113 |
|
---|
114 |
|
---|
115 | .SUFFIXES:
|
---|
116 | .SUFFIXES: .c .o
|
---|
117 | .c.o:
|
---|
118 | $(COMPILE) $<
|
---|
119 |
|
---|
120 | .SUFFIXES: .cpp .o
|
---|
121 | .cpp.o:
|
---|
122 | $(CPPCOMPILE) $<
|
---|
123 |
|
---|
124 | $(GDBM_OBJS) :%.o :%.cpp
|
---|
125 | $(CPPCOMPILE) @GDBM_INCLUDE@ $<
|
---|
126 |
|
---|
127 | .SUFFIXES: .mpp .o
|
---|
128 | .mpp.o:
|
---|
129 | $(MCOMPILE) $< -o $@
|
---|
130 |
|
---|
131 | COMMONHEADERS = oaiargs.h oaiaction.h oaidispatcher.h oaiconfig.h identityaction.h recordaction.h \
|
---|
132 | listrecsaction.h listidsaction.h listsetsaction.h metaformatsaction.h oaitools.h \
|
---|
133 | abstractlistaction.h metaformat.h dublincore.h rfc1807.h resumptiontoken.h
|
---|
134 |
|
---|
135 | ifeq ($(USE_CORBA), 1)
|
---|
136 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h corbaproto.h
|
---|
137 | else
|
---|
138 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
|
---|
139 | endif
|
---|
140 |
|
---|
141 | HEADERS = $(COMMONHEADERS) $(LIBRARYHEADERS)
|
---|
142 |
|
---|
143 |
|
---|
144 | COMMONSOURCES = oaiargs.cpp oaiaction.cpp oaidispatcher.cpp oaiconfig.cpp identityaction.cpp recordaction.cpp \
|
---|
145 | abstractlistaction.cpp listrecsaction.cpp listidsaction.cpp listsetsaction.cpp \
|
---|
146 | metaformatsaction.cpp oaitools.cpp metaformat.cpp dublincore.cpp rfc1807.cpp \
|
---|
147 | resumptiontoken.cpp
|
---|
148 |
|
---|
149 | OAISOURCES =
|
---|
150 |
|
---|
151 | SOURCES = $(COMMONSOURCES) $(OAISOURCES)
|
---|
152 |
|
---|
153 | RECPTOBJECTS = $(recptDir)/comtypes.o $(recptDir)/OIDtools.o $(recptDir)/nullproto.o $(recptDir)/recptproto.o \
|
---|
154 | $(recptDir)/htmlutils.o $(recptDir)/infodbclass.o $(recptDir)/recptconfig.o $(recptDir)/cgiargs.o \
|
---|
155 | $(recptDir)/cgiutils.o
|
---|
156 |
|
---|
157 | COMMONOBJECTS = oaiargs.o oaiaction.o oaiconfig.o oaidispatcher.o identityaction.o recordaction.o \
|
---|
158 | abstractlistaction.o listrecsaction.o listidsaction.o listsetsaction.o \
|
---|
159 | metaformatsaction.o oaitools.o \
|
---|
160 | metaformat.o dublincore.o rfc1807.o resumptiontoken.o
|
---|
161 |
|
---|
162 | OAIOBJECTS = oaimain.o
|
---|
163 |
|
---|
164 | OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(OAIOBJECTS)
|
---|
165 |
|
---|
166 |
|
---|
167 | COLSERVROBJECTS = $(colservrDir)/mgq.o \
|
---|
168 | $(colservrDir)/search.o \
|
---|
169 | $(colservrDir)/mgsearch.o \
|
---|
170 | $(colservrDir)/querycache.o \
|
---|
171 | $(colservrDir)/queryinfo.o \
|
---|
172 | $(colservrDir)/collectserver.o \
|
---|
173 | $(colservrDir)/colservrconfig.o \
|
---|
174 | $(colservrDir)/maptools.o \
|
---|
175 | $(colservrDir)/filter.o \
|
---|
176 | $(colservrDir)/source.o \
|
---|
177 | $(colservrDir)/browsefilter.o \
|
---|
178 | $(colservrDir)/queryfilter.o \
|
---|
179 | $(colservrDir)/mggdbmsource.o \
|
---|
180 | $(colservrDir)/phrasesearch.o \
|
---|
181 | $(colservrDir)/phrasequeryfilter.o \
|
---|
182 | $(colservrDir)/mgqueryfilter.o \
|
---|
183 | $(colservrDir)/mgppsearch.o \
|
---|
184 | $(colservrDir)/mgppqueryfilter.o \
|
---|
185 | $(colservrDir)/collectset.o
|
---|
186 |
|
---|
187 |
|
---|
188 |
|
---|
189 | distclean:
|
---|
190 | rm -f $(COMMONOBJECTS) $(OAIOBJECTS) $(EXEC) Makefile
|
---|
191 |
|
---|
192 | clean:
|
---|
193 | rm -f $(COMMONOBJECTS) $(OAIOBJECTS) $(EXEC)
|
---|
194 |
|
---|
195 | install:
|
---|
196 | install -m 755 -s oaiserver ../../cgi-bin
|
---|
197 |
|
---|
198 | depend:
|
---|
199 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
|
---|
200 |
|
---|
201 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
202 | ifeq ($(USE_FASTCGI), 1)
|
---|
203 | FASTCGI_OBJS = ../../packages/fcgi/libfcgi/libfcgi.a
|
---|
204 | else
|
---|
205 | FASTCGI_OBJS =
|
---|
206 | endif
|
---|
207 |
|
---|
208 | OAI_OBJS = $(OBJECTS) $(COLSERVROBJECTS) \
|
---|
209 | ../../lib/gsdllib.a \
|
---|
210 | ../../packages/mg/src/text/libtextin.a \
|
---|
211 | ../../packages/mg/lib/libmg.a \
|
---|
212 | $(FASTCGI_OBJS) \
|
---|
213 | $(srcDir)/mgpp/text/libtextin.a \
|
---|
214 | $(srcDir)/mgpp/lib/libmg.a
|
---|
215 |
|
---|
216 | oaiserver: $(OAI_OBJS)
|
---|
217 | $(CPPLINK) $(OAI_OBJS) $(LIBS)
|
---|
218 |
|
---|
219 |
|
---|
220 |
|
---|
221 |
|
---|
222 |
|
---|