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

Revision 22766, 7.7 KB (checked in by mdewsnip, 9 years ago)

Instead of having two copies of expat in Greenstone (one for Linux and one for Windows), added Windows makefiles into the version in common-src/packages/expat. This means we can remove the Windows-only version in common-src/packages/windows/expat, and also means that expat now works the same as SQLite.

  • 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)\expat\include" \
165    $(GDBM_INCLUDES) \
166    $(Z3950_INCLUDES)
167LDFLAGS =
168LIBS = "$(COMMON_PACKAGES_DIR)\windows\crypt\crypt\crypt.lib" "$(COMMON_PACKAGES_DIR)\expat\lib\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
189OSPROCESS_SOURCES = \
190    os_process.cpp \
191    os_process_windows.cpp \
192
193OSPROCESS_OBJECTS = \
194    os_process.obj \
195    os_process_windows.obj \
196
197
198SOURCES = \
199    action.cpp \
200    argdb.cpp \
201    authenaction.cpp \
202    basequeryaction.cpp \
203    browseaction.cpp \
204    browseactiontools.cpp \
205    browserclass.cpp \
206    browsetoolsclass.cpp \
207    cgiargs.cpp \
208    cgiutils.cpp \
209    cgiwrapper.cpp \
210    collectoraction.cpp \
211    configaction.cpp \
212        converter.cpp \
213    datelistbrowserclass.cpp \
214    depositoraction.cpp \
215    documentaction.cpp \
216    dynamicclassifieraction.cpp \
217    extlinkaction.cpp \
218    formattools.cpp \
219    gtiaction.cpp \
220    highlighttext.cpp \
221    historydb.cpp \
222    hlistbrowserclass.cpp \
223    htmlbrowserclass.cpp \
224    htmlutils.cpp \
225    invbrowserclass.cpp \
226    librarymain.cpp \
227    maincfg.cpp \
228    $(OSPROCESS_SOURCES) \
229    pageaction.cpp \
230    pagedbrowserclass.cpp \
231    $(MGPP_SOURCES) \
232    phindbrowserclass.cpp \
233    pingaction.cpp \
234    queryaction.cpp \
235    querytools.cpp \
236    receptionist.cpp \
237    statusaction.cpp \
238    $(SQL_SOURCES) \
239    summarise.cpp \
240    tipaction.cpp \
241    userdb.cpp \
242    usersaction.cpp \
243    vlistbrowserclass.cpp \
244    wizardaction.cpp
245
246OBJECTS = \
247    action.obj \
248    argdb.obj \
249    authenaction.obj \
250    basequeryaction.obj \
251    browseaction.obj \
252    browseactiontools.obj \
253    browserclass.obj \
254    browsetoolsclass.obj \
255    cgiargs.obj \
256    cgiutils.obj \
257    cgiwrapper.obj \
258    collectoraction.obj \
259    configaction.obj \
260        converter.obj \
261    datelistbrowserclass.obj \
262    depositoraction.obj \
263    documentaction.obj \
264    dynamicclassifieraction.obj \
265    extlinkaction.obj \
266    formattools.obj \
267    gtiaction.obj \
268    highlighttext.obj \
269    historydb.obj \
270    hlistbrowserclass.obj \
271    htmlbrowserclass.obj \
272    htmlutils.obj \
273    invbrowserclass.obj \
274    librarymain.obj \
275    maincfg.obj \
276    $(OSPROCESS_OBJECTS) \
277    pageaction.obj \
278    pagedbrowserclass.obj \
279    $(MGPP_OBJECTS) \
280    phindbrowserclass.obj \
281    pingaction.obj \
282    queryaction.obj \
283    querytools.obj \
284    receptionist.obj \
285    statusaction.obj \
286    $(SQL_OBJECTS) \
287    summarise.obj \
288    tipaction.obj \
289    userdb.obj \
290    usersaction.obj \
291    vlistbrowserclass.obj \
292    wizardaction.obj
293
294LIBRARY = gsdlrecpt.lib
295
296GSDL_LIBS = \
297    "$(PROTOCOL_DIR)\gsdlprotocol.lib" \
298    "$(COLSERVR_DIR)\gsdlcolservr.lib" \
299    $(MG_LIBS) \
300    $(MGPP_LIBS) \
301    "$(COMMON_DIR)\src\lib\gsdllib.lib"
302
303EXECUTABLE_OBJECTS = \
304    $(OBJECTS) \
305    $(GSDL_LIBS)
306
307EXECUTABLE = library.cgi
308
309
310# Default target: make gsdlrecpt.lib if LOCAL_LIBRARY is set, otherwise both gsdlrecpt.lib and library.exe
311!IF $(LOCAL_LIBRARY)
312all: $(LIBRARY)
313!ELSE
314all: $(LIBRARY) $(EXECUTABLE)
315!ENDIF
316
317gsdlrecpt.lib: $(OBJECTS)
318    if EXIST $(LIBRARY) del $(LIBRARY)
319    $(AR) -nologo /out:$(LIBRARY) $(OBJECTS)
320
321library.cgi: $(EXECUTABLE_OBJECTS)
322    $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
323
324osprocess-test.cgi: $(OSPROCESS_OBJECTS) os_process_test.obj
325    $(LINK) $(OSPROCESS_OBJECTS) os_process_test.obj ..\..\..\common-src\src\lib\gsdllib.lib
326
327!IF $(LOCAL_LIBRARY)
328install:
329!ELSE
330install: $(EXECUTABLE)
331    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin"
332!ENDIF
333
334clean:
335    del *.obj
336    del $(LIBRARY)
337    del $(EXECUTABLE)
338
339
340# Always recompile configaction and statusaction in case GSDL_LOCAL_LIBRARY has changed
341statusaction.obj: FORCE
342configaction.obj: FORCE
343
344FORCE:
Note: See TracBrowser for help on using the browser.