1 | ###########################################################################
|
---|
2 | #
|
---|
3 | # Makefile -- src/recpt
|
---|
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 |
|
---|
42 |
|
---|
43 | AR = ar
|
---|
44 | CC = @CC@
|
---|
45 | CPP = @CXX@
|
---|
46 | #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
|
---|
47 |
|
---|
48 | CCFLAGS = $(Z_CFLAGS) $(CORBA_CFLAGS) @CFLAGS@
|
---|
49 |
|
---|
50 | # YAZ kit for z39.50
|
---|
51 | YAZDIR=../../packages/yaz
|
---|
52 |
|
---|
53 | USE_FASTCGI = @USE_FASTCGI@
|
---|
54 | ifneq ($(USE_FASTCGI), 1)
|
---|
55 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM @DEFS@
|
---|
56 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
57 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
58 | -I../mgpp/lib -I../mgpp/text
|
---|
59 | else
|
---|
60 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI @DEFS@
|
---|
61 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
62 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
63 | -I../../packages/fcgi/include -I../mgpp/lib \
|
---|
64 | -I../mgpp/text
|
---|
65 | endif
|
---|
66 | MICO_DIR = @MICO_DIR@
|
---|
67 | MICO_VER = @MICO_VER@
|
---|
68 | ifeq ($(MICO_DIR), yes)
|
---|
69 | MICO_INC =
|
---|
70 | MICO_LIB =
|
---|
71 | MICO_PATH =
|
---|
72 | else
|
---|
73 | ifeq ($(MICO_DIR), default)
|
---|
74 | MICO_DIR = ../../packages/mico/include
|
---|
75 | MICO_PATH = ../../bin/linux/
|
---|
76 | endif
|
---|
77 | MICO_INC = -I$(MICO_DIR)
|
---|
78 | MICO_LIB = -L$(MICO_DIR)
|
---|
79 | MICO_PATH =
|
---|
80 | endif
|
---|
81 | MINCLUDES = -I. -I../../lib -I../colservr $(MICO_INC)
|
---|
82 |
|
---|
83 | RANLIB = @RANLIB@
|
---|
84 | LDFLAGS = @LDFLAGS@
|
---|
85 | LIBS = @LIBS@
|
---|
86 |
|
---|
87 | GSDLOS = @gsdlos@
|
---|
88 |
|
---|
89 | COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
90 | LINK = $(CC) $(LDFLAGS) -o $@
|
---|
91 |
|
---|
92 | CPPCOMPILE = $(CPP) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
93 | CPPLINK = $(CPP) $(LDFLAGS) -o $@
|
---|
94 |
|
---|
95 | MCOMPILE = $(MICO_PATH)mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c
|
---|
96 | MLINK = $(MICO_PATH)mico-ld -static $(LDFLAGS) $(MICO_LIB) -o $@
|
---|
97 | MLIBS = $(LIBS) -L../../lib/ -lmico$(MICO_VER) -lmicoaux$(MICO_VER)
|
---|
98 |
|
---|
99 | .SUFFIXES:
|
---|
100 | .SUFFIXES: .c .o
|
---|
101 | .c.o:
|
---|
102 | $(COMPILE) $<
|
---|
103 |
|
---|
104 | .SUFFIXES: .cpp .o
|
---|
105 | .cpp.o:
|
---|
106 | $(CPPCOMPILE) $<
|
---|
107 |
|
---|
108 | .SUFFIXES: .mpp .o
|
---|
109 | .mpp.o:
|
---|
110 | $(MCOMPILE) $<
|
---|
111 |
|
---|
112 | COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
|
---|
113 | converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h htmlgen.h \
|
---|
114 | statusaction.h pageaction.h comtypes.h recptproto.h \
|
---|
115 | pingaction.h queryaction.h documentaction.h \
|
---|
116 | extlinkaction.h htmlutils.h \
|
---|
117 | querytools.h formattools.h tipaction.h authenaction.h infodbclass.h \
|
---|
118 | userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
|
---|
119 | datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
|
---|
120 | htmlbrowserclass.h phindbrowserclass.h \
|
---|
121 | historydb.h collectoraction.h
|
---|
122 |
|
---|
123 | RECEPTHEADERS =
|
---|
124 |
|
---|
125 | ifeq ($(USE_CORBA), 1)
|
---|
126 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h corbaproto.h
|
---|
127 | else
|
---|
128 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
|
---|
129 | endif
|
---|
130 |
|
---|
131 | HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
|
---|
132 |
|
---|
133 |
|
---|
134 | COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
|
---|
135 | converter.cpp recptconfig.cpp cgiutils.cpp OIDtools.cpp browsetools.cpp \
|
---|
136 | htmlgen.cpp statusaction.cpp pageaction.cpp comtypes.cpp \
|
---|
137 | recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
|
---|
138 | extlinkaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
|
---|
139 | tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
|
---|
140 | vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
|
---|
141 | invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
|
---|
142 | phindbrowserclass.cpp historydb.cpp collectoraction.cpp
|
---|
143 |
|
---|
144 |
|
---|
145 | RECPTSOURCES = recptmain.cpp
|
---|
146 |
|
---|
147 | ifeq ($(USE_Z3950), 1)
|
---|
148 | Z_LIBSOURCES=z3950proto.cpp z3950server.cpp zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c
|
---|
149 | else
|
---|
150 | Z_LIBSOURCES=
|
---|
151 | endif
|
---|
152 |
|
---|
153 | LIBRARYSOURCES = nullproto.cpp librarymain.cpp $(Z_LIBSOURCES)
|
---|
154 |
|
---|
155 | SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
|
---|
156 |
|
---|
157 |
|
---|
158 | ifeq ($(USE_Z3950), 1)
|
---|
159 | Z_COMOBJS=parse.yy.o
|
---|
160 | else
|
---|
161 | Z_COMOBJS=
|
---|
162 | endif
|
---|
163 |
|
---|
164 | COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
|
---|
165 | converter.o recptconfig.o cgiutils.o OIDtools.o browsetools.o \
|
---|
166 | htmlgen.o statusaction.o pageaction.o comtypes.o \
|
---|
167 | recptproto.o pingaction.o queryaction.o documentaction.o \
|
---|
168 | extlinkaction.o htmlutils.o querytools.o \
|
---|
169 | formattools.o tipaction.o authenaction.o \
|
---|
170 | infodbclass.o userdb.o usersaction.o vlistbrowserclass.o \
|
---|
171 | hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
|
---|
172 | pagedbrowserclass.o htmlbrowserclass.o phindbrowserclass.o \
|
---|
173 | historydb.o $(Z_COMOBJS) collectoraction.o
|
---|
174 |
|
---|
175 | RECPTOBJECTS = recptmain.o
|
---|
176 |
|
---|
177 |
|
---|
178 | ifeq ($(USE_Z3950), 1)
|
---|
179 | Z_LIBOBJS=z3950proto.o z3950server.o zparse.tab.o $(YAZDIR)/client/yaz_zclient.o
|
---|
180 | else
|
---|
181 | Z_LIBOBJS=
|
---|
182 | endif
|
---|
183 |
|
---|
184 | LIBRARYOBJECTS = nullproto.o librarymain.o $(Z_LIBOBJS)
|
---|
185 |
|
---|
186 | OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
|
---|
187 |
|
---|
188 |
|
---|
189 | COLSERVROBJECTS = ../colservr/mgq.o \
|
---|
190 | ../colservr/search.o \
|
---|
191 | ../colservr/mgsearch.o \
|
---|
192 | ../colservr/querycache.o \
|
---|
193 | ../colservr/queryinfo.o \
|
---|
194 | ../colservr/collectserver.o \
|
---|
195 | ../colservr/colservrconfig.o \
|
---|
196 | ../colservr/maptools.o \
|
---|
197 | ../colservr/filter.o \
|
---|
198 | ../colservr/source.o \
|
---|
199 | ../colservr/browsefilter.o \
|
---|
200 | ../colservr/queryfilter.o \
|
---|
201 | ../colservr/mggdbmsource.o \
|
---|
202 | ../colservr/phrasesearch.o \
|
---|
203 | ../colservr/phrasequeryfilter.o \
|
---|
204 | ../colservr/mgqueryfilter.o \
|
---|
205 | ../colservr/mgppsearch.o \
|
---|
206 | ../colservr/mgppqueryfilter.o \
|
---|
207 | ../colservr/collectset.o
|
---|
208 |
|
---|
209 | ifeq ($(USE_CORBA), 1)
|
---|
210 | #EXEC = recpt library corbaserver corbarecptldd
|
---|
211 | EXEC = library corbaserver corbarecptldd
|
---|
212 | else
|
---|
213 | #EXEC = recpt library
|
---|
214 | EXEC = library
|
---|
215 | endif
|
---|
216 |
|
---|
217 | all: $(EXEC)
|
---|
218 |
|
---|
219 |
|
---|
220 |
|
---|
221 | ## z39.50 rules
|
---|
222 | # Note! If USE_FASTCGI=1, yaz is still compiled and linked, but never
|
---|
223 | # called by librarymain.cpp.
|
---|
224 | $(YAZDIR)/client/yaz_zclient.o: $(YAZDIR)/lib/libyaz.a
|
---|
225 | cd $(YAZDIR)/client && $(MAKE) yaz_zclient.o
|
---|
226 |
|
---|
227 | # this should be done by the top level makefile...
|
---|
228 | $(YAZDIR)/lib/libyaz.a:
|
---|
229 | cd $(YAZDIR) && $(MAKE) all
|
---|
230 |
|
---|
231 | # put a separate rule here, as it speeds up compilation of other objects
|
---|
232 | # if they don't need to include all the yaz headers
|
---|
233 | z3950%.o: z3950%.cpp
|
---|
234 | $(COMPILE) -I$(YAZDIR)/include $<
|
---|
235 |
|
---|
236 | zparse.tab.c: zparse.y
|
---|
237 | @YACC@ -b zparse -d zparse.y
|
---|
238 |
|
---|
239 | zparse.tab.h: zparse.tab.c
|
---|
240 |
|
---|
241 | parse.yy.c: parse.fl zparse.tab.h
|
---|
242 | flex -oparse.yy.c parse.fl
|
---|
243 |
|
---|
244 |
|
---|
245 |
|
---|
246 | # We'll keep the .c and .h files for those without lex/flex and yacc/bison.
|
---|
247 | #PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h parse.yy.o parse.yy.c
|
---|
248 | PARSE_TMPFILE=zparse.tab.o parse.yy.o
|
---|
249 |
|
---|
250 | distclean:
|
---|
251 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES) Makefile
|
---|
252 |
|
---|
253 | clean:
|
---|
254 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES)
|
---|
255 |
|
---|
256 | install:
|
---|
257 | install -m 755 -s library ../../cgi-bin
|
---|
258 |
|
---|
259 | depend:
|
---|
260 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
|
---|
261 |
|
---|
262 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
263 | ifeq ($(USE_FASTCGI), 1)
|
---|
264 | FASTCGI_OBJS = ../../packages/fcgi/libfcgi/libfcgi.a
|
---|
265 | else
|
---|
266 | FASTCGI_OBJS =
|
---|
267 | endif
|
---|
268 |
|
---|
269 | RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
|
---|
270 | ../../lib/gsdllib.a \
|
---|
271 | ../../packages/mg/src/text/libtextin.a \
|
---|
272 | ../../packages/mg/lib/libmg.a \
|
---|
273 | $(FASTCGI_OBJS) \
|
---|
274 | ../mgpp/text/libtextin.a \
|
---|
275 | ../mgpp/lib/libmg.a
|
---|
276 |
|
---|
277 | recpt: $(RECPT_OBJS)
|
---|
278 | $(CPPLINK) $(RECPT_OBJS) $(LIBS)
|
---|
279 |
|
---|
280 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
281 | ifeq ($(USE_Z3950), 1)
|
---|
282 | Z_LIBYAZ_A=$(YAZDIR)/lib/libyaz.a
|
---|
283 | else
|
---|
284 | Z_LIBYAZ_A=
|
---|
285 | endif
|
---|
286 |
|
---|
287 |
|
---|
288 | LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
|
---|
289 | ../../lib/gsdllib.a \
|
---|
290 | ../../packages/mg/src/text/libtextin.a \
|
---|
291 | ../../packages/mg/lib/libmg.a \
|
---|
292 | $(FASTCGI_OBJS) $(Z_LIBYAZ_A) \
|
---|
293 | ../mgpp/text/libtextin.a \
|
---|
294 | ../mgpp/lib/libmg.a
|
---|
295 |
|
---|
296 | library: $(LIBRARY_OBJS)
|
---|
297 | $(CPPLINK) $(LIBRARY_OBJS) $(LIBS)
|
---|
298 |
|
---|
299 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
300 |
|
---|
301 | RECPTLIB_OBJECTS = nullproto.o corbaproto.o \
|
---|
302 | ../../lib/corbatext_t.o ../../lib/corbaconv_text_t.o \
|
---|
303 | ../../lib/corbaiface.o ../../lib/corbaiface_skel.o
|
---|
304 |
|
---|
305 | RLIBRARY_OBJS = $(COMMONOBJECTS) $(RECPTLIB_OBJECTS) $(COLSERVROBJECTS) \
|
---|
306 | ../../lib/gsdllib.a \
|
---|
307 | ../../packages/mg/src/text/libtextin.a \
|
---|
308 | ../../packages/mg/lib/libmg.a \
|
---|
309 | $(FASTCGI_OBJS) $(Z_LIBOBJS) $(Z_LIBYAZ_A) \
|
---|
310 | ../mgpp/text/libtextin.a \
|
---|
311 | ../mgpp/lib/libmg.a
|
---|
312 |
|
---|
313 | RECPTLIB_OBJS = $(RLIBRARY_OBJS) ../colservr/corbaServer.o
|
---|
314 |
|
---|
315 | corbaserver: $(RECPTLIB_OBJS)
|
---|
316 | @echo -e building corbaserver
|
---|
317 | $(MLINK) $(RECPTLIB_OBJS) $(MLIBS)
|
---|
318 | # stripping symbols was a cunning plan, but caused difficulties when
|
---|
319 | # it came to debugging ...
|
---|
320 | # non GNU strips might not like these options - check autoconf?
|
---|
321 | # strip --strip-all --discard-all corbaserver
|
---|
322 | # strip corbaserver
|
---|
323 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
324 |
|
---|
325 | CORBARECPT_OBJECTS = nullproto.o corbaproto.o corbaclient.o
|
---|
326 |
|
---|
327 | CORBARECPT_OBJS = $(COMMONOBJECTS) $(CORBARECPT_OBJECTS) $(COLSERVROBJECTS) \
|
---|
328 | ../../lib/corbaiface.o \
|
---|
329 | ../../lib/corbaiface_skel.o \
|
---|
330 | ../../lib/corbaconv_text_t.o \
|
---|
331 | ../../lib/corbatext_t.o \
|
---|
332 | ../../lib/gsdllib.a \
|
---|
333 | ../../packages/mg/src/text/libtextin.a \
|
---|
334 | ../../packages/mg/lib/libmg.a \
|
---|
335 | $(FASTCGI_OBJS) \
|
---|
336 | ../mgpp/text/libtextin.a \
|
---|
337 | ../mgpp/lib/libmg.a
|
---|
338 |
|
---|
339 |
|
---|
340 | corbarecptldd: $(CORBARECPT_OBJS)
|
---|
341 | @echo -e building corbarecptldd:
|
---|
342 | $(MLINK) $(CORBARECPT_OBJS) $(MLIBS)
|
---|
343 |
|
---|
344 | test:
|
---|