root/gsdl/trunk/runtime-src/src/recpt/Makefile.in @ 19259

Revision 19259, 6.6 KB (checked in by davidb, 11 years ago)

Revap of Greenstone as a module for Apache. Initial version coded by DL Consulting

  • 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@
32
33INDEXERS_DIR = $(COMMON_DIR)/indexers
34COMMON_PACKAGES_DIR = $(COMMON_DIR)/packages
35RUNTIME_PACKAGES_DIR = $(RUNTIME_DIR)/packages
36COLSERVR_DIR = $(RUNTIME_DIR)/src/colservr
37PROTOCOL_DIR = $(RUNTIME_DIR)/src/protocol
38Z3950_DIR = $(RUNTIME_DIR)/src/z3950
39
40
41ENABLE_ACCENTFOLD = @ENABLE_ACCENTFOLD@
42ifeq ($(ENABLE_ACCENTFOLD), 1)
43ACCENTFOLD_LIBS = $(INDEXERS_DIR)/packages/unac/libunac.a
44else
45ACCENTFOLD_LIBS =
46endif
47
48USE_FASTCGI = @USE_FASTCGI@
49ifeq ($(USE_FASTCGI), 1)
50FASTCGI_DEFS = -DUSE_FASTCGI
51FASTCGI_INCLUDES = -I$(RUNTIME_PACKAGES_DIR)/fcgi/include
52FASTCGI_LIBS = $(RUNTIME_PACKAGES_DIR)/fcgi/libfcgi/libfcgi.a
53else
54FASTCGI_DEFS =
55FASTCGI_INCLUDES =
56FASTCGI_LIBS =
57endif
58
59USE_SQLITE = @USE_SQLITE@
60ifeq ($(USE_SQLITE), 1)
61SQLITE_LIBS = $(COMMON_PACKAGES_DIR)/sqlite/lib/libsqlite3.a -ldl -lpthread
62else
63SQLITE_LIBS =
64endif
65
66USE_Z3950 = @USE_Z3950@
67ifeq ($(USE_Z3950), 1)
68Z3950_DEFS = -DUSE_Z3950
69Z3950_INCLUDES = -I$(Z3950_DIR)
70Z3950_LIBS = $(Z3950_DIR)/gsdlz3950.a $(RUNTIME_PACKAGES_DIR)/yaz/lib/libyaz.a
71else
72Z3950_DEFS =
73Z3950_INCLUDES =
74Z3950_LIBS =
75endif
76
77USE_APACHE_HTTPD=@USE_APACHE_HTTPD@
78ifeq ($(USE_APACHE_HTTPD), 1)
79APACHE_OBJS = string_pool.o mod_gsdl.o
80
81APXS=$(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs
82APXS_CFLAGS=`$(APXS) -q CFLAGS`   
83APXS_CFLAGS_SHLIB=`$(APXS) -q CFLAGS_SHLIB`   
84APXS_INCLUDEDIR=`$(APXS) -q INCLUDEDIR`   
85APXS_LIBEXECDIR=`$(APXS) -q LIBEXECDIR`
86APXS_LDFLAGS_SHLIB=`$(APXS) -q LDFLAGS_SHLIB`
87APXS_SYSCONFDIR=`$(APXS) -q SYSCONFDIR`
88APXS_LIBS_SHLIB=`$(APXS) -q LIBS_SHLIB`
89APACHE_MODULE = mod_gsdl.so
90else
91APACHE_OBJS =
92APACHE_MODULE = mod_gsdl.so
93endif
94
95
96AR = ar
97CC = @CC@
98CFLAGS=@CFLAGS@ @COMPAT32BITFLAGS@
99CXX = @CXX@
100CXXFLAGS = @CXXFLAGS@ @COMPAT32BITFLAGS@
101DEFS = @DEFS@ -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DHAVE_CONFIG_H $(FASTCGI_DEFS) $(Z3950_DEFS)
102INCLUDES = -I. -I$(GSDL_DIR) -I$(COMMON_DIR)/src/lib -I$(COMMON_PACKAGES_DIR)/gdbm/include \
103        -I$(COLSERVR_DIR) -I$(PROTOCOL_DIR) \
104    -I$(INDEXERS_DIR)/mg -I$(INDEXERS_DIR)/mg/lib -I$(INDEXERS_DIR)/mgpp/text \
105        -I$(COMMON_PACKAGES_DIR)/expat/include $(FASTCGI_INCLUDES) $(Z3950_INCLUDES)
106INSTALL = @INSTALL@
107LDFLAGS = @LDFLAGS@ @COMPAT32BITFLAGS@
108LIBS = @LIBS@ $(COMMON_PACKAGES_DIR)/gdbm/lib/libgdbm.a -L$(COMMON_PACKAGES_DIR)/expat/lib -lexpat \
109    $(ACCENTFOLD_LIBS) $(FASTCGI_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS)
110RANLIB = @RANLIB@
111
112
113CXXCOMPILE = $(CXX) -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
114CXXLINK = $(CXX) $(LDFLAGS) -o $@
115
116
117SOURCES = \
118    action.cpp \
119    argdb.cpp \
120    authenaction.cpp \
121    browseaction.cpp \
122    browseactiontools.cpp \
123    browserclass.cpp \
124    browsetoolsclass.cpp \
125    cgiargs.cpp \
126    cgiutils.cpp \
127    cgiwrapper.cpp \
128    collectoraction.cpp \
129    configaction.cpp \
130        converter.cpp \
131    datelistbrowserclass.cpp \
132    depositoraction.cpp \
133    documentaction.cpp \
134    dynamicclassifieraction.cpp \
135    extlinkaction.cpp \
136    formattools.cpp \
137    gtiaction.cpp \
138    highlighttext.cpp \
139    historydb.cpp \
140    hlistbrowserclass.cpp \
141    htmlbrowserclass.cpp \
142    htmlutils.cpp \
143    invbrowserclass.cpp \
144    librarymain.cpp \
145    maincfg.cpp \
146    pageaction.cpp \
147    pagedbrowserclass.cpp \
148    phindaction.cpp \
149    phindbrowserclass.cpp \
150    pingaction.cpp \
151    queryaction.cpp \
152    querytools.cpp \
153    receptionist.cpp \
154    statusaction.cpp \
155    summarise.cpp \
156    tipaction.cpp \
157    userdb.cpp \
158    usersaction.cpp \
159    vlistbrowserclass.cpp \
160    wizardaction.cpp
161
162OBJECTS = \
163    action.o \
164    argdb.o \
165    authenaction.o \
166    browseaction.o \
167    browseactiontools.o \
168    browserclass.o \
169    browsetoolsclass.o \
170    cgiargs.o \
171    cgiutils.o \
172    cgiwrapper.o \
173    collectoraction.o \
174    configaction.o \
175        converter.o \
176    datelistbrowserclass.o \
177    depositoraction.o \
178    documentaction.o \
179    dynamicclassifieraction.o \
180    extlinkaction.o \
181    formattools.o \
182    gtiaction.o \
183    highlighttext.o \
184    historydb.o \
185    hlistbrowserclass.o \
186    htmlbrowserclass.o \
187    htmlutils.o \
188    invbrowserclass.o \
189    librarymain.o \
190    maincfg.o \
191    pageaction.o \
192    pagedbrowserclass.o \
193    phindaction.o \
194    phindbrowserclass.o \
195    pingaction.o \
196    queryaction.o \
197    querytools.o \
198    receptionist.o \
199    statusaction.o \
200    summarise.o \
201    tipaction.o \
202    userdb.o \
203    usersaction.o \
204    vlistbrowserclass.o \
205    wizardaction.o
206
207LIBRARY = gsdlrecpt.a
208
209GSDL_LIBS = \
210    $(PROTOCOL_DIR)/gsdlprotocol.a \
211    $(COLSERVR_DIR)/gsdlcolservr.a \
212    $(INDEXERS_DIR)/mg/src/text/libmgtext.a \
213    $(INDEXERS_DIR)/mg/lib/libmglib.a \
214    $(INDEXERS_DIR)/mgpp/text/libmgpptext.a \
215    $(INDEXERS_DIR)/mgpp/lib/libmgpplib.a \
216    $(COMMON_DIR)/src/lib/gsdllib.a
217
218EXECUTABLE_OBJECTS = \
219    $(OBJECTS) \
220    $(GSDL_LIBS)
221
222EXECUTABLE = library.cgi
223
224
225# Default target: make both gsdlrecpt.a and the library executable
226all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE)
227
228gsdlrecpt.a: $(OBJECTS)
229    rm -f $(LIBRARY)
230    $(AR) cru $(LIBRARY) $(OBJECTS)
231    $(RANLIB) $(LIBRARY)
232
233$(EXECUTABLE): $(EXECUTABLE_OBJECTS) $(GSDL_LIBS)
234    $(CXXLINK) $(EXECUTABLE_OBJECTS) $(LIBS)
235
236mod_gsdl.o: mod_gsdl.cpp
237    $(CXX) -c  $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 -fPIC -I$(APXS_INCLUDEDIR) -I. -iquote $(APXS_CFLAGS) $(APXS_CFLAGS_SHLIB) -Wall -o $@ $<
238
239mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
240    $(CXX) -fPIC -shared -o $@ $(APACHE_OBJS) $(APXS_LIBS_SHLIB) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
241
242
243.SUFFIXES:
244.SUFFIXES: .cpp .o
245.cpp.o:
246    $(CXXCOMPILE) $<
247
248
249install: $(EXECUTABLE)
250    $(INSTALL) -m 755 -s $(EXECUTABLE) $(GSDL_DIR)/cgi-bin
251    $(GSDL_DIR)/apache-httpd/$(GSDLOS)/bin/apxs  -i -n gsdl mod_gsdl.so
252
253clean:
254    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE) $(APACHE_OBJS)
255
256distclean:
257    rm -f $(OBJECTS) $(LIBRARY) $(EXECUTABLE) Makefile
258
259depend:
260    makedepend -Y -- $(DEFS) $(INCLUDES) $(CXXFLAGS) -- $(SOURCES)
Note: See TracBrowser for help on using the browser.