root/gsdl/trunk/src/recpt/Makefile.in @ 15452

Revision 15452, 12.5 KB (checked in by mdewsnip, 12 years ago)

Tidied up include directories required in the recpt directory.

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