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

Revision 22078, 5.6 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:keywords set to Author Date Id Revision
Line 
1###########################################################################
2#
3# win32 makefile -- src/oaiserver
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
36RECPT_DIR    = $(RUNTIME_DIR)\src\recpt
37
38
39GSDL_VC4 = 0
40DEBUG = 0
41LOCAL_LIBRARY = 0
42DLL = 0
43DLLDEBUG = 0
44ENABLE_ACCENTFOLD = 1
45USE_GDBM = 1
46USE_JDBM = 1
47USE_SQLITE = 1
48USE_MSSQL = 0
49ENABLE_MG = 1
50ENABLE_MGPP = 1
51ENABLE_LUCENE = 1
52
53!IF $(DEBUG)
54CXXFLAGS = -DEBUG -Z7 /errorReport:prompt
55!ELSE
56CXXFLAGS =
57!ENDIF
58
59!IF $(GSDL_VC4)
60CXXFLAGS = $(CXXFLAGS) -GX
61!ELSE
62CXXFLAGS = $(CXXFLAGS) -EHsc
63!ENDIF
64
65!IF $(DLL)
66CXXFLAGS = $(CXXFLAGS) -MD
67!ELSE
68!IF ($(DLLDEBUG))
69CXXFLAGS = $(CXXFLAGS) -MDd
70!ENDIF
71!ENDIF
72
73!IF $(ENABLE_ACCENTFOLD)
74ACCENTFOLD_LIBS = "$(INDEXERS_DIR)\packages\unac\libunac.lib" "$(INDEXERS_DIR)\packages\windows\iconv\iconv\lib\iconv.lib"
75!ELSE
76ACCENTFOLD_LIBS =
77!ENDIF
78
79!IF $(USE_GDBM)
80GDBM_INCLUDES = -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3" \
81    -I"$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\windows"
82GDBM_LIBS = "$(COMMON_PACKAGES_DIR)\gdbm\gdbm-1.8.3\gdbm.lib"
83GDBM_DEFINES = -DUSE_GDBM
84!ELSE
85GDBM_INCLUDES =
86GDBM_LIBS =
87GDBM_DEFINES =
88!ENDIF
89
90!IF $(USE_JDBM)
91JDBM_DEFINES = -DUSE_JDBM
92!ELSE
93JDBM_DEFINES =
94!ENDIF
95
96!IF $(USE_SQLITE)
97SQLITE_LIBS = "$(COMMON_PACKAGES_DIR)\sqlite\lib\sqlite3.lib"
98SQLITE_DEFINES = -DUSE_SQLITE
99!ELSE
100SQLITE_LIBS =
101SQLITE_DEFINES =
102!ENDIF
103
104!IF $(USE_MSSQL)
105MSSQL_DEFINES = -DUSE_MSSQL
106!ELSE
107MSSQL_DEFINES =
108!ENDIF
109
110!IF $(ENABLE_MG)
111MG_DEFS = -DENABLE_MG
112MG_LIBS = "$(INDEXERS_DIR)\mg\src\text\libmgtext.lib" \
113    "$(INDEXERS_DIR)\mg\lib\libmglib.lib"   
114!ELSE
115MG_DEFS =
116MG_LIBS =
117!ENDIF
118
119!IF $(ENABLE_MGPP)
120MGPP_DEFS = -DENABLE_MGPP
121MGPP_LIBS = "$(INDEXERS_DIR)\mgpp\text\libmgpptext.lib" \
122    "$(INDEXERS_DIR)\mgpp\lib\libmgpplib.lib"
123MGPP_INCLUDES = -I"$(INDEXERS_DIR)\mgpp\text"
124!ELSE
125MGPP_DEFS =
126MGPP_LIBS =
127MGPP_INCLUDES =
128!ENDIF
129
130!IF $(ENABLE_LUCENE)
131LUCENE_DEFS = -DENABLE_LUCENE
132!ELSE
133LUCENE_DEFS=
134!ENDIF
135
136
137AR = lib
138CC = cl
139DEFS = -D__WIN32__ -DHAVE_CONFIG_H -DPARADOCNUM -D_LITTLE_ENDIAN -DSHORT_SUFFIX -D_CRT_SECURE_NO_DEPRECATE \
140        -DGSDL_NOCACHE $(GDBM_DEFINES) $(JDBM_DEFINES) $(SQLITE_DEFINES) $(MSSQL_DEFINES) \
141    $(MG_DEFS) $(MGPP_DEFS) $(LUCENE_DEFS)
142INCLUDES = -I"$(COMMON_DIR)\src\lib" -I"$(COLSERVR_DIR)" -I"$(PROTOCOL_DIR)" -I"$(RECPT_DIR)" \
143        $(MGPP_INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\crypt\crypt" \
144    $(GDBM_INCLUDES) \
145    -I"$(COMMON_PACKAGES_DIR)\windows\expat\expat"
146LDFLAGS =
147LIBS = "$(COMMON_PACKAGES_DIR)\windows\crypt\crypt\crypt.lib" "$(COMMON_PACKAGES_DIR)\windows\expat\expat\libexpat.lib" \
148        $(GDBM_LIBS) $(ACCENTFOLD_LIBS) $(SQLITE_LIBS)
149
150!IF $(GSDL_VC4)
151DEFS = $(DEFS) -DGSDL_NAMESPACE_BROKEN -DGSDL_USE_IOS_H -D__STL_NO_NEW_IOSTREAMS
152INCLUDES = $(INCLUDES) -I"$(COMMON_PACKAGES_DIR)\windows\stlport\stlport"
153!ENDIF
154!IF $(LOCAL_LIBRARY)
155DEFS = $(DEFS) -DGSDL_LOCAL_LIBRARY
156!ENDIF
157
158
159COMPILE = $(CC) -nologo -c $(CXXFLAGS) $(DEFS) $(INCLUDES)
160LINK = $(CC) -nologo -Fe"$@"
161
162
163.SUFFIXES:
164.SUFFIXES: .cpp .obj
165.cpp.obj:
166    $(COMPILE) $<
167
168
169RECPT_OBJECTS = \
170    "$(RECPT_DIR)\cgiargs.obj" \
171    "$(RECPT_DIR)\cgiutils.obj" \
172    "$(RECPT_DIR)\htmlutils.obj"
173
174SOURCES = \
175    abstractlistaction.cpp \
176    dublincore.cpp \
177    qualified_dublincore.cpp \
178    identifyaction.cpp \
179    listidsaction.cpp \
180    listrecsaction.cpp \
181    listsetsaction.cpp \
182    metaformat.cpp \
183    metaformatsaction.cpp \
184    oaiaction.cpp \
185    oaiargs.cpp \
186    oaiconfig.cpp \
187    oaidispatcher.cpp \
188    oaimain.cpp \
189    oaitools.cpp \
190    recordaction.cpp \
191    resumptiontoken.cpp \
192    rfc1807.cpp
193
194OBJECTS = \
195    abstractlistaction.obj \
196    dublincore.obj \
197    qualified_dublincore.obj \
198    identifyaction.obj \
199    listidsaction.obj \
200    listrecsaction.obj \
201    listsetsaction.obj \
202    metaformat.obj \
203    metaformatsaction.obj \
204    oaiaction.obj \
205    oaiargs.obj \
206    oaiconfig.obj \
207    oaidispatcher.obj \
208    oaimain.obj \
209    oaitools.obj \
210    recordaction.obj \
211    resumptiontoken.obj \
212    rfc1807.obj
213
214GSDL_LIBS = \
215    "$(PROTOCOL_DIR)\gsdlprotocol.lib" \
216    "$(COLSERVR_DIR)\gsdlcolservr.lib" \
217    $(MG_LIBS) \
218    $(MGPP_LIBS) \
219    "$(COMMON_DIR)\src\lib\gsdllib.lib"
220
221EXECUTABLE_OBJECTS = \
222    $(OBJECTS) \
223    $(RECPT_OBJECTS) \
224    $(GSDL_LIBS)
225
226EXECUTABLE = oaiserver.cgi
227
228
229# Default target: compile up .obj files only if LOCAL_LIBRARY is set, otherwise both obj files and oaiserver.cgi
230!IF $(LOCAL_LIBRARY)
231all: $(EXECUTABLE_OBJECTS)
232!ELSE
233all: $(EXECUTABLE)
234!ENDIF
235
236oaiserver.cgi: $(EXECUTABLE_OBJECTS)
237    $(LINK) $(EXECUTABLE_OBJECTS) $(LIBS)
238
239!IF $(LOCAL_LIBRARY)
240install:
241!ELSE
242install: $(EXECUTABLE)
243    copy $(EXECUTABLE) "$(GSDL_DIR)\cgi-bin"
244!ENDIF
245
246clean:
247    del *.obj
248    del $(EXECUTABLE)
Note: See TracBrowser for help on using the browser.