source: main/tags/2.51-fiji/gsdl/src/recpt/Makefile.in@ 24153

Last change on this file since 24153 was 8033, checked in by davidb, 20 years ago

Support for optional compilation of lucene searching and z39.50 server.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 11.9 KB
Line 
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
27USE_Z3950 = @USE_Z3950@
28ifeq ($(USE_Z3950), 1)
29Z_CFLAGS=-DUSE_Z3950
30else
31Z_CFLAGS=
32endif
33
34USE_CORBA = @USE_CORBA@
35ifeq ($(USE_CORBA), 1)
36CORBA_CFLAGS=-DUSE_CORBA
37else
38CORBA_CFLAGS=
39endif
40
41AR = ar
42CC = @CC@
43CXX = @CXX@
44#CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
45
46CXXFLAGS = $(Z_CFLAGS) $(CORBA_CFLAGS) @CXXFLAGS@
47
48# YAZ kit for z39.50
49YAZDIR=../../packages/yaz
50
51USE_LANGACTION = @USE_LANGACTION@
52ifneq ($(USE_LANGACTION), 1)
53LANGACTION_DEFS=
54else
55LANGACTION_DEFS=-DUSE_LANGACTION
56endif
57
58
59USE_FASTCGI = @USE_FASTCGI@
60ifneq ($(USE_FASTCGI), 1)
61DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM @DEFS@ $(LANGACTION_DEFS)
62INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
63 -I../../packages/mg/lib -I../../packages/mg/src/text \
64 -I../mgpp/lib -I../mgpp/text -I../..
65else
66DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI @DEFS@ $(LANGACTION_DEFS)
67INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
68 -I../../packages/mg/lib -I../../packages/mg/src/text \
69 -I../../packages/fcgi/include -I../mgpp/lib \
70 -I../mgpp/text -I../..
71endif
72MICO_DIR = @MICO_DIR@
73MICO_VER = @MICO_VER@
74ifeq ($(MICO_DIR), yes)
75MICO_INC =
76MICO_LIB =
77MICO_PATH =
78else
79ifeq ($(MICO_DIR), default)
80MICO_DIR = ../../packages/mico/include
81MICO_PATH = ../../bin/linux/
82else
83MICO_PATH =
84endif
85MICO_INC = -I$(MICO_DIR)
86MICO_LIB = -L$(MICO_DIR)
87endif
88MINCLUDES = -I. -I../../lib -I../colservr -I../mgpp/text $(MICO_INC)
89
90USE_LUCENE=0
91ifeq ($(USE_LUCENE), 1)
92LC_LIBS = -L../../packages/xerces/lib -lxerces-c
93LC_OBJECTS = \
94 ../colservr/lucenesearch.o \
95 ../colservr/lucenequeryfilter.o \
96 ../colservr/lucenegdbmsource.o \
97 ../colservr/sax_resultset.o \
98 ../colservr/sax_resultset_handler.o
99else
100LC_LIBS =
101LC_OBJECTS =
102endif
103
104
105RANLIB = @RANLIB@
106LDFLAGS = @LDFLAGS@
107GDBM_LIBS=@GDBM_LIBPATH@ -lgdbm
108LIBS = $(GDBM_LIBS) @LIBS@
109GSDLOS = @gsdlos@
110INSTALL = @INSTALL@
111
112COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
113LINK = $(CC) $(LDFLAGS) -o $@
114
115CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
116CXXLINK = $(CXX) $(LDFLAGS) -o $@
117
118MCOMPILE = $(MICO_PATH)mico-c++ -x c++ $(MCFLAGS) $(DEFS) $(MINCLUDES) -c
119MLINK = $(MICO_PATH)mico-ld -static $(LDFLAGS) $(MICO_LIB) -o $@
120MLIBS = $(LIBS) -L../../lib/ -lmico$(MICO_VER) -lmicoaux$(MICO_VER)
121
122# in case gdbm.h/libgdbm.a are in a non-standard place...
123GDBM_OBJS=argdb.o authenaction.o collectoraction.o infodbclass.o userdb.o usersaction.o historydb.o librarymain.o nullproto.o queryaction.o z3950proto.o
124
125ifeq ($(USE_CORBA), 1)
126#EXEC = recpt library corbaserver corbarecptldd
127EXEC = library corbaserver corbarecptldd
128else
129#EXEC = recpt library
130EXEC = library
131endif
132
133all: $(EXEC)
134
135
136.SUFFIXES:
137.SUFFIXES: .c .o
138.c.o:
139 $(COMPILE) $<
140
141.SUFFIXES: .cpp .o
142.cpp.o:
143 $(CXXCOMPILE) $<
144
145$(GDBM_OBJS) :%.o :%.cpp
146 $(CXXCOMPILE) @GDBM_INCLUDE@ $<
147
148.SUFFIXES: .mpp .o
149.mpp.o:
150 $(MCOMPILE) $< -o $@
151
152ifeq ($(USE_LANGACTION), 1)
153LANG_HEADERS=langaction.h langdb.h
154else
155LANG_HEADERS=
156endif
157
158COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
159 converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h \
160 statusaction.h pageaction.h comtypes.h recptproto.h \
161 pingaction.h queryaction.h documentaction.h \
162 extlinkaction.h browseaction.h htmlutils.h argdb.h \
163 querytools.h browseactiontools.h formattools.h tipaction.h authenaction.h infodbclass.h \
164 userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
165 datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
166 htmlbrowserclass.h phindbrowserclass.h historydb.h collectoraction.h \
167 phindaction.h summarise.h highlighttext.h $(LANG_HEADERS)
168
169RECEPTHEADERS =
170
171ifeq ($(USE_CORBA), 1)
172LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h corbaproto.h
173else
174LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
175endif
176
177HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
178
179ifeq ($(USE_LANGACTION), 1)
180LANG_SOURCES= langaction.cpp langdb.cpp
181else
182LANG_SOURCES=
183endif
184
185COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
186 converter.cpp recptconfig.cpp cgiutils.cpp OIDtools.cpp browsetools.cpp \
187 statusaction.cpp pageaction.cpp comtypes.cpp \
188 recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
189 extlinkaction.cpp browseaction.h htmlutils.cpp querytools.cpp \
190 tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
191 vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
192 invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
193 phindbrowserclass.cpp historydb.cpp collectoraction.cpp argdb.cpp \
194 browseactiontools.h formattools.cpp phindaction.cpp summarise.cpp \
195 highlighttext.cpp $(LANG_SOURCES)
196
197
198RECPTSOURCES = recptmain.cpp
199
200ifeq ($(USE_Z3950), 1)
201Z_LIBSOURCES=z3950proto.cpp z3950server.cpp zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c
202else
203Z_LIBSOURCES=
204endif
205
206LIBRARYSOURCES = nullproto.cpp librarymain.cpp $(Z_LIBSOURCES)
207
208SOURCES = $(COMMONSOURCES) $(LANG_SOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
209
210
211ifeq ($(USE_Z3950), 1)
212Z_COMOBJS=parse.yy.o
213else
214Z_COMOBJS=
215endif
216
217ifeq ($(USE_LANGACTION), 1)
218LANG_OBJECTS= langaction.o langdb.o
219else
220LANG_OBJECTS=
221endif
222
223COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
224 converter.o recptconfig.o cgiutils.o OIDtools.o browsetools.o \
225 statusaction.o pageaction.o comtypes.o \
226 recptproto.o pingaction.o queryaction.o documentaction.o \
227 extlinkaction.o browseaction.o htmlutils.o querytools.o browseactiontools.o \
228 formattools.o tipaction.o authenaction.o argdb.o \
229 infodbclass.o userdb.o usersaction.o vlistbrowserclass.o \
230 hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
231 pagedbrowserclass.o htmlbrowserclass.o phindbrowserclass.o \
232 historydb.o $(Z_COMOBJS) collectoraction.o phindaction.o \
233 summarise.o highlighttext.o $(LANG_OBJECTS)
234
235RECPTOBJECTS = recptmain.o
236
237
238ifeq ($(USE_Z3950), 1)
239Z_LIBOBJS=z3950proto.o z3950server.o zparse.tab.o $(YAZDIR)/client/yaz_zclient.o
240else
241Z_LIBOBJS=
242endif
243
244LIBRARYOBJECTS = nullproto.o librarymain.o $(Z_LIBOBJS)
245
246OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
247
248
249COLSERVROBJECTS = ../colservr/mgq.o \
250 ../colservr/search.o \
251 ../colservr/mgsearch.o \
252 ../colservr/querycache.o \
253 ../colservr/queryinfo.o \
254 ../colservr/collectserver.o \
255 ../colservr/colservrconfig.o \
256 ../colservr/maptools.o \
257 ../colservr/filter.o \
258 ../colservr/source.o \
259 ../colservr/browsefilter.o \
260 ../colservr/queryfilter.o \
261 ../colservr/mggdbmsource.o \
262 ../colservr/phrasesearch.o \
263 ../colservr/phrasequeryfilter.o \
264 ../colservr/mgqueryfilter.o \
265 ../colservr/mgppsearch.o \
266 ../colservr/mgppqueryfilter.o \
267 ../colservr/collectset.o \
268 $(LC_OBJECTS)
269
270
271
272## z39.50 rules
273# Note! If USE_FASTCGI=1, yaz is still compiled and linked, but never
274# called by librarymain.cpp.
275$(YAZDIR)/client/yaz_zclient.o: $(YAZDIR)/lib/libyaz.a
276 cd $(YAZDIR)/client && $(MAKE) yaz_zclient.o
277
278# this should be done by the top level makefile...
279$(YAZDIR)/lib/libyaz.a:
280 cd $(YAZDIR) && $(MAKE) all
281
282# put a separate rule here, as it speeds up compilation of other objects
283# if they don't need to include all the yaz headers
284z3950%.o: z3950%.cpp
285 $(COMPILE) -I$(YAZDIR)/include $<
286
287zparse.tab.c: zparse.y
288 @YACC@ -b zparse -d zparse.y
289
290zparse.tab.h: zparse.tab.c
291
292parse.yy.c: parse.fl zparse.tab.h
293 flex -oparse.yy.c parse.fl
294
295
296
297# We'll keep the .c and .h files for those without lex/flex and yacc/bison.
298#PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h parse.yy.o parse.yy.c
299PARSE_TMPFILE=zparse.tab.o parse.yy.o
300
301distclean:
302 rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES) Makefile
303
304clean:
305 rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES)
306
307install:
308 $(INSTALL) -m 755 -s library ../../cgi-bin
309
310depend:
311 makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
312
313# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
314ifeq ($(USE_FASTCGI), 1)
315 FASTCGI_OBJS = ../../packages/fcgi/libfcgi/libfcgi.a
316else
317 FASTCGI_OBJS =
318endif
319
320RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
321 ../../lib/gsdllib.a \
322 ../../packages/mg/src/text/libtextin.a \
323 ../../packages/mg/lib/libmg.a \
324 $(FASTCGI_OBJS) \
325 ../mgpp/text/libtextin.a \
326 ../mgpp/lib/libmg.a
327
328recpt: $(RECPT_OBJS)
329 $(CXXLINK) $(RECPT_OBJS) $(LIBS)
330
331# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
332ifeq ($(USE_Z3950), 1)
333Z_LIBYAZ_A=$(YAZDIR)/lib/libyaz.a
334else
335Z_LIBYAZ_A=
336endif
337
338
339LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
340 ../../lib/gsdllib.a \
341 ../../packages/mg/src/text/libtextin.a \
342 ../../packages/mg/lib/libmg.a \
343 $(FASTCGI_OBJS) $(Z_LIBYAZ_A) \
344 ../mgpp/text/libtextin.a \
345 ../mgpp/lib/libmg.a
346
347library: $(LIBRARY_OBJS)
348 $(CXXLINK) $(LIBRARY_OBJS) $(LIBS)
349
350# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
351
352RECPTLIB_OBJECTS = nullproto.o corbaproto.o \
353 ../../lib/corbatext_t.o ../../lib/corbaconv_text_t.o \
354 ../../lib/corbaiface.o ../../lib/corbaiface_skel.o
355
356RLIBRARY_OBJS = $(COMMONOBJECTS) $(RECPTLIB_OBJECTS) $(COLSERVROBJECTS) \
357 ../../lib/gsdllib.a \
358 ../../packages/mg/src/text/libtextin.a \
359 ../../packages/mg/lib/libmg.a \
360 $(FASTCGI_OBJS) $(Z_LIBOBJS) $(Z_LIBYAZ_A) \
361 ../mgpp/text/libtextin.a \
362 ../mgpp/lib/libmg.a
363
364RECPTLIB_OBJS = $(RLIBRARY_OBJS) ../colservr/corbaServer.o
365
366corbaserver: $(RECPTLIB_OBJS)
367 @echo -e building corbaserver
368 $(MLINK) $(RECPTLIB_OBJS) $(MLIBS)
369# stripping symbols was a cunning plan, but caused difficulties when
370# it came to debugging ...
371# non GNU strips might not like these options - check autoconf?
372# strip --strip-all --discard-all corbaserver
373# strip corbaserver
374# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
375
376CORBARECPT_OBJECTS = nullproto.o corbaproto.o corbaclient.o
377
378CORBARECPT_OBJS = $(COMMONOBJECTS) $(CORBARECPT_OBJECTS) $(COLSERVROBJECTS) \
379 ../../lib/corbaiface.o \
380 ../../lib/corbaiface_skel.o \
381 ../../lib/corbaconv_text_t.o \
382 ../../lib/corbatext_t.o \
383 ../../lib/gsdllib.a \
384 ../../packages/mg/src/text/libtextin.a \
385 ../../packages/mg/lib/libmg.a \
386 $(FASTCGI_OBJS) \
387 ../mgpp/text/libtextin.a \
388 ../mgpp/lib/libmg.a
389
390
391corbarecptldd: $(CORBARECPT_OBJS)
392 @echo -e building corbarecptldd:
393 $(MLINK) $(CORBARECPT_OBJS) $(MLIBS)
394
395test:
396
397Z3950_OBJS = $(COMMONOBJECTS) $(COLSERVROBJECTS) \
398 ../colservr/z3950server.o ../colservr/read-grs.o nullproto.o \
399 ../../lib/gsdllib.a \
400 ../../packages/mg/src/text/libtextin.a \
401 ../../packages/mg/lib/libmg.a \
402 $(FASTCGI_OBJS) \
403 ../mgpp/text/libtextin.a \
404 ../mgpp/lib/libmg.a ../../packages/yaz-1.9/lib/.libs/libyaz.a
405
406z3950server: $(Z3950_OBJS)
407 @echo -e building z3950server
408 $(CXXLINK) $(Z3950_OBJS) $(LIBS)
Note: See TracBrowser for help on using the repository browser.