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

Revision 21348, 5.6 KB (checked in by xiao, 10 years ago)

GS2build's win32.mak (and Makefile and configure) aren't used by greenstone3's build.xml file. Only the makefiles of common-src and build-src are called. So the recent changes to enable individual indexers using the ENABLE_ flags are expanded to allow common-src to be able to deal with these flags its own.

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