root/main/trunk/greenstone2/runtime-src/src/recpt/win32.mak @ 28909

Revision 28909, 10.1 KB (checked in by ak19, 7 years ago)

Updating the windows makefile to add in securitytools.cpp in the list of source and object files to be compiled and linked.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1###########################################################################
2#
3# win32 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-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
31INDEXERS_DIR = $(COMMON_DIR)\indexers
32COMMON_PACKAGES_DIR = $(COMMON_DIR)\packages
33PACKAGES_DIR = $(RUNTIME_DIR)\packages
34COLSERVR_DIR = $(RUNTIME_DIR)\src\colservr
35PROTOCOL_DIR = $(RUNTIME_DIR)\src\protocol
36Z3950_DIR    = $(RUNTIME_DIR)\src\z3950
37
38
39GSDL_VC4 = 0
40LOCAL_LIBRARY = 0
41USE_Z3950 = 0
42USE_GSDL_MOD = 0
43DEBUG = 0
44DLL = 0
45DLLDEBUG = 0
46ENABLE_ACCENTFOLD = 1
47USE_RSS = 1
48USE_GDBM = 1
49USE_JDBM = 1
50USE_SQLITE = 1
51USE_MSSQL = 0
52ENABLE_MG = 1
53ENABLE_MGPP = 1
54ENABLE_LUCENE = 1
55
56!IF $(DEBUG)
57CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
58LDFLAGS = -DEBUG -Z7 /errorReport:prompt
59!ELSE
60CXXFLAGS =
61LDFLAGS =
62!ENDIF
63
64!IF $(GSDL_VC4)
65CXXFLAGS = $(CXXFLAGS) -GX
66!ELSE
67CXXFLAGS = $(CXXFLAGS) -EHsc
68!ENDIF
69
70!IF $(DLL)
71CXXFLAGS = $(CXXFLAGS) -MD
72!ELSE
73!IF ($(DLLDEBUG))
74CXXFLAGS = $(CXXFLAGS) -MDd
75!ENDIF
76!ENDIF
77
78!IF $(ENABLE_ACCENTFOLD)
79ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\windows\iconv\iconv\lib\iconv.lib"
80!ELSE
81ACCENTFOLD_LIBS =
82!ENDIF
83
84!IF $(USE_RSS)
85RSS_DEFINES = -DUSE_RSS
86RSS_SOURCES = rssaction.cpp
87RSS_OBJECTS = rssaction.obj
88!ELSE
89RSS_DEFINES =
90RSS_SOURCES =
91RSS_OBJECTS =
92!ENDIF
93
94!IF $(USE_GDBM)
95GDBM_DEFINES = -DUSE_GDBM
96GDBM_LIBS = "$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\gdbm.lib"
97GDBM_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows"
98!ELSE
99GDBM_DEFINES =
100GDBM_LIBS =
101GDBM_INCLUDES =
102!ENDIF
103
104!IF $(USE_JDBM)
105JDBM_DEFINES = -DUSE_JDBM
106!ELSE
107JDBM_DEFINES =
108!ENDIF
109
110!IF $(USE_SQLITE)
111SQLITE_DEFINES = -DUSE_SQLITE
112SQL_SOURCES = sqlqueryaction.cpp
113SQL_OBJECTS = sqlqueryaction.obj
114SQLITE_LIBS = "$(COMMON_PACKAGES_DIR)\sqlite\lib\sqlite3.lib"
115!ELSE
116SQLITE_DEFINES =
117SQL_SOURCES =
118SQL_OBJECTS =
119SQLITE_LIBS =
120!ENDIF
121
122!IF $(USE_MSSQL)
123MSSQL_DEFINES = -DUSE_MSSQL
124!ELSE
125MSSQL_DEFINES =
126!ENDIF
127
128!IF $(USE_Z3950)
129Z3950_DEFS = -DUSE_Z3950
130Z3950_INCLUDES = -I$(Z3950_DIR)
131Z3950_LIBS = $(Z3950_DIR)\gsdlz3950.lib $(PACKAGES_DIR)\yaz\yaz-2.1.4\lib\yaz.lib
132!ELSE
133Z3950_DEFS =
134Z3950_INCLUDES =
135Z3950_LIBS =
136!ENDIF
137
138!IF $(USE_GSDL_MOD)
139APACHE_OBJS = string_pool.obj mod_gsdl.obj
140
141APACHE_INSTDIR=$(GSDL_DIR)\apache-httpd\windows
142APACHE_SRCLIBDIR=..\..\packages\apache-httpd\httpd-2.2.11\srclib
143
144APXS_CFLAGS=-I$(APACHE_INSTDIR)\include \
145  -I$(APACHE_SRCLIBDIR)\apr\include -I$(APACHE_SRCLIBDIR)\apr-util\include
146
147APXS_LINKFLAGS= /libpath:$(APACHE_INSTDIR)\lib \
148  /libpath:$(APACHE_SRCLIBDIR)\apr\include \
149  /libpath:$(APACHE_SRCLIBDIR)\apr-util\include
150
151APXS_LDFLAGS= -L$(APACHE_INSTDIR)\lib \
152  -L$(APACHE_SRCLIBDIR)\apr\include \
153  -L$(APACHE_SRCLIBDIR)\apr-util\include
154
155APXS_LIBS = libaprutil-1.lib libapr-1.lib libhttpd.lib
156
157APACHE_MODULE = mod_gsdl.so
158!ELSE
159APACHE_OBJS =
160APACHE_MODULE =
161!ENDIF
162
163
164!IF $(ENABLE_MG)
165MG_DEFS = -DENABLE_MG
166MG_LIBS = "$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
167    "$(INDEXERS_DIR)\mg\lib\libmglib.lib"
168MG_INCLUDES = -I"$(INDEXERS_DIR)\mg" -I"$(INDEXERS_DIR)\mg\lib"
169!ELSE
170MG_DEFS =
171MG_LIBS =
172MG_INCLUDES =
173!ENDIF
174
175!IF $(ENABLE_MGPP)
176MGPP_DEFS = -DENABLE_MGPP
177MGPP_SOURCES = phindaction.cpp
178MGPP_OBJECTS = phindaction.obj
179MGPP_LIBS = "$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
180    "$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
181MGPP_INCLUDES = -I"$(INDEXERS_DIR)\mgpp\text" \
182    -I"$(INDEXERS_DIR)\mgpp\lib"
183!ELSE
184MGPP_DEFS =
185MGPP_SOURCES =
186MGPP_OBJECTS =
187MGPP_LIBS =
188MGPP_INCLUDES =
189!ENDIF
190
191!IF $(ENABLE_LUCENE)
192LUCENE_DEFS = -DENABLE_LUCENE
193!ELSE
194LUCENE_DEFS=
195!ENDIF
196
197AR = lib
198CC = cl
199DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
200    -DGSDL_NOCACHE $(RSS_DEFINES) $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
201    $(Z3950_DEFS) $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
202INCLUDES = -I. -I"$(GSDL_DIR)" -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" \
203    $(MG_INCLUDES) $(MGPP_INCLUDES) \
204    -I"$(COMMON_PACKAGES_DIR)\windows\crypt\crypt" -I"$(COMMON_PACKAGES_DIR)\expat\include" \
205    $(GDBM_INCLUDES) \
206    $(Z3950_INCLUDES)
207LIBS = "$(COMMON_PACKAGES_DIR)\windows\crypt\crypt\crypt.lib" "$(COMMON_PACKAGES_DIR)\expat\lib\libexpat.lib" \
208       $(GDBM_LIBS) $(ACCENTFOLD_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS)
209
210!IF $(GSDL_VC4)
211DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
212INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
213!ENDIF
214!IF $(LOCAL_LIBRARY)
215DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
216!ENDIF
217
218CXXFLAGS = $(CXXFLAGS)
219
220COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
221LINK = $(CC) -nologo $(LDFLAGS) -Fe"$@"
222
223
224.SUFFIXES:
225.SUFFIXES: .cpp .obj
226.cpp.obj:
227    $(COMPILE) $<
228
229OSPROCESS_SOURCES = \
230    os_process.cpp \
231    os_process_windows.cpp \
232
233OSPROCESS_OBJECTS = \
234    os_process.obj \
235    os_process_windows.obj \
236
237
238SOURCES = \
239    action.cpp \
240    argdb.cpp \
241    authenaction.cpp \
242    basequeryaction.cpp \
243    browseaction.cpp \
244    browseactiontools.cpp \
245    browserclass.cpp \
246    browsetoolsclass.cpp \
247    cgiargs.cpp \
248    cgiutils.cpp \
249    cgiwrapper.cpp \
250    collectoraction.cpp \
251    configaction.cpp \
252        converter.cpp \
253    datelistbrowserclass.cpp \
254    depositoraction.cpp \
255    documentaction.cpp \
256    dynamicclassifieraction.cpp \
257    extlinkaction.cpp \
258    formattools.cpp \
259    gtiaction.cpp \
260    highlighttext.cpp \
261    historydb.cpp \
262    hlistbrowserclass.cpp \
263    htmlbrowserclass.cpp \
264    htmlutils.cpp \
265    invbrowserclass.cpp \
266    librarymain.cpp \
267    maincfg.cpp \
268    $(OSPROCESS_SOURCES) \
269    pageaction.cpp \
270    pagedbrowserclass.cpp \
271    $(MGPP_SOURCES) \
272    phindbrowserclass.cpp \
273    pingaction.cpp \
274    ispersistentaction.cpp \
275    queryaction.cpp \
276    querytools.cpp \
277    receptionist.cpp \
278    $(RSS_SOURCES) \
279    statusaction.cpp \
280    $(SQL_SOURCES) \
281    securitytools.cpp \
282    summarise.cpp \
283    tipaction.cpp \
284    userdb.cpp \
285    usersaction.cpp \
286    vlistbrowserclass.cpp \
287    wizardaction.cpp
288
289OBJECTS = \
290    action.obj \
291    argdb.obj \
292    authenaction.obj \
293    basequeryaction.obj \
294    browseaction.obj \
295    browseactiontools.obj \
296    browserclass.obj \
297    browsetoolsclass.obj \
298    cgiargs.obj \
299    cgiutils.obj \
300    cgiwrapper.obj \
301    collectoraction.obj \
302    configaction.obj \
303        converter.obj \
304    datelistbrowserclass.obj \
305    depositoraction.obj \
306    documentaction.obj \
307    dynamicclassifieraction.obj \
308    extlinkaction.obj \
309    formattools.obj \
310    gtiaction.obj \
311    highlighttext.obj \
312    historydb.obj \
313    hlistbrowserclass.obj \
314    htmlbrowserclass.obj \
315    htmlutils.obj \
316    invbrowserclass.obj \
317    librarymain.obj \
318    maincfg.obj \
319    $(OSPROCESS_OBJECTS) \
320    pageaction.obj \
321    pagedbrowserclass.obj \
322    $(MGPP_OBJECTS) \
323    phindbrowserclass.obj \
324    pingaction.obj \
325    ispersistentaction.obj \
326    queryaction.obj \
327    querytools.obj \
328    receptionist.obj \
329    $(RSS_OBJECTS) \
330    statusaction.obj \
331    $(SQL_OBJECTS) \
332    securitytools.obj \
333    summarise.obj \
334    tipaction.obj \
335    userdb.obj \
336    usersaction.obj \
337    vlistbrowserclass.obj \
338    wizardaction.obj
339
340LIBRARY = gsdlrecpt.lib
341
342GSDL_LIBS = \
343    "$(PROTOCOL_DIR)\gsdlprotocol.lib" \
344    "$(COLSERVR_DIR)\gsdlcolservr.lib" \
345    $(MG_LIBS) \
346    $(MGPP_LIBS) \
347    "$(COMMON_DIR)\src\lib\gsdllib.lib"
348
349EXECUTABLE_OBJECTS = \
350    $(OBJECTS) \
351    $(GSDL_LIBS)
352
353EXECUTABLE = library.cgi
354
355
356# Default target: make gsdlrecpt.lib if LOCAL_LIBRARY is set, otherwise both gsdlrecpt.lib and library.exe
357!IF $(LOCAL_LIBRARY)
358all: $(LIBRARY) $(APACHE_MODULE)
359!ELSE
360all: $(LIBRARY) $(EXECUTABLE) $(APACHE_MODULE)
361!ENDIF
362
363gsdlrecpt.lib: $(OBJECTS)
364    if EXIST $(LIBRARY) del $(LIBRARY)
365    $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
366
367library.cgi: $(EXECUTABLE_OBJECTS)
368    $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
369
370
371mod_gsdl.obj: mod_gsdl.cpp
372    $(CC) -nologo /MD /W3 /D WIN32 /D _WINDOWS /D NDEBUG -c  $(CXXFLAGS) $(DEFS) $(INCLUDES) -D_APACHE_MOD=2 $(APXS_CFLAGS) mod_gsdl.cpp
373##  cl.exe /nologo /MT /W3 /O2 /D WIN32 /D _WINDOWS /D NDEBUG -I"C:\Program Files\xampp\apache\include" -c mod_gsdl.c
374
375mod_gsdl.so: $(APACHE_OBJS) $(LIBRARY)
376    $(CC) /nologo -Fe"mod_gsdl.dll"  $(APACHE_OBJS) gsdlrecpt.lib $(GSDL_LIBS) $(LIBS) $(APXS_LDFLAGS) $(APXS_LIBS)
377
378#   link /nologo /dll  $(APACHE_OBJS) gsdlrecpt.lib $(GSDL_LIBS) $(LIBS) $(APXS_LDFLAGS) $(APXS_LIBS)
379    rename mod_gsdl.dll mod_gsdl.so
380
381##  $(CC) -nologo /dll -Fe"$@" $(APACHE_OBJS) $(LIBRARY) $(GSDL_LIBS) $(LIBS)
382
383
384## link.exe  kernel32.lib /nologo /subsystem:windows /dll /machine:I386 /libpath:"C:\Program Files\xampp\apache\lib" libaprutil-1.lib libapr-1.lib libhttpd.lib mod_gsdl.obj
385
386##  rename mod_gsdl.dll mod_gsdl.so
387
388
389# COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
390# LINK = $(CC) -nologo -Fe"$@" $(LDFLAGS)
391
392
393
394
395
396
397osprocess-test.cgi: $(OSPROCESS_OBJECTS) os_process_test.obj
398    $(LINK) $(OSPROCESS_OBJECTS) os_process_test.obj ..\..\..\common-src\src\lib\gsdllib.lib
399
400!IF $(LOCAL_LIBRARY)
401install:
402!ELSE
403install: $(EXECUTABLE)
404!IF "$(PROCESSOR_ARCHITECTURE)"==""
405    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows"
406!ELSE IF EXIST ("$(GSDL_DIR)\bin\windows")
407    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows"   
408!ELSE IF "$(PROCESSOR_ARCHITECTURE)"=="x86"
409    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows32"
410!ELSE
411    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin\windows64"
412!ENDIF
413!ENDIF
414
415clean:
416    del *.obj
417    del $(LIBRARY)
418    del $(EXECUTABLE)
419
420
421# Always recompile configaction and statusaction in case GSDL_LOCAL_LIBRARY has changed
422statusaction.obj: FORCE
423configaction.obj: FORCE
424
425FORCE:
Note: See TracBrowser for help on using the browser.