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

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

various - changed make to $(MAKE), tidied up conditionals (eg for USE_FASTCGI).

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