root/main/branches/64_bit_Greenstone/greenstone2/common-src/win32.mak @ 24031

Revision 22817, 7.8 KB (checked in by ak19, 9 years ago)

Fixing up makefiles to work with recent changes DLConsulting made related to expat (expat now set up like on Linux: it is compiled up rather than obtained from a zip file).

Line 
1###########################################################################
2#
3# win32 makefile -- common code between gsdl runtime and buildtime
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  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
27!IF "$(GSDLHOME)"==""
28GSDLHOME = $(MAKEDIR)
29!ELSE
30GSDLHOME = $(GSDLHOME)
31!ENDIF
32COMMONHOME = $(MAKEDIR)
33GSDL_VC4 = 0
34DEBUG = 0
35DLL = 0
36DLLDEBUG = 0
37USE_GDBM = 1
38USE_JDBM = 1
39USE_SQLITE = 1
40USE_MSSQL = 0
41# by default, all indexers are enabled
42ENABLE_MG = 1
43ENABLE_MGPP = 1
44ENABLE_LUCENE = 1
45# jni is disabled by default as this is the default for GS2. GS3 will set this explicitly
46ENABLE_JNI = 0
47
48MDEFINES = /f win32.mak
49
50INDEXERSDIR = indexers
51
52COMPILEDIRS = packages\windows\crypt\crypt \
53          packages\search4j src\lib
54
55INSTALLDIRS = packages\expat
56
57#    src\getpw
58
59PACKAGEDIRS =
60
61EXPAT_DIR = packages\expat\expat-1.95.8
62SQLITE_DIR = packages\sqlite\sqlite-amalgamation-3.6.23.1
63JDBM_DIR = packages\jdbm
64JDBMEDIT_DIR = src\jdbmedit
65
66MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" BINDIR="$(GSDLHOME)\bin\windows"
67
68!IF $(GSDL_VC4)
69MAKECMD = $(MAKECMD) GSDL_VC4=1
70!ENDIF
71!IF $(DEBUG)
72MAKECMD = $(MAKECMD) DEBUG=1
73!ENDIF
74!IF $(DLL)
75MAKECMD = $(MAKECMD) DLL=1
76!ENDIF
77!IF $(DLLDEBUG)
78MAKECMD = $(MAKECMD) DLLDEBUG=1
79!ENDIF
80!IF $(ENABLE_JNI)
81MAKECMD = $(MAKECMD) ENABLE_JNI=1
82!ENDIF
83!IF !$(ENABLE_MG)
84MAKECMD = $(MAKECMD) ENABLE_MG=0
85!ENDIF
86!IF !$(ENABLE_MGPP)
87MAKECMD = $(MAKECMD) ENABLE_MGPP=0
88!ENDIF
89!IF !$(ENABLE_LUCENE)
90MAKECMD = $(MAKECMD) ENABLE_LUCENE=0
91!ENDIF
92
93!IF $(USE_GDBM)
94GDBM_DEFINES = -DUSE_GDBM
95COMPILEDIRS = $(COMPILEDIRS) \
96    packages\gdbm\gdbm-1.8.3
97INSTALLDIRS = $(INSTALLDIRS) src\gdbmedit\db2txt src\gdbmedit\txt2db \
98    src\gdbmedit\gdbmset src\gdbmedit\gdbmget \
99    src\gdbmedit\gdbmkeys src\gdbmedit\gdbmdel
100!ELSE
101GDBM_DEFINES =
102MAKECMD = $(MAKECMD) USE_GDBM=0
103!ENDIF
104
105!IF $(USE_JDBM)
106JDBM_DEFINES = -DUSE_JDBM
107PACKAGEDIRS = $(PACKAGEDIRS) $(JDBM_DIR)
108!ELSE
109JDBM_DEFINES =
110MAKECMD = $(MAKECMD) USE_JDBM=0
111!ENDIF
112
113!IF $(USE_SQLITE)
114SQLITE_DEFINES = -DUSE_SQLITE
115PACKAGEDIRS = $(PACKAGEDIRS) $(SQLITE_DIR)
116!ELSE
117SQLITE_DEFINES =
118MAKECMD = $(MAKECMD) USE_SQLITE=0
119!ENDIF
120
121!IF $(USE_MSSQL)
122MSSQL_DEFINES = -DUSE_MSSQL
123MAKECMD = $(MAKECMD) USE_MSSQL=1
124!ELSE
125MSSQL_DEFINES =
126!ENDIF
127
128MAKECLEANCMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" clean
129
130all: win32.mak unzip $(INDEXERSDIR) $(PACKAGEDIRS) $(COMPILEDIRS) $(INSTALLDIRS) $(JDBMEDIT_DIR)
131
132install: win32.mak $(INDEXERSDIR) $(INSTALLDIRS)
133
134unzip:
135    cd "$(COMMONHOME)"
136    cd packages\windows\crypt
137    if NOT EXIST "crypt" unzip crypt.zip
138    cd "$(COMMONHOME)"
139    IF NOT EXIST $(EXPAT_DIR) IF EXIST "$(GSDLHOME)\bin\windows\gunzip.exe" IF EXIST "$(GSDLHOME)\bin\windows\tar.exe" "$(GSDLHOME)\bin\windows\gunzip.exe" -cd "$(EXPAT_DIR).tar.gz" | "$(GSDLHOME)\bin\windows\tar.exe" xv --directory=./packages/expat
140    @IF NOT EXIST $(EXPAT_DIR) echo ****** Couldn't extract archive $(EXPAT_DIR).tar.gz. Extract it manually, or check that gunzip.exe and tar.exe exist in GSDLHOME\bin\windows. ******
141    @IF NOT EXIST $(EXPAT_DIR) exit /b 1
142    cd "$(COMMONHOME)"
143    cd indexers\packages\windows\iconv
144    if NOT EXIST "iconv" unzip iconv.zip
145    cd "$(COMMONHOME)"
146
147!IF "$(USE_SQLITE)" == "1"
148    IF NOT EXIST $(SQLITE_DIR) IF EXIST "$(GSDLHOME)\bin\windows\gunzip.exe" IF EXIST "$(GSDLHOME)\bin\windows\tar.exe" "$(GSDLHOME)\bin\windows\gunzip.exe" -cd "$(SQLITE_DIR).tar.gz" | "$(GSDLHOME)\bin\windows\tar.exe" xv --directory=./packages/sqlite
149    @IF NOT EXIST $(SQLITE_DIR) echo ****** Couldn't extract archive $(SQLITE_DIR).tar.gz. Extract it manually, or check that gunzip.exe and tar.exe exist in GSDLHOME\bin\windows. ******
150    @IF NOT EXIST $(SQLITE_DIR) exit /b 1
151    cd "$(COMMONHOME)"
152!ENDIF
153
154!IF "$(USE_JDBM)" == "1"
155    IF NOT EXIST $(JDBM_DIR)\jdbm-1.0 IF EXIST "$(GSDLHOME)\bin\windows\gunzip.exe" IF EXIST "$(GSDLHOME)\bin\windows\tar.exe" "$(GSDLHOME)\bin\windows\gunzip.exe" -cd "$(JDBM_DIR)\gs-jdbm-1.0.tar.gz" | "$(GSDLHOME)\bin\windows\tar.exe" xv --directory=./packages/jdbm
156    @IF NOT EXIST $(JDBM_DIR)\jdbm-1.0 echo ****** Couldn't extract archive $(JDBM_DIR)\gs-jdbm-1.0.tar.gz. Extract it manually, or check that gunzip.exe and tar.exe exist in GSDLHOME\bin\windows. ******
157    @IF NOT EXIST $(JDBM_DIR)\jdbm-1.0 exit /b 1
158!ENDIF
159
160clean:
161    cd "$(COMMONHOME)"
162    cd packages\windows\crypt\crypt
163    $(MAKECLEANCMD)
164!IF EXIST ("packages\gdbm\gdbm-1.8.3")
165    cd "$(COMMONHOME)"
166    cd packages\gdbm\gdbm-1.8.3
167    $(MAKECLEANCMD)
168!ENDIF
169    cd "$(COMMONHOME)"
170!IF EXIST (packages\expat)
171    cd packages\expat
172    $(MAKECLEANCMD)
173    cd "$(COMMONHOME)"
174!ENDIF 
175    cd src\lib
176    $(MAKECLEANCMD)
177!IF EXIST ("src\gdbmedit")
178    cd "$(COMMONHOME)"
179    cd src\gdbmedit\txt2db
180    $(MAKECLEANCMD)
181    cd "$(COMMONHOME)"
182    cd src\gdbmedit\db2txt
183    $(MAKECLEANCMD)
184    cd "$(COMMONHOME)"
185    cd src\gdbmedit\gdbmget
186    $(MAKECLEANCMD)
187    cd "$(COMMONHOME)"
188    cd src\gdbmedit\gdbmset
189    $(MAKECLEANCMD)
190    cd "$(COMMONHOME)"
191    cd src\gdbmedit\gdbmkeys
192    $(MAKECLEANCMD)
193    cd "$(COMMONHOME)"
194    cd src\gdbmedit\gdbmdel
195    $(MAKECLEANCMD)
196!ENDIF
197#   cd "$(COMMONHOME)"
198#   cd src\getpw
199#   $(MAKECLEANCMD)
200    cd "$(COMMONHOME)"
201    cd indexers
202    set DEBUG=$(DEBUG)
203    set ENABLE_MG=$(ENABLE_MG)
204    set ENABLE_MGPP=$(ENABLE_MGPP)
205    set ENABLE_LUCENE=$(ENABLE_LUCENE)
206    call winMake.bat clean
207    set DEBUG=
208    set ENABLE_MG=
209    set ENABLE_MGPP=
210    set ENABLE_LUCENE=
211    cd "$(COMMONHOME)"
212    cd packages\search4j
213    $(MAKECLEANCMD)
214!IF EXIST ("$(SQLITE_DIR)")
215    cd "$(COMMONHOME)"
216    cd "$(SQLITE_DIR)"
217    $(MAKECLEANCMD)
218    if exist "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib" del "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib"
219!ENDIF
220    cd "$(COMMONHOME)" 
221
222$(COMPILEDIRS): FORCE
223    cd "$(COMMONHOME)"
224    cd "$@"
225    $(MAKECMD)
226    cd "$(GSDLHOME)"
227
228!IF "$(INSTALLDIRS)" != ""
229$(INSTALLDIRS): FORCE
230    cd "$(COMMONHOME)"
231    cd "$@"
232    $(MAKECMD)
233    $(MAKECMD) install
234    cd "$(COMMONHOME)"
235!ENDIF
236
237$(SQLITE_DIR): FORCE
238    cd "$(COMMONHOME)"
239    cd "$@"
240    $(MAKECMD)
241    $(MAKECMD) install
242    cd "$(COMMONHOME)"
243
244$(JDBM_DIR): FORCE
245    cd "$(COMMONHOME)\$(JDBM_DIR)\jdbm-1.0"
246    set DEBUG=$(DEBUG)
247    call winMake.bat all
248    call winMake.bat install   
249    set DEBUG=
250
251$(JDBMEDIT_DIR): FORCE
252!IF "$(USE_JDBM)" == "1"
253    cd "$(COMMONHOME)"
254    cd "$@"
255    set DEBUG=$(DEBUG)
256    call winMake.bat all
257    call winMake.bat install   
258    set DEBUG=
259!ENDIF
260
261$(INDEXERSDIR): FORCE
262    cd "$(COMMONHOME)"
263    cd "$@"
264    set DEBUG=$(DEBUG)
265    set ENABLE_MG=$(ENABLE_MG)
266    set ENABLE_MGPP=$(ENABLE_MGPP)
267    set ENABLE_LUCENE=$(ENABLE_LUCENE)
268
269!IF $(ENABLE_JNI)
270    call winMake.bat all with-jni
271    call winMake.bat install with-jni
272!ELSE
273    call winMake.bat all without-jni
274    call winMake.bat install without-jni
275!ENDIF
276
277    set DEBUG=
278    set ENABLE_MG=
279    set ENABLE_MGPP=
280    set ENABLE_LUCENE=
281    if NOT EXIST "$(GSDLHOME)\bin\windows" mkdir "$(GSDLHOME)\bin\windows"
282    if NOT EXIST "$(GSDLHOME)\bin\java" mkdir "$(GSDLHOME)\bin\java"
283    for %%i in (bin\*.exe) do \
284      if exist %%i copy %%i "$(GSDLHOME)\bin\windows"
285    if EXIST "lucene-gs\LuceneWrapper.jar" copy "lucene-gs\LuceneWrapper.jar" "$(GSDLHOME)\bin\java"
286    @if NOT EXIST "lucene-gs\LuceneWrapper.jar" echo Warning: Failed to find lucene-gs\LuceneWrapper.jar. Greenstone will not be able to use Lucene for indexing
287    cd "$(GSDLHOME)"
288
289FORCE:
290
Note: See TracBrowser for help on using the browser.