root/main/trunk/greenstone2/common-src/win32.mak @ 33119

Revision 33119, 7.9 KB (checked in by ak19, 15 months ago)

Got the syntax wrong for windows win32.mak makefiles, as this is not the same as with windows batch files

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 = cgi-bin packages\windows\crypt\crypt \
53          packages\search4j src\lib
54
55INSTALLDIRS = cgi-bin packages\expat
56
57#    src\getpw
58
59PACKAGEDIRS =
60
61EXPAT_DIR = packages\expat\expat-1.95.8
62SQLITE_DIR = packages\sqlite\sqlite-autoconf-3070602
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 cgi-bin
163    $(MAKECLEANCMD)
164    cd "$(COMMONHOME)"
165!IF EXIST ("packages\windows\crypt\crypt")
166    cd packages\windows\crypt\crypt
167    $(MAKECLEANCMD)
168!ENDIF
169!IF EXIST ("packages\gdbm\gdbm-1.8.3")
170    cd "$(COMMONHOME)"
171    cd packages\gdbm\gdbm-1.8.3
172    $(MAKECLEANCMD)
173!ENDIF
174    cd "$(COMMONHOME)"
175!IF EXIST (packages\expat)
176    cd packages\expat
177    $(MAKECLEANCMD)
178    cd "$(COMMONHOME)"
179!ENDIF 
180    cd src\lib
181    $(MAKECLEANCMD)
182!IF EXIST ("src\gdbmedit")
183    cd "$(COMMONHOME)"
184    cd src\gdbmedit\txt2db
185    $(MAKECLEANCMD)
186    cd "$(COMMONHOME)"
187    cd src\gdbmedit\db2txt
188    $(MAKECLEANCMD)
189    cd "$(COMMONHOME)"
190    cd src\gdbmedit\gdbmget
191    $(MAKECLEANCMD)
192    cd "$(COMMONHOME)"
193    cd src\gdbmedit\gdbmset
194    $(MAKECLEANCMD)
195    cd "$(COMMONHOME)"
196    cd src\gdbmedit\gdbmkeys
197    $(MAKECLEANCMD)
198    cd "$(COMMONHOME)"
199    cd src\gdbmedit\gdbmdel
200    $(MAKECLEANCMD)
201!ENDIF
202#   cd "$(COMMONHOME)"
203#   cd src\getpw
204#   $(MAKECLEANCMD)
205    cd "$(COMMONHOME)"
206    cd indexers
207    set DEBUG=$(DEBUG)
208    set ENABLE_MG=$(ENABLE_MG)
209    set ENABLE_MGPP=$(ENABLE_MGPP)
210    set ENABLE_LUCENE=$(ENABLE_LUCENE)
211    call winMake.bat clean
212    set DEBUG=
213    set ENABLE_MG=
214    set ENABLE_MGPP=
215    set ENABLE_LUCENE=
216    cd "$(COMMONHOME)"
217    cd packages\search4j
218    $(MAKECLEANCMD)
219!IF EXIST ("$(SQLITE_DIR)")
220    cd "$(COMMONHOME)"
221    cd "$(SQLITE_DIR)"
222    $(MAKECLEANCMD)
223    if exist "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib" del "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib"
224!ENDIF
225    cd "$(COMMONHOME)" 
226
227$(COMPILEDIRS): FORCE
228    cd "$(COMMONHOME)"
229    cd "$@"
230    $(MAKECMD)
231    cd "$(GSDLHOME)"
232
233!IF "$(INSTALLDIRS)" != ""
234$(INSTALLDIRS): FORCE
235    cd "$(COMMONHOME)"
236    cd "$@"
237    $(MAKECMD)
238    $(MAKECMD) install
239    cd "$(COMMONHOME)"
240!ENDIF
241
242$(SQLITE_DIR): FORCE
243    cd "$(COMMONHOME)"
244    cd "$@"
245    $(MAKECMD)
246    $(MAKECMD) install
247    cd "$(COMMONHOME)"
248
249$(JDBM_DIR): FORCE
250    cd "$(COMMONHOME)\$(JDBM_DIR)\jdbm-1.0"
251    set DEBUG=$(DEBUG)
252    call winMake.bat all
253    call winMake.bat install   
254    set DEBUG=
255
256$(JDBMEDIT_DIR): FORCE
257!IF "$(USE_JDBM)" == "1"
258    cd "$(COMMONHOME)"
259    cd "$@"
260    set DEBUG=$(DEBUG)
261    call winMake.bat all
262    call winMake.bat install   
263    set DEBUG=
264!ENDIF
265
266$(INDEXERSDIR): FORCE
267    cd "$(COMMONHOME)"
268    cd "$@"
269    set DEBUG=$(DEBUG)
270    set ENABLE_MG=$(ENABLE_MG)
271    set ENABLE_MGPP=$(ENABLE_MGPP)
272    set ENABLE_LUCENE=$(ENABLE_LUCENE)
273
274!IF $(ENABLE_JNI)
275    call winMake.bat all with-jni
276    call winMake.bat install with-jni
277!ELSE
278    call winMake.bat all without-jni
279    call winMake.bat install without-jni
280!ENDIF
281
282    set DEBUG=
283    set ENABLE_MG=
284    set ENABLE_MGPP=
285    set ENABLE_LUCENE=
286    if NOT EXIST "$(GSDLHOME)\bin\windows" mkdir "$(GSDLHOME)\bin\windows"
287    if NOT EXIST "$(GSDLHOME)\bin\java" mkdir "$(GSDLHOME)\bin\java"
288    for %%i in (bin\*.exe) do \
289      if exist %%i copy %%i "$(GSDLHOME)\bin\windows"
290    if EXIST "lucene-gs\LuceneWrapper4.jar" copy "lucene-gs\LuceneWrapper4.jar" "$(GSDLHOME)\bin\java"
291    @if NOT EXIST "lucene-gs\LuceneWrapper4.jar" echo Warning: Failed to find lucene-gs\LuceneWrapper4.jar. Greenstone will not be able to use Lucene for indexing
292    cd "$(GSDLHOME)"
293
294FORCE:
295
Note: See TracBrowser for help on using the browser.