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