root/gsdl/trunk/common-src/win32.mak @ 18309

Revision 18309, 3.7 KB (checked in by davidb, 12 years ago)

New 'unzip' target added which checks windows/packages/*.zip and unzips them is companion folder not there

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
27GSDLHOME = $(GSDLHOME)
28COMMONHOME = $(MAKEDIR)
29GSDL_VC4 = 0
30DLL = 0
31DLLDEBUG = 0
32USE_SQLITE = 1
33USE_MSSQL = 0
34
35MDEFINES = /f win32.mak
36
37INDEXERSDIR = indexers
38
39COMPILEDIRS = packages\windows\crypt\crypt packages\gdbm\gdbm-1.8.3 \
40          packages\windows\expat\expat packages\search4j src\lib
41
42INSTALLDIRS = src\gdbmedit\db2txt src\gdbmedit\txt2db src\gdbmedit\gdbmset src\gdbmedit\gdbmget
43
44PACKAGEDIRS =
45
46SQLITE_DIR = packages\sqlite\sqlite-amalgamation-3.5.9
47
48MAKECMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" BINDIR="$(GSDLHOME)\bin\windows"
49
50!IF $(GSDL_VC4)
51MAKECMD = $(MAKECMD) GSDL_VC4=1
52!ENDIF
53!IF $(DLL)
54MAKECMD = $(MAKECMD) DLL=1
55!ENDIF
56!IF $(DLLDEBUG)
57MAKECMD = $(MAKECMD) DLLDEBUG=1
58!ENDIF
59!IF $(USE_SQLITE)
60MAKECMD = $(MAKECMD) USE_SQLITE=1
61PACKAGEDIRS = $(PACKAGEDIRS) $(SQLITE_DIR)
62!ENDIF
63!IF $(USE_MSSQL)
64MAKECMD = $(MAKECMD) USE_MSSQL=1
65!ENDIF
66
67MAKECLEANCMD = $(MAKE) $(MDEFINES) GSDLHOME="$(GSDLHOME)" clean
68
69all: win32.mak unzip $(INDEXERSDIR) $(PACKAGEDIRS) $(COMPILEDIRS) $(INSTALLDIRS)
70
71install: win32.mak $(INDEXERSDIR) $(INSTALLDIRS)
72
73unzip:
74    cd "$(COMMONHOME)"
75    cd packages\windows\crypt
76    if NOT EXIST "crypt" unzip crypt.zip
77    cd "$(COMMONHOME)"
78    cd packages\windows\gdbm
79    if NOT EXIST "gdbm" unzip gdbm.zip
80    cd "$(COMMONHOME)"
81    cd packages\windows\expat
82    if NOT EXIST "expat" unzip expat.zip
83
84clean:
85    cd "$(COMMONHOME)"
86    cd packages\windows\crypt\crypt
87    $(MAKECLEANCMD)
88    cd "$(COMMONHOME)"
89    cd packages\gdbm\gdbm-1.8.3
90    $(MAKECLEANCMD)
91    cd "$(COMMONHOME)"
92    cd packages\windows\expat\expat
93    $(MAKECLEANCMD)
94    cd "$(COMMONHOME)"
95    cd src\lib
96    $(MAKECLEANCMD)
97    cd "$(COMMONHOME)"
98    cd src\gdbmedit\txt2db
99    $(MAKECLEANCMD)
100    cd "$(COMMONHOME)"
101    cd src\gdbmedit\db2txt
102    $(MAKECLEANCMD)
103    cd "$(COMMONHOME)"
104    cd indexers
105    call winMake.bat clean
106    cd "$(COMMONHOME)"
107    cd packages\search4j
108    cd "$(COMMONHOME)"
109
110$(COMPILEDIRS): FORCE
111    cd "$(COMMONHOME)"
112    cd "$@"
113    $(MAKECMD)
114    cd "$(GSDLHOME)"
115
116$(INSTALLDIRS): FORCE
117    cd "$(COMMONHOME)"
118    cd "$@"
119    $(MAKECMD)
120    $(MAKECMD) install
121    cd "$(COMMONHOME)"
122
123$(SQLITE_DIR): FORCE
124    cd "$(COMMONHOME)"
125    cd "$@"
126    $(MAKECMD)
127    $(MAKECMD) install
128    cd "$(COMMONHOME)"
129
130$(INDEXERSDIR): FORCE
131    cd "$(COMMONHOME)"
132    cd "$@"
133    call winMake.bat all gs2
134    call winMake.bat install gs2
135    if NOT EXIST "$(GSDLHOME)\bin\windows" mkdir "$(GSDLHOME)\bin\windows"
136    if NOT EXIST "$(GSDLHOME)\bin\java" mkdir "$(GSDLHOME)\bin\java"
137    for %%i in (bin\*.exe) do \
138      copy %%i "$(GSDLHOME)\bin\windows"
139    if EXIST "lucene-gs\LuceneWrapper.jar" copy "lucene-gs\LuceneWrapper.jar" "$(GSDLHOME)\bin\java"
140    @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
141    cd "$(GSDLHOME)"
142
143FORCE:
144
Note: See TracBrowser for help on using the browser.