source: trunk/gsdl/src/recpt/Makefile.in@ 10148

Last change on this file since 10148 was 10143, checked in by kjdon, 19 years ago

the last commit was an accident, but its ok

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