[552] | 1 | ###########################################################################
|
---|
| 2 | #
|
---|
[558] | 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 | #
|
---|
[552] | 8 | # Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
| 9 | #
|
---|
| 10 | #
|
---|
[558] | 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 | #
|
---|
[552] | 25 | ###########################################################################
|
---|
| 26 |
|
---|
| 27 | AR = ar
|
---|
| 28 | CC = @CC@
|
---|
[1860] | 29 | CPP = @CXX@
|
---|
[1283] | 30 | #CCFLAGS = @CFLAGS@ -Wall -Wunused -pedantic -W -Woverloaded-virtual
|
---|
| 31 | CCFLAGS = @CFLAGS@
|
---|
[568] | 32 |
|
---|
[1347] | 33 | # YAZ kit for z39.50
|
---|
| 34 | YAZDIR=../../packages/yaz
|
---|
| 35 |
|
---|
[568] | 36 | USE_FASTCGI = @USE_FASTCGI@
|
---|
| 37 | ifneq ($(USE_FASTCGI), 1)
|
---|
[1776] | 38 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM @DEFS@
|
---|
[558] | 39 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
[1331] | 40 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
[1519] | 41 | -I../mgpp/lib -I../mgpp/text
|
---|
[568] | 42 | else
|
---|
[1776] | 43 | DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI @DEFS@
|
---|
[989] | 44 |
|
---|
[568] | 45 | INCLUDES = -I../../lib -I. -I../colservr -I../../packages/mg \
|
---|
| 46 | -I../../packages/mg/lib -I../../packages/mg/src/text \
|
---|
[1331] | 47 | -I../../packages/fcgi/include -I../mgpp/lib \
|
---|
[1519] | 48 | -I../mgpp/text
|
---|
[556] | 49 | endif
|
---|
[1860] | 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)
|
---|
[568] | 62 |
|
---|
[1860] | 63 | USE_CORBA = @USE_CORBA@
|
---|
| 64 |
|
---|
[552] | 65 | RANLIB = @RANLIB@
|
---|
| 66 | LDFLAGS = @LDFLAGS@
|
---|
[985] | 67 | LIBS = @LIBS@
|
---|
[552] | 68 |
|
---|
[558] | 69 | GSDLOS = @gsdlos@
|
---|
[552] | 70 |
|
---|
| 71 |
|
---|
| 72 | COMPILE = $(CC) -c $(CCFLAGS) $(DEFS) $(INCLUDES)
|
---|
| 73 | LINK = $(CC) $(LDFLAGS) -o $@
|
---|
| 74 |
|
---|
[1860] | 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 |
|
---|
[552] | 82 | .SUFFIXES:
|
---|
| 83 | .SUFFIXES: .c .o
|
---|
| 84 | .c.o:
|
---|
| 85 | $(COMPILE) $<
|
---|
| 86 |
|
---|
| 87 | .SUFFIXES: .cpp .o
|
---|
| 88 | .cpp.o:
|
---|
[1860] | 89 | $(CPPCOMPILE) $<
|
---|
[552] | 90 |
|
---|
[1860] | 91 | .SUFFIXES: .mpp .o
|
---|
| 92 | .mpp.o:
|
---|
| 93 | $(MCOMPILE) $<
|
---|
| 94 |
|
---|
[675] | 95 | COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
|
---|
[552] | 96 | converter.h recptconfig.h cgiutils.h OIDtools.h browsetools.h htmlgen.h \
|
---|
| 97 | statusaction.h pageaction.h comtypes.h recptproto.h \
|
---|
[722] | 98 | pingaction.h queryaction.h documentaction.h \
|
---|
[1494] | 99 | extlinkaction.h htmlutils.h \
|
---|
[552] | 100 | querytools.h formattools.h tipaction.h authenaction.h infodbclass.h \
|
---|
[675] | 101 | userdb.h usersaction.h vlistbrowserclass.h hlistbrowserclass.h \
|
---|
[713] | 102 | datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \
|
---|
[1643] | 103 | htmlbrowserclass.h phindbrowserclass.h \
|
---|
[1910] | 104 | historydb.h collectoraction.h
|
---|
[552] | 105 |
|
---|
| 106 | RECEPTHEADERS =
|
---|
| 107 |
|
---|
[1860] | 108 | ifeq ($(USE_CORBA), 1)
|
---|
| 109 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h corbaproto.h
|
---|
| 110 | else
|
---|
[1347] | 111 | LIBRARYHEADERS = nullproto.h z3950proto.h z3950server.h
|
---|
[1860] | 112 | endif
|
---|
[552] | 113 |
|
---|
| 114 | HEADERS = $(COMMONHEADERS) $(RECPTHEADERS) $(LIBRARYHEADERS)
|
---|
| 115 |
|
---|
| 116 |
|
---|
[675] | 117 | COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
|
---|
[552] | 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 \
|
---|
[1494] | 121 | extlinkaction.cpp htmlutils.cpp querytools.cpp formattools.cpp \
|
---|
[722] | 122 | tipaction.cpp authenaction.cpp infodbclass.cpp userdb.cpp usersaction.cpp \
|
---|
| 123 | vlistbrowserclass.cpp hlistbrowserclass.cpp datelistbrowserclass.cpp \
|
---|
[951] | 124 | invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \
|
---|
[1910] | 125 | phindbrowserclass.cpp historydb.cpp collectoraction.cpp
|
---|
[552] | 126 |
|
---|
[722] | 127 |
|
---|
[552] | 128 | RECPTSOURCES = recptmain.cpp
|
---|
| 129 |
|
---|
[1347] | 130 | LIBRARYSOURCES = nullproto.cpp z3950proto.cpp z3950server.cpp librarymain.cpp \
|
---|
| 131 | zparse.tab.c parse.yy.c $(YAZDIR)/client/yaz_zclient.c
|
---|
[552] | 132 |
|
---|
| 133 | SOURCES = $(COMMONSOURCES) $(RECPTSOURCES) $(LIBRARYSOURCES)
|
---|
| 134 |
|
---|
| 135 |
|
---|
[675] | 136 | COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
|
---|
[552] | 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 \
|
---|
[1494] | 140 | extlinkaction.o htmlutils.o querytools.o \
|
---|
[722] | 141 | formattools.o tipaction.o authenaction.o \
|
---|
[675] | 142 | infodbclass.o userdb.o usersaction.o vlistbrowserclass.o \
|
---|
| 143 | hlistbrowserclass.o datelistbrowserclass.o invbrowserclass.o \
|
---|
[1643] | 144 | pagedbrowserclass.o htmlbrowserclass.o phindbrowserclass.o \
|
---|
[1910] | 145 | historydb.o parse.yy.o collectoraction.o
|
---|
[552] | 146 |
|
---|
| 147 | RECPTOBJECTS = recptmain.o
|
---|
| 148 |
|
---|
[1347] | 149 | LIBRARYOBJECTS = nullproto.o z3950proto.o z3950server.o librarymain.o \
|
---|
| 150 | zparse.tab.o $(YAZDIR)/client/yaz_zclient.o
|
---|
[552] | 151 |
|
---|
| 152 | OBJECTS = $(COMMONOBJECTS) $(RECPTOBJECTS) $(LIBRARYOBJECTS)
|
---|
| 153 |
|
---|
| 154 |
|
---|
[558] | 155 | COLSERVROBJECTS = ../colservr/mgq.o \
|
---|
[1331] | 156 | ../colservr/search.o \
|
---|
[558] | 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 \
|
---|
[1331] | 169 | ../colservr/phrasequeryfilter.o \
|
---|
| 170 | ../colservr/mgqueryfilter.o \
|
---|
| 171 | ../colservr/mgppsearch.o \
|
---|
[1860] | 172 | ../colservr/mgppqueryfilter.o \
|
---|
| 173 | ../colservr/collectset.o
|
---|
[558] | 174 |
|
---|
[1860] | 175 | ifeq ($(USE_CORBA), 1)
|
---|
| 176 | #EXEC = recpt library corbaserver corbarecptldd
|
---|
| 177 | EXEC = library corbaserver corbarecptldd
|
---|
| 178 | else
|
---|
[1347] | 179 | #EXEC = recpt library
|
---|
| 180 | EXEC = library
|
---|
[1860] | 181 | endif
|
---|
[558] | 182 |
|
---|
| 183 | all: $(EXEC)
|
---|
[552] | 184 |
|
---|
[1519] | 185 |
|
---|
| 186 |
|
---|
[1347] | 187 | ## z39.50 stuff
|
---|
[1381] | 188 | # Note! If USE_FASTCGI=1, yaz is still compiled and linked, but never
|
---|
| 189 | # called by librarymain.cpp.
|
---|
[1348] | 190 | $(YAZDIR)/client/yaz_zclient.o: $(YAZDIR)/lib/libyaz.a
|
---|
[1347] | 191 | cd $(YAZDIR)/client && make yaz_zclient.o
|
---|
| 192 |
|
---|
[1715] | 193 | # this should be done by the top level makefile...
|
---|
[1347] | 194 | $(YAZDIR)/lib/libyaz.a:
|
---|
[1715] | 195 | cd $(YAZDIR) && make all
|
---|
[1347] | 196 |
|
---|
[1519] | 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 |
|
---|
[1347] | 202 | zparse.tab.c: zparse.y
|
---|
[1351] | 203 | @YACC@ -b zparse -d zparse.y
|
---|
[1347] | 204 |
|
---|
[1355] | 205 | zparse.tab.h: zparse.tab.c
|
---|
| 206 |
|
---|
[1365] | 207 | parse.yy.c: parse.fl zparse.tab.h
|
---|
[1347] | 208 | flex -oparse.yy.c parse.fl
|
---|
| 209 |
|
---|
[1519] | 210 |
|
---|
| 211 |
|
---|
[1385] | 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
|
---|
[1347] | 215 |
|
---|
[992] | 216 | distclean:
|
---|
[1347] | 217 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES) Makefile
|
---|
[992] | 218 |
|
---|
[552] | 219 | clean:
|
---|
[1347] | 220 | rm -f $(OBJECTS) $(EXEC) $(PARSE_TMPFILES)
|
---|
[552] | 221 |
|
---|
| 222 | install:
|
---|
[1887] | 223 | install -m 755 -s library ../../cgi-bin
|
---|
[552] | 224 |
|
---|
| 225 | depend:
|
---|
| 226 | makedepend -Y -- $(DEFS) $(INCLUDES) $(CCFLAGS) -- $(SOURCES)
|
---|
| 227 |
|
---|
| 228 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
| 229 |
|
---|
[568] | 230 | ifneq ($(USE_FASTCGI), 1)
|
---|
[552] | 231 | RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
|
---|
| 232 | ../../lib/gsdllib.a \
|
---|
| 233 | ../../packages/mg/src/text/libtextin.a \
|
---|
[1331] | 234 | ../../packages/mg/lib/libmg.a \
|
---|
| 235 | ../mgpp/text/libtextin.a \
|
---|
| 236 | ../mgpp/lib/libmg.a
|
---|
[568] | 237 | else
|
---|
| 238 | RECPT_OBJS = $(COMMONOBJECTS) $(RECPTOBJECTS) \
|
---|
| 239 | ../../lib/gsdllib.a \
|
---|
| 240 | ../../packages/mg/src/text/libtextin.a \
|
---|
| 241 | ../../packages/mg/lib/libmg.a \
|
---|
[1331] | 242 | ../../packages/fcgi/libfcgi/libfcgi.a \
|
---|
| 243 | ../mgpp/text/libtextin.a \
|
---|
| 244 | ../mgpp/lib/libmg.a
|
---|
[556] | 245 | endif
|
---|
[552] | 246 |
|
---|
| 247 | recpt: $(RECPT_OBJS)
|
---|
[1860] | 248 | $(CPPLINK) $(RECPT_OBJS) $(LIBS)
|
---|
[552] | 249 |
|
---|
| 250 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
| 251 |
|
---|
[568] | 252 | ifneq ($(USE_FASTCGI), 1)
|
---|
[558] | 253 | LIBRARY_OBJS = $(COMMONOBJECTS) $(LIBRARYOBJECTS) $(COLSERVROBJECTS) \
|
---|
[552] | 254 | ../../lib/gsdllib.a \
|
---|
| 255 | ../../packages/mg/src/text/libtextin.a \
|
---|
[1331] | 256 | ../../packages/mg/lib/libmg.a \
|
---|
[1347] | 257 | $(YAZDIR)/lib/libyaz.a \
|
---|
[1331] | 258 | ../mgpp/text/libtextin.a \
|
---|
| 259 | ../mgpp/lib/libmg.a
|
---|
[568] | 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 \
|
---|
[1331] | 265 | ../../packages/fcgi/libfcgi/libfcgi.a \
|
---|
| 266 | ../mgpp/text/libtextin.a \
|
---|
[1381] | 267 | ../mgpp/lib/libmg.a \
|
---|
| 268 | $(YAZDIR)/lib/libyaz.a
|
---|
[556] | 269 | endif
|
---|
[552] | 270 |
|
---|
| 271 | library: $(LIBRARY_OBJS)
|
---|
[1860] | 272 | $(CPPLINK) $(LIBRARY_OBJS) $(LIBS)
|
---|
[1331] | 273 |
|
---|
[1860] | 274 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
[1331] | 275 |
|
---|
[1860] | 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
|
---|
[1331] | 296 |
|
---|
[1860] | 297 | corbaserver: $(RECPTLIB_OBJS)
|
---|
| 298 | $(MLINK) $(RECPTLIB_OBJS) $(MLIBS)
|
---|
[1331] | 299 |
|
---|
[1860] | 300 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
|
---|
[1331] | 301 |
|
---|
[1860] | 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:
|
---|