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

Last change on this file since 2371 was 2371, checked in by jrm21, 23 years ago

Minor changes, so compilation works when libgdbm is not in system paths - this
happens on non-linux machines.

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