root/main/trunk/greenstone2/runtime-src/src/recpt/Makefile.in @ 28760

Revision 28760, 8.4 KB (checked in by ak19, 6 years ago)

Adding in the first working version of the formatconverter program which uses formattools to convert GS2 statements to GS3. Not all the GS2 terms have GS3 equivalents yet and the current ones still need to be run by Dr Bainbridge, but nested IFs and ORs seem to work alright in general. Kathy made the important changes to Makefile.in to get the new formatconverter.cpp to compile. formatconverter.cpp uses the new GS2-to-GS3 specific functions added to formattools.cpp

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1###########################################################################
2#
3# Makefile -- runtime-src/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-2008  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
27GSDL_DIR = ../../..
28COMMON_DIR = $(GSDL_DIR)/common-src
29RUNTIME_DIR = $(GSDL_DIR)/runtime-src
30
31GSDLOS = @gsdlos@
32GSDLARCH = @gsdlarch@
33
34INDEXERS_DIR = $(COMMON_DIR)/indexers
35COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
36RUNTIME_PACKAGES_DIR = $(RUNTIME_DIR)/packages
37COLSERVR_DIR = $(RUNTIME_DIR)/src/colservr
38PROTOCOL_DIR = $(RUNTIME_DIR)/src/protocol
39Z3950_DIR = $(RUNTIME_DIR)/src/z3950
40
41
42ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
43ifeq ($(ENABLE_ACCENTFOLD), 1)
44ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a $(COMMON_PACKAGES_DIR)/iconv/lib/libiconv.a
45else
46ACCENTFOLD_LIBS =
47endif
48
49ENABLE_MG = @ENABLE_MG@
50ifeq ($(ENABLE_MG), 1)
51MG_INDEXERS_LIBS = $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
52    $(INDEXERS_DIR)/mg/lib/libmglib.a
53MG_INCLUDES = -I$(INDEXERS_DIR)/mg -I$(INDEXERS_DIR)/mg/lib
54else
55MG_INDEXERS_LIBS =
56MG_INCLUDES =
57endif
58
59ENABLE_MGPP = @ENABLE_MGPP@
60ifeq ($(ENABLE_MGPP), 1)
61MGPP_SOURCES = phindaction.cpp
62MGPP_OBJECTS = phindaction.o
63MGPP_INDEXERS_LIBS = $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
64    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a
65MGPP_INCLUDES = -I$(INDEXERS_DIR)/mgpp/text -I$(INDEXERS_DIR)/mgpp/lib
66else
67MGPP_SOURCES =
68MGPP_OBJECTS =
69MGPP_INDEXERS_LIBS =
70MGPP_INCLUDES =
71endif
72
73USE_FASTCGI = @USE_FASTCGI@
74ifeq ($(USE_FASTCGI), 1)
75FASTCGI_DEFS = -DUSE_FASTCGI
76FASTCGI_INCLUDES = -I$(RUNTIME_PACKAGES_DIR)/fcgi/include
77FASTCGI_LIBS = $(RUNTIME_PACKAGES_DIR)/fcgi/libfcgi/libfcgi.a
78else
79FASTCGI_DEFS =
80FASTCGI_INCLUDES =
81FASTCGI_LIBS =
82endif
83
84USE_GDBM = @USE_GDBM@
85ifeq ($(USE_GDBM), 1)
86GDBM_DEFINES = -DUSE_GDBM
87GDBM_INCLUDES = -I$(COMMON_PACKAGES_DIR)/gdbm/include
88GDBM_LIBS = $(COMMON_PACKAGES_DIR)/gdbm/lib/libgdbm.a
89else
90GDBM_DEFINES =
91GDBM_INCLUDES =
92GDBM_LIBS =
93endif
94
95USE_JDBM = @USE_JDBM@
96ifeq ($(USE_JDBM), 1)
97JDBM_DEFINES = -DUSE_JDBM
98else
99JDBM_DEFINES =
100endif
101
102USE_SQLITE = @USE_SQLITE@
103ifeq ($(USE_SQLITE), 1)
104SQLITE_DEFINES = -DUSE_SQLITE
105SQLITE_LIBS = $(COMMON_PACKAGES_DIR)/sqlite/lib/libsqlite3.a -ldl -lpthread
106SQL_SOURCES = sqlqueryaction.cpp
107SQL_OBJECTS = sqlqueryaction.o
108else
109SQLITE_DEFINES =
110SQLITE_LIBS =
111SQL_SOURCES =
112SQL_OBJECTS =
113endif
114
115USE_RSS = @USE_RSS@
116ifeq ($(USE_RSS), 1)
117RSS_DEFINES = -DUSE_RSS
118RSS_SOURCES = rssaction.cpp
119RSS_OBJECTS = rssaction.o
120else
121RSS_DEFINES =
122RSS_SOURCES =
123RSS_OBJECTS =
124endif
125
126
127USE_Z3950 = @USE_Z3950@
128ifeq ($(USE_Z3950), 1)
129Z3950_DEFS = -DUSE_Z3950
130Z3950_INCLUDES = -I$(Z3950_DIR)
131Z3950_LIBS = $(Z3950_DIR)/gsdlz3950.a $(RUNTIME_PACKAGES_DIR)/yaz/lib/libyaz.a
132else
133Z3950_DEFS =
134Z3950_INCLUDES =
135Z3950_LIBS =
136endif
137
138USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
139#ifeq ($(USE_APACHE_HTTPD), 1)
140ifeq ($(USE_APACHE_HTTPD), "IGNORE_FOR_NOW")
141APACHE_OBJS = string_pool.o mod_gsdl.o
142
143APACHE_INSTDIR=$(GSDL_DIR)/apache-httpd/$(GSDLOS)
144APACHE_SRCLIBDIR=../../packages/apache-httpd/httpd-2.2.11/srclib
145
146APXS_CFLAGS=-I$(APACHE_INSTDIR)/include \
147  -I$(APACHE_SRCLIBDIR)/apr/include -I$(APACHE_SRCLIBDIR)/apr-util/include
148
149APXS_LDFLAGS= -L$(APACHE_INSTDIR)/lib \
150  -L$(APACHE_SRCLIBDIR)/apr/include -L$(APACHE_SRCLIBDIR)/apr-util/include
151
152APACHE_MODULE = mod_gsdl.so
153else
154APACHE_OBJS =
155APACHE_MODULE =
156endif
157
158# Extension support
159EXT_DEFINES =
160EXT_INCLUDES =
161EXT_LDFLAGS =
162EXT_LIBS =
163
164
165
166AR = ar
167CC = @CC@
168CFLAGS=@CFLAGS@ @ARCH_DEP_FLAGS@
169CXX = @CXX@
170CXXFLAGS = @CXXFLAGS@ @ARCH_DEP_FLAGS@
171DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS) $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(Z3950_DEFS) $(EXT_DEFINES)
172INCLUDES = -I. -I$(GSDL_DIR) -I$(COMMON_DIR)/src/lib \
173        -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
174    $(MG_INCLUDES) $(MGPP_INCLUDES) \
175        -I$(COMMON_PACKAGES_DIR)/expat/include $(FASTCGI_INCLUDES) $(GDBM_INCLUDES) $(Z3950_INCLUDES) $(EXT_INCLUDES)
176INSTALL = @INSTALL@
177LDFLAGS = @LDFLAGS@ @ARCH_DEP_FLAGS@ $(EXT_LDFLAGS)
178LIBS = @LIBS@ $(GDBM_LIBS) \
179    $(COMMON_PACKAGES_DIR)/expat/lib/libexpat.a \
180    $(ACCENTFOLD_LIBS) $(FASTCGI_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS) $(EXT_LIBS)
181RANLIB = @RANLIB@
182
183
184CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
185CXXLINK = $(CXX) $(LDFLAGS) -o $@
186
187
188SOURCES = \
189    action.cpp \
190    argdb.cpp \
191    authenaction.cpp \
192    browseaction.cpp \
193    browseactiontools.cpp \
194    browserclass.cpp \
195    browsetoolsclass.cpp \
196    cgiargs.cpp \
197    cgiutils.cpp \
198    cgiwrapper.cpp \
199    collectoraction.cpp \
200    configaction.cpp \
201        converter.cpp \
202    datelistbrowserclass.cpp \
203    depositoraction.cpp \
204    documentaction.cpp \
205    dynamicclassifieraction.cpp \
206    extlinkaction.cpp \
207    formattools.cpp \
208    formatconverter.cpp \
209    gtiaction.cpp \
210    highlighttext.cpp \
211    historydb.cpp \
212    hlistbrowserclass.cpp \
213    htmlbrowserclass.cpp \
214    htmlutils.cpp \
215    invbrowserclass.cpp \
216    librarymain.cpp \
217    maincfg.cpp \
218    pageaction.cpp \
219    pagedbrowserclass.cpp \
220    $(MGPP_SOURCES) \
221    phindbrowserclass.cpp \
222    pingaction.cpp \
223    ispersistentaction.cpp \
224    basequeryaction.cpp \
225    queryaction.cpp \
226    $(SQL_SOURCES) \
227    querytools.cpp \
228    receptionist.cpp \
229    $(RSS_SOURCES) \
230    statusaction.cpp \
231    summarise.cpp \
232    tipaction.cpp \
233    userdb.cpp \
234    usersaction.cpp \
235    vlistbrowserclass.cpp \
236    wizardaction.cpp
237
238OBJECTS = \
239    action.o \
240    argdb.o \
241    authenaction.o \
242    browseaction.o \
243    browseactiontools.o \
244    browserclass.o \
245    browsetoolsclass.o \
246    cgiargs.o \
247    cgiutils.o \
248    cgiwrapper.o \
249    collectoraction.o \
250    configaction.o \
251        converter.o \
252    datelistbrowserclass.o \
253    depositoraction.o \
254    documentaction.o \
255    dynamicclassifieraction.o \
256    extlinkaction.o \
257    formattools.o \
258    gtiaction.o \
259    highlighttext.o \
260    historydb.o \
261    hlistbrowserclass.o \
262    htmlbrowserclass.o \
263    htmlutils.o \
264    invbrowserclass.o \
265    librarymain.o \
266    maincfg.o \
267    pageaction.o \
268    pagedbrowserclass.o \
269    $(MGPP_OBJECTS) \
270    phindbrowserclass.o \
271    pingaction.o \
272    ispersistentaction.o \
273    basequeryaction.o \
274    queryaction.o \
275    $(SQL_OBJECTS) \
276    querytools.o \
277    receptionist.o \
278    $(RSS_OBJECTS) \
279    statusaction.o \
280    summarise.o \
281    tipaction.o \
282    userdb.o \
283    usersaction.o \
284    vlistbrowserclass.o \
285    wizardaction.o
286
287CONVERTER_OBJECTS = \
288    cgiargs.o \
289    cgiutils.o \
290    formattools.o \
291    formatconverter.o \
292    summarise.o
293
294LIBRARY = gsdlrecpt.a
295
296GSDL_LIBS = \
297    $(PROTOCOL_DIR)/gsdlprotocol.a \
298    $(COLSERVR_DIR)/gsdlcolservr.a \
299    $(MG_INDEXERS_LIBS) \
300    $(MGPP_INDEXERS_LIBS) \
301    $(COMMON_DIR)/src/lib/gsdllib.a
302
303EXECUTABLE_OBJECTS = \
304    $(OBJECTS) \
305    $(GSDL_LIBS)
306
307EXECUTABLE = library.cgi
308
309
310# Default target: make both gsdlrecpt.a and the library executable
311all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE) formatconverter
312
313formatconverter: $(CONVERTER_OBJECTS)
314    $(CXXLINK) $(CONVERTER_OBJECTS) $(COMMON_DIR)/src/lib/gsdllib.a $(PROTOCOL_DIR)/gsdlprotocol.a $(COLSERVR_DIR)/gsdlcolservr.a
315
316gsdlrecpt.a: $(OBJECTS)
317    rm -f $(LIBRARY)
318    $(AR) cru $(LIBRARY) $(OBJECTS)
319    $(RANLIB) $(LIBRARY)
320
321$(EXECUTABLE): $(EXECUTABLE_OBJECTS) $(GSDL_LIBS)
322    $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
323
324mod_gsdl.o: mod_gsdl.cpp
325    $(CXX) -c  $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 -fPIC $(APXS_CFLAGS) -Wall -o $@ $<
326
327mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
328    $(CXX) -fPIC -shared -o $@ $(APACHE_OBJS) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
329
330
331.SUFFIXES:
332.SUFFIXES: .cpp .o
333.cpp.o:
334    $(CXXCOMPILE) $<
335
336
337install: $(EXECUTABLE)
338    $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/cgi-bin/$(GSDLOS)$(GSDLARCH)
339#ifeq ($(USE_APACHE_HTTPD), 1)
340ifeq ($(USE_APACHE_HTTPD), "IGNORE_FOR_NOW")
341    $(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs  -i -n gsdl mod_gsdl.so
342endif
343
344clean:
345    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE) $(APACHE_OBJS)
346
347distclean:
348    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) Makefile
349
350depend:
351    makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
Note: See TracBrowser for help on using the browser.