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

Revision 22078, 7.4 KB (checked in by ak19, 10 years ago)

1. Missing conditional LIBS or INCLUDES or DIR declaration for when USE_GDBM is switched on. Previously it used to always put these in the includes/libs, not it only does so on USE_GDBM.

  • 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
42DEBUG = 0
43DLL = 0
44DLLDEBUG = 0
45ENABLE_ACCENTFOLD = 1
46USE_GDBM = 1
47USE_JDBM = 1
48USE_SQLITE = 1
49USE_MSSQL = 0
50ENABLE_MG = 1
51ENABLE_MGPP = 1
52ENABLE_LUCENE = 1
53
54!IF $(DEBUG)
55CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
56!ELSE
57CXXFLAGS =
58!ENDIF
59
60!IF $(GSDL_VC4)
61CXXFLAGS = $(CXXFLAGS) -GX
62!ELSE
63CXXFLAGS = $(CXXFLAGS) -EHsc
64!ENDIF
65
66!IF $(DLL)
67CXXFLAGS = $(CXXFLAGS) -MD
68!ELSE
69!IF ($(DLLDEBUG))
70CXXFLAGS = $(CXXFLAGS) -MDd
71!ENDIF
72!ENDIF
73
74!IF $(ENABLE_ACCENTFOLD)
75ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\windows\iconv\iconv\lib\iconv.lib"
76!ELSE
77ACCENTFOLD_LIBS =
78!ENDIF
79
80!IF $(USE_GDBM)
81GDBM_DEFINES = -DUSE_GDBM
82GDBM_LIBS = "$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\gdbm.lib"
83GDBM_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows"
84!ELSE
85GDBM_DEFINES =
86GDBM_LIBS =
87GDBM_INCLUDES =
88!ENDIF
89
90!IF $(USE_JDBM)
91JDBM_DEFINES = -DUSE_JDBM
92!ELSE
93JDBM_DEFINES =
94!ENDIF
95
96!IF $(USE_SQLITE)
97SQLITE_DEFINES = -DUSE_SQLITE
98SQL_SOURCES = sqlqueryaction.cpp
99SQL_OBJECTS = sqlqueryaction.obj
100SQLITE_LIBS = "$(COMMON_PACKAGES_DIR)\sqlite\lib\sqlite3.lib"
101!ELSE
102SQLITE_DEFINES =
103SQL_SOURCES =
104SQL_OBJECTS =
105SQLITE_LIBS =
106!ENDIF
107
108!IF $(USE_MSSQL)
109MSSQL_DEFINES = -DUSE_MSSQL
110!ELSE
111MSSQL_DEFINES =
112!ENDIF
113
114!IF $(USE_Z3950)
115Z3950_DEFS = -DUSE_Z3950
116Z3950_INCLUDES = -I$(Z3950_DIR)
117Z3950_LIBS = $(Z3950_DIR)\gsdlz3950.lib $(PACKAGES_DIR)\yaz\yaz-2.1.4\lib\yaz.lib
118!ELSE
119Z3950_DEFS =
120Z3950_INCLUDES =
121Z3950_LIBS =
122!ENDIF
123
124!IF $(ENABLE_MG)
125MG_DEFS = -DENABLE_MG
126MG_LIBS = "$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
127    "$(INDEXERS_DIR)\mg\lib\libmglib.lib"
128MG_INCLUDES = -I"$(INDEXERS_DIR)\mg" -I"$(INDEXERS_DIR)\mg\lib"
129!ELSE
130MG_DEFS =
131MG_LIBS =
132MG_INCLUDES =
133!ENDIF
134
135!IF $(ENABLE_MGPP)
136MGPP_DEFS = -DENABLE_MGPP
137MGPP_SOURCES = phindaction.cpp
138MGPP_OBJECTS = phindaction.obj
139MGPP_LIBS = "$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
140    "$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
141MGPP_INCLUDES = -I"$(INDEXERS_DIR)\mgpp\text" \
142    -I"$(INDEXERS_DIR)\mgpp\lib"
143!ELSE
144MGPP_DEFS =
145MGPP_SOURCES =
146MGPP_OBJECTS =
147MGPP_LIBS =
148MGPP_INCLUDES =
149!ENDIF
150
151!IF $(ENABLE_LUCENE)
152LUCENE_DEFS = -DENABLE_LUCENE
153!ELSE
154LUCENE_DEFS=
155!ENDIF
156
157AR = lib
158CC = cl
159DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
160        -DGSDL_NOCACHE $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
161    $(Z3950_DEFS) $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
162INCLUDES = -I. -I"$(GSDL_DIR)" -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" \
163    $(MG_INCLUDES) $(MGPP_INCLUDES) \
164    -I"$(COMMON_PACKAGES_DIR)\windows\crypt\crypt" -I"$(COMMON_PACKAGES_DIR)\windows\expat\expat" \
165    $(GDBM_INCLUDES) \
166    $(Z3950_INCLUDES)
167LDFLAGS =
168LIBS = "$(COMMON_PACKAGES_DIR)\windows\crypt\crypt\crypt.lib" "$(COMMON_PACKAGES_DIR)\windows\expat\expat\libexpat.lib" \
169       $(GDBM_LIBS) $(ACCENTFOLD_LIBS) $(SQLITE_LIBS) $(Z3950_LIBS)
170
171!IF $(GSDL_VC4)
172DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
173INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
174!ENDIF
175!IF $(LOCAL_LIBRARY)
176DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
177!ENDIF
178
179
180COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
181LINK = $(CC) -nologo -Fe"$@" $(LDFLAGS)
182
183
184.SUFFIXES:
185.SUFFIXES: .cpp .obj
186.cpp.obj:
187    $(COMPILE) $<
188
189
190SOURCES = \
191    action.cpp \
192    argdb.cpp \
193    authenaction.cpp \
194    basequeryaction.cpp \
195    browseaction.cpp \
196    browseactiontools.cpp \
197    browserclass.cpp \
198    browsetoolsclass.cpp \
199    cgiargs.cpp \
200    cgiutils.cpp \
201    cgiwrapper.cpp \
202    collectoraction.cpp \
203    configaction.cpp \
204        converter.cpp \
205    datelistbrowserclass.cpp \
206    depositoraction.cpp \
207    documentaction.cpp \
208    dynamicclassifieraction.cpp \
209    extlinkaction.cpp \
210    formattools.cpp \
211    gtiaction.cpp \
212    highlighttext.cpp \
213    historydb.cpp \
214    hlistbrowserclass.cpp \
215    htmlbrowserclass.cpp \
216    htmlutils.cpp \
217    invbrowserclass.cpp \
218    librarymain.cpp \
219    maincfg.cpp \
220    pageaction.cpp \
221    pagedbrowserclass.cpp \
222    $(MGPP_SOURCES) \
223    phindbrowserclass.cpp \
224    pingaction.cpp \
225    queryaction.cpp \
226    querytools.cpp \
227    receptionist.cpp \
228    statusaction.cpp \
229    $(SQL_SOURCES) \
230    summarise.cpp \
231    tipaction.cpp \
232    userdb.cpp \
233    usersaction.cpp \
234    vlistbrowserclass.cpp \
235    wizardaction.cpp
236
237OBJECTS = \
238    action.obj \
239    argdb.obj \
240    authenaction.obj \
241    basequeryaction.obj \
242    browseaction.obj \
243    browseactiontools.obj \
244    browserclass.obj \
245    browsetoolsclass.obj \
246    cgiargs.obj \
247    cgiutils.obj \
248    cgiwrapper.obj \
249    collectoraction.obj \
250    configaction.obj \
251        converter.obj \
252    datelistbrowserclass.obj \
253    depositoraction.obj \
254    documentaction.obj \
255    dynamicclassifieraction.obj \
256    extlinkaction.obj \
257    formattools.obj \
258    gtiaction.obj \
259    highlighttext.obj \
260    historydb.obj \
261    hlistbrowserclass.obj \
262    htmlbrowserclass.obj \
263    htmlutils.obj \
264    invbrowserclass.obj \
265    librarymain.obj \
266    maincfg.obj \
267    pageaction.obj \
268    pagedbrowserclass.obj \
269    $(MGPP_OBJECTS) \
270    phindbrowserclass.obj \
271    pingaction.obj \
272    queryaction.obj \
273    querytools.obj \
274    receptionist.obj \
275    statusaction.obj \
276    $(SQL_OBJECTS) \
277    summarise.obj \
278    tipaction.obj \
279    userdb.obj \
280    usersaction.obj \
281    vlistbrowserclass.obj \
282    wizardaction.obj
283
284LIBRARY = gsdlrecpt.lib
285
286GSDL_LIBS = \
287    "$(PROTOCOL_DIR)\gsdlprotocol.lib" \
288    "$(COLSERVR_DIR)\gsdlcolservr.lib" \
289    $(MG_LIBS) \
290    $(MGPP_LIBS) \
291    "$(COMMON_DIR)\src\lib\gsdllib.lib"
292
293EXECUTABLE_OBJECTS = \
294    $(OBJECTS) \
295    $(GSDL_LIBS)
296
297EXECUTABLE = library.cgi
298
299
300# Default target: make gsdlrecpt.lib if LOCAL_LIBRARY is set, otherwise both gsdlrecpt.lib and library.exe
301!IF $(LOCAL_LIBRARY)
302all: $(LIBRARY)
303!ELSE
304all: $(LIBRARY) $(EXECUTABLE)
305!ENDIF
306
307gsdlrecpt.lib: $(OBJECTS)
308    if EXIST $(LIBRARY) del $(LIBRARY)
309    $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
310
311library.cgi: $(EXECUTABLE_OBJECTS)
312    $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
313
314!IF $(LOCAL_LIBRARY)
315install:
316!ELSE
317install: $(EXECUTABLE)
318    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin"
319!ENDIF
320
321clean:
322    del *.obj
323    del $(LIBRARY)
324    del $(EXECUTABLE)
325
326
327# Always recompile configaction and statusaction in case GSDL_LOCAL_LIBRARY has changed
328statusaction.obj: FORCE
329configaction.obj: FORCE
330
331FORCE:
Note: See TracBrowser for help on using the browser.