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 | #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
|
---|
30 | CCFLAGS = @CFLAGS@
|
---|
31 |
|
---|
32 | # YAZ kit for z39.50
|
---|
33 | YAZDIR=../../packages/yaz
|
---|
34 |
|
---|
35 | USE_FASTCGI = @USE_FASTCGI@
|
---|
36 | ifneq ($(USE_FASTCGI), 1)
|
---|
37 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER \
|
---|
38 | -DGSDLUSAGELOG @DEFS@
|
---|
39 |
|
---|
40 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
41 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
42 | -I../mgpp/lib -I../mgpp/text
|
---|
43 | else
|
---|
44 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DGSDLSERVER \
|
---|
45 | -DGSDLUSAGELOG -DUSE_FASTCGI @DEFS@
|
---|
46 |
|
---|
47 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
48 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
49 | -I../../packages/fcgi/include -I../mgpp/lib \
|
---|
50 | -I../mgpp/text
|
---|
51 | endif
|
---|
52 |
|
---|
53 | RANLIB = @RANLIB@
|
---|
54 | LDFLAGS = @LDFLAGS@
|
---|
55 | LIBS = @LIBS@
|
---|
56 |
|
---|
57 | GSDLOS = @gsdlos@
|
---|
58 |
|
---|
59 |
|
---|
60 | COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
61 | LINK = $(CC) $(LDFLAGS) -o $@
|
---|
62 |
|
---|
63 | .SUFFIXES:
|
---|
64 | .SUFFIXES: .c .o
|
---|
65 | .c.o:
|
---|
66 | $(COMPILE) $<
|
---|
67 |
|
---|
68 | .SUFFIXES: .cpp .o
|
---|
69 | .cpp.o:
|
---|
70 | $(COMPILE) $<
|
---|
71 |
|
---|
72 | COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
|
---|
73 | converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h htmlgen.h \
|
---|
74 | statusaction.h pageaction.h comtypes.h recptproto.h \
|
---|
75 | pingaction.h queryaction.h documentaction.h \
|
---|
76 | extlinkaction.h htmlutils.h \
|
---|
77 | querytools.h formattools.h tipaction.h authenaction.h infodbclass.h \
|
---|
78 | userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
|
---|
79 | datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
|
---|
80 | htmlbrowserclass.h phindbrowserclass.h \
|
---|
81 | delhistoryaction.h historydb.h collectoraction.h
|
---|
82 |
|
---|
83 | RECEPTHEADERS =
|
---|
84 |
|
---|
85 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
|
---|
86 |
|
---|
87 | HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
|
---|
88 |
|
---|
89 |
|
---|
90 | COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
|
---|
91 | converter.cpp recptconfig.cpp cgiutils.cpp OIDtools.cpp browsetools.cpp \
|
---|
92 | htmlgen.cpp statusaction.cpp pageaction.cpp comtypes.cpp \
|
---|
93 | recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
|
---|
94 | extlinkaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
|
---|
95 | tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
|
---|
96 | vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
|
---|
97 | invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
|
---|
98 | phindbrowserclass.cpp delhistoryaction.cpp historydb.cpp collectoraction.cpp
|
---|
99 |
|
---|
100 |
|
---|
101 | RECPTSOURCES = recptmain.cpp
|
---|
102 |
|
---|
103 | LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp \
|
---|
104 | zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c
|
---|
105 |
|
---|
106 | SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
|
---|
107 |
|
---|
108 |
|
---|
109 | COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
|
---|
110 | converter.o recptconfig.o cgiutils.o OIDtools.o browsetools.o \
|
---|
111 | htmlgen.o statusaction.o pageaction.o comtypes.o \
|
---|
112 | recptproto.o pingaction.o queryaction.o documentaction.o \
|
---|
113 | extlinkaction.o htmlutils.o querytools.o \
|
---|
114 | formattools.o tipaction.o authenaction.o \
|
---|
115 | infodbclass.o userdb.o usersaction.o vlistbrowserclass.o \
|
---|
116 | hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
|
---|
117 | pagedbrowserclass.o htmlbrowserclass.o phindbrowserclass.o \
|
---|
118 | delhistoryaction.o historydb.o parse.yy.o collectoraction.o
|
---|
119 |
|
---|
120 | RECPTOBJECTS = recptmain.o
|
---|
121 |
|
---|
122 | LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o librarymain.o \
|
---|
123 | zparse.tab.o $(YAZDIR)/client/yaz_zclient.o
|
---|
124 |
|
---|
125 | OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
|
---|
126 |
|
---|
127 |
|
---|
128 | COLSERVROBJECTS = ../colservr/mgq.o \
|
---|
129 | ../colservr/search.o \
|
---|
130 | ../colservr/mgsearch.o \
|
---|
131 | ../colservr/querycache.o \
|
---|
132 | ../colservr/queryinfo.o \
|
---|
133 | ../colservr/collectserver.o \
|
---|
134 | ../colservr/colservrconfig.o \
|
---|
135 | ../colservr/maptools.o \
|
---|
136 | ../colservr/filter.o \
|
---|
137 | ../colservr/source.o \
|
---|
138 | ../colservr/browsefilter.o \
|
---|
139 | ../colservr/queryfilter.o \
|
---|
140 | ../colservr/mggdbmsource.o \
|
---|
141 | ../colservr/phrasesearch.o \
|
---|
142 | ../colservr/phrasequeryfilter.o \
|
---|
143 | ../colservr/mgqueryfilter.o \
|
---|
144 | ../colservr/mgppsearch.o \
|
---|
145 | ../colservr/mgppqueryfilter.o
|
---|
146 |
|
---|
147 | #EXEC = recpt library
|
---|
148 | EXEC = library
|
---|
149 |
|
---|
150 | all: $(EXEC)
|
---|
151 |
|
---|
152 |
|
---|
153 |
|
---|
154 | ## z39.50 stuff
|
---|
155 | # Note! If USE_FASTCGI=1, yaz is still compiled and linked, but never
|
---|
156 | # called by librarymain.cpp.
|
---|
157 | $(YAZDIR)/client/yaz_zclient.o: $(YAZDIR)/lib/libyaz.a
|
---|
158 | cd $(YAZDIR)/client && make yaz_zclient.o
|
---|
159 |
|
---|
160 | $(YAZDIR)/lib/libyaz.a:
|
---|
161 | cd $(YAZDIR) && ./configure && make all
|
---|
162 |
|
---|
163 | # put a separate rule here, as it speeds up compilation of other objects
|
---|
164 | # if they don't need to include all the yaz headers
|
---|
165 | z3950%.o: z3950%.cpp
|
---|
166 | $(COMPILE) -I$(YAZDIR)/include $<
|
---|
167 |
|
---|
168 | zparse.tab.c: zparse.y
|
---|
169 | @YACC@ -b zparse -d zparse.y
|
---|
170 |
|
---|
171 | zparse.tab.h: zparse.tab.c
|
---|
172 |
|
---|
173 | parse.yy.c: parse.fl zparse.tab.h
|
---|
174 | flex -oparse.yy.c parse.fl
|
---|
175 |
|
---|
176 |
|
---|
177 |
|
---|
178 | # We'll keep the .c and .h files for those without lex/flex and yacc/bison.
|
---|
179 | #PARSE_TMPFILES= zparse.tab.o zparse.tab.c zparse.tab.h parse.yy.o parse.yy.c
|
---|
180 | PARSE_TMPFILE=zparse.tab.o parse.yy.o
|
---|
181 |
|
---|
182 | distclean:
|
---|
183 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES) Makefile
|
---|
184 | (cd $(YAZDIR) && make distclean)
|
---|
185 |
|
---|
186 | clean:
|
---|
187 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES)
|
---|
188 | (cd $(YAZDIR) && make clean)
|
---|
189 |
|
---|
190 | install:
|
---|
191 | install -m 755 -s library ../../cgi-bin/library
|
---|
192 |
|
---|
193 | depend:
|
---|
194 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
|
---|
195 |
|
---|
196 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
197 |
|
---|
198 | ifneq ($(USE_FASTCGI), 1)
|
---|
199 | RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
|
---|
200 | ../../lib/gsdllib.a \
|
---|
201 | ../../packages/mg/src/text/libtextin.a \
|
---|
202 | ../../packages/mg/lib/libmg.a \
|
---|
203 | ../mgpp/text/libtextin.a \
|
---|
204 | ../mgpp/lib/libmg.a
|
---|
205 | else
|
---|
206 | RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
|
---|
207 | ../../lib/gsdllib.a \
|
---|
208 | ../../packages/mg/src/text/libtextin.a \
|
---|
209 | ../../packages/mg/lib/libmg.a \
|
---|
210 | ../../packages/fcgi/libfcgi/libfcgi.a \
|
---|
211 | ../mgpp/text/libtextin.a \
|
---|
212 | ../mgpp/lib/libmg.a
|
---|
213 | endif
|
---|
214 |
|
---|
215 | recpt: $(RECPT_OBJS)
|
---|
216 | $(LINK) $(RECPT_OBJS) $(LIBS)
|
---|
217 |
|
---|
218 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
219 |
|
---|
220 | ifneq ($(USE_FASTCGI), 1)
|
---|
221 | LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
|
---|
222 | ../../lib/gsdllib.a \
|
---|
223 | ../../packages/mg/src/text/libtextin.a \
|
---|
224 | ../../packages/mg/lib/libmg.a \
|
---|
225 | $(YAZDIR)/lib/libyaz.a \
|
---|
226 | ../mgpp/text/libtextin.a \
|
---|
227 | ../mgpp/lib/libmg.a
|
---|
228 | else
|
---|
229 | LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
|
---|
230 | ../../lib/gsdllib.a \
|
---|
231 | ../../packages/mg/src/text/libtextin.a \
|
---|
232 | ../../packages/mg/lib/libmg.a \
|
---|
233 | ../../packages/fcgi/libfcgi/libfcgi.a \
|
---|
234 | ../mgpp/text/libtextin.a \
|
---|
235 | ../mgpp/lib/libmg.a \
|
---|
236 | $(YAZDIR)/lib/libyaz.a
|
---|
237 | endif
|
---|
238 |
|
---|
239 | library: $(LIBRARY_OBJS)
|
---|
240 | $(LINK) $(LIBRARY_OBJS) $(LIBS)
|
---|
241 |
|
---|
242 |
|
---|
243 |
|
---|
244 |
|
---|
245 |
|
---|