source: main/trunk/greenstone2/common-src/win32.mak@ 21871

Last change on this file since 21871 was 21871, checked in by davidb, 11 years ago

win32.mak updated to use newer version of sqlite

File size: 5.7 KB
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_SQLITE = 1
38USE_MSSQL = 0
39# by default, all indexers are enabled
40ENABLE_MG = 1
41ENABLE_MGPP = 1
42ENABLE_LUCENE = 1
43# jni is disabled by default as this is the default for GS2. GS3 will set this explicitly
44ENABLE_JNI = 0
45
46MDEFINES = /f win32.mak
47
48INDEXERSDIR = indexers
49
50COMPILEDIRS = packages\windows\crypt\crypt packages\gdbm\gdbm-1.8.3 \
51 packages\windows\expat\expat packages\search4j src\lib
52
53INSTALLDIRS = src\gdbmedit\db2txt src\gdbmedit\txt2db \
54 src\gdbmedit\gdbmset src\gdbmedit\gdbmget \
55 src\gdbmedit\gdbmkeys src\gdbmedit\gdbmdel
56
57# src\getpw
58
59PACKAGEDIRS =
60
61SQLITE_DIR = packages\sqlite\sqlite-amalgamation-3.6.23.1
62
63
64MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" BINDIR="$(GSDLHOME)\bin\windows"
65
66!IF $(GSDL_VC4)
67MAKECMD = $(MAKECMD) GSDL_VC4=1
68!ENDIF
69!IF $(DEBUG)
70MAKECMD = $(MAKECMD) DEBUG=1
71!ENDIF
72!IF $(DLL)
73MAKECMD = $(MAKECMD) DLL=1
74!ENDIF
75!IF $(DLLDEBUG)
76MAKECMD = $(MAKECMD) DLLDEBUG=1
77!ENDIF
78!IF $(USE_SQLITE)
79PACKAGEDIRS = $(PACKAGEDIRS) $(SQLITE_DIR)
80!ELSE
81MAKECMD = $(MAKECMD) USE_SQLITE=0
82!ENDIF
83!IF $(USE_MSSQL)
84MAKECMD = $(MAKECMD) USE_MSSQL=1
85!ENDIF
86
87MAKECLEANCMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" clean
88
89all: win32.mak unzip $(INDEXERSDIR) $(PACKAGEDIRS) $(COMPILEDIRS) $(INSTALLDIRS)
90
91install: win32.mak $(INDEXERSDIR) $(INSTALLDIRS)
92
93unzip:
94 cd "$(COMMONHOME)"
95 cd packages\windows\crypt
96 if NOT EXIST "crypt" unzip crypt.zip
97 cd "$(COMMONHOME)"
98 cd packages\windows\expat
99 if NOT EXIST "expat" unzip expat.zip
100 cd "$(COMMONHOME)"
101 cd indexers\packages\windows\iconv
102 if NOT EXIST "iconv" unzip iconv.zip
103 cd "$(COMMONHOME)"
104!IF "$(USE_SQLITE)" == "1"
105 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
106 @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. ******
107 @IF NOT EXIST $(SQLITE_DIR) exit /b 1
108!ENDIF
109
110clean:
111 cd "$(COMMONHOME)"
112 cd packages\windows\crypt\crypt
113 $(MAKECLEANCMD)
114 cd "$(COMMONHOME)"
115 cd packages\gdbm\gdbm-1.8.3
116 $(MAKECLEANCMD)
117 cd "$(COMMONHOME)"
118 cd packages\windows\expat\expat
119 $(MAKECLEANCMD)
120 cd "$(COMMONHOME)"
121 cd src\lib
122 $(MAKECLEANCMD)
123 cd "$(COMMONHOME)"
124 cd src\gdbmedit\txt2db
125 $(MAKECLEANCMD)
126 cd "$(COMMONHOME)"
127 cd src\gdbmedit\db2txt
128 $(MAKECLEANCMD)
129 cd "$(COMMONHOME)"
130 cd src\gdbmedit\gdbmget
131 $(MAKECLEANCMD)
132 cd "$(COMMONHOME)"
133 cd src\gdbmedit\gdbmset
134 $(MAKECLEANCMD)
135 cd "$(COMMONHOME)"
136 cd src\gdbmedit\gdbmkeys
137 $(MAKECLEANCMD)
138 cd "$(COMMONHOME)"
139 cd src\gdbmedit\gdbmdel
140 $(MAKECLEANCMD)
141# cd "$(COMMONHOME)"
142# cd src\getpw
143# $(MAKECLEANCMD)
144 cd "$(COMMONHOME)"
145 cd indexers
146 set DEBUG=$(DEBUG)
147 set ENABLE_MG=$(ENABLE_MG)
148 set ENABLE_MGPP=$(ENABLE_MGPP)
149 set ENABLE_LUCENE=$(ENABLE_LUCENE)
150 call winMake.bat clean
151 set DEBUG=
152 set ENABLE_MG=
153 set ENABLE_MGPP=
154 set ENABLE_LUCENE=
155 cd "$(COMMONHOME)"
156 cd packages\search4j
157 $(MAKECLEANCMD)
158!IF EXIST ("$(SQLITE_DIR)")
159 cd "$(COMMONHOME)"
160 cd "$(SQLITE_DIR)"
161 $(MAKECLEANCMD)
162 if exist "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib" del "$(COMMONHOME)\packages\sqlite\lib\sqlite3.lib"
163!ENDIF
164 cd "$(COMMONHOME)"
165
166$(COMPILEDIRS): FORCE
167 cd "$(COMMONHOME)"
168 cd "$@"
169 $(MAKECMD)
170 cd "$(GSDLHOME)"
171
172$(INSTALLDIRS): FORCE
173 cd "$(COMMONHOME)"
174 cd "$@"
175 $(MAKECMD)
176 $(MAKECMD) install
177 cd "$(COMMONHOME)"
178
179$(SQLITE_DIR): FORCE
180!IF "$(USE_SQLITE)" == "1"
181 cd "$(COMMONHOME)"
182 cd "$@"
183 $(MAKECMD)
184 $(MAKECMD) install
185!ENDIF
186 cd "$(COMMONHOME)"
187
188$(INDEXERSDIR): FORCE
189 cd "$(COMMONHOME)"
190 cd "$@"
191 set DEBUG=$(DEBUG)
192 set ENABLE_MG=$(ENABLE_MG)
193 set ENABLE_MGPP=$(ENABLE_MGPP)
194 set ENABLE_LUCENE=$(ENABLE_LUCENE)
195
196!IF $(ENABLE_JNI)
197 call winMake.bat all with-jni
198 call winMake.bat install with-jni
199!ELSE
200 call winMake.bat all without-jni
201 call winMake.bat install without-jni
202!ENDIF
203
204 set DEBUG=
205 set ENABLE_MG=
206 set ENABLE_MGPP=
207 set ENABLE_LUCENE=
208 if NOT EXIST "$(GSDLHOME)\bin\windows" mkdir "$(GSDLHOME)\bin\windows"
209 if NOT EXIST "$(GSDLHOME)\bin\java" mkdir "$(GSDLHOME)\bin\java"
210 for %%i in (bin\*.exe) do \
211 if exist %%i copy %%i "$(GSDLHOME)\bin\windows"
212 if EXIST "lucene-gs\LuceneWrapper.jar" copy "lucene-gs\LuceneWrapper.jar" "$(GSDLHOME)\bin\java"
213 @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
214 cd "$(GSDLHOME)"
215
216FORCE:
217
Note: See TracBrowser for help on using the repository browser.