source: main/trunk/greenstone2/common-src/indexers/winMake.bat@ 21328

Last change on this file since 21328 was 21328, checked in by ak19, 14 years ago

Changes to makefiles, configure files, and source code to work with the new configure flags that allow indexers to be individually compiled up by setting each indexer to be enabled or disabled (enable-mg, enable-mgpp, enable-lucene).

  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 KB
Line 
1@echo off
2
3set MAKE=nmake
4set MAKE_OPTIONS=/f
5
6if "%DEBUG%" == "" (
7 set MAKE_VARS=DEBUG=0
8) else (
9 set MAKE_VARS=DEBUG=%DEBUG%
10)
11
12:: ENABLE_MG/MGPP/LUCENE are guaranteed to be set to either 1 or 0 at this point
13set MAKE_VARS=%MAKE_VARS% ENABLE_MG=%ENABLE_MG%
14set MAKE_VARS=%MAKE_VARS% ENABLE_MGPP=%ENABLE_MGPP%
15set MAKE_VARS=%MAKE_VARS% ENABLE_LUCENE=%ENABLE_LUCENE%
16
17if "%ENABLE_MG%" == "1" if not exist mg (
18 echo ***** Folder mg does not exist, cannot ENABLE_MG.
19 goto failed
20)
21
22if "%ENABLE_MGPP%" == "1" if not exist mgpp (
23 echo ***** Folder mgpp does not exist, cannot ENABLE_MGPP.
24 goto failed
25)
26
27if "%ENABLE_LUCENE%" == "1" if not exist lucene-gs (
28 echo ***** Folder lucene-gs does not exist, cannot ENABLE_LUCENE.
29 goto failed
30)
31
32if ""%1"" == """" goto all
33if ""%1"" == ""all"" goto go
34if ""%1"" == ""install"" goto go
35if ""%1"" == ""clean"" goto clean
36
37:unknown
38 echo Error: Unrecognized argument %1.
39 goto failed
40
41:clean
42 del bin\*
43
44:go
45 if ""%2"" == ""javaonly"" goto java
46 if ""%2"" == ""nojava"" goto nojava
47 if ""%2"" == ""gs2"" goto gs2
48
49:all
50 if NOT EXIST "bin" mkdir bin
51
52 cd packages\windows\iconv
53 if NOT EXIST "iconv" unzip iconv.zip
54 cd iconv
55 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
56 cd ..\..\..\..
57
58 cd packages\unac
59 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" RENAME "%CD%\iconv.h.win" iconv.h
60 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
61 cd ..\..
62
63 if "%ENABLE_MG%" == "1" (
64 cd mg
65 call winMake.bat %1
66 cd ..
67 )
68
69 if "%ENABLE_MGPP%" == "1" (
70 cd mgpp
71 call winMake.bat %1
72 cd ..
73 )
74
75 if "%ENABLE_LUCENE%" == "1" (
76 cd lucene-gs
77 call winMake.bat %1
78 cd ..
79 )
80
81 if ""%1"" == ""clean"" goto clean2
82 goto done
83
84:: Need another clean because a pre-all clean command sent to iconv regenerates some lib
85:: and object files. So we delete these after it's finished processing the clean command
86:clean2
87 for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.obj del packages\windows\iconv\iconv\%%I\*.obj;
88 for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.lib del packages\windows\iconv\iconv\%%I\*.lib;
89
90:java
91 if "%ENABLE_MG%" == "1" (
92 cd mg
93 call winMake.bat %1 javaonly
94 cd ..
95 )
96
97 if "%ENABLE_MGPP%" == "1" (
98 cd mgpp
99 call winMake.bat %1 javaonly
100 cd ..
101 )
102
103 if "%ENABLE_LUCENE%" == "1" (
104 cd lucene-gs
105 call winMake.bat %1
106 cd ..
107 )
108 goto done
109
110:nojava
111 cd packages\windows\iconv\iconv
112 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
113 cd ..\..\..\..
114
115 cd packages\unac
116 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" RENAME "%CD%\iconv.h.win" iconv.h
117 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
118 cd ..\..
119
120 if "%ENABLE_MG%" == "1" (
121 cd mg
122 call winMake.bat %1 nojava
123 cd ..
124 )
125
126 if "%ENABLE_MGPP%" == "1" (
127 cd mgpp
128 call winMake.bat %1 nojava
129 cd ..
130 )
131 goto done
132
133:gs2
134 if NOT EXIST "bin" mkdir bin
135
136 cd packages\windows\iconv\iconv
137 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
138 cd ..\..\..\..
139
140 cd packages\unac
141 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" RENAME "%CD%\iconv.h.win" iconv.h
142 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
143 cd ..\..
144
145 if "%ENABLE_MG%" == "1" (
146 cd mg
147 call winMake.bat %1 nojava
148 cd ..
149 )
150
151 if "%ENABLE_MGPP%" == "1" (
152 cd mgpp
153 call winMake.bat %1 nojava
154 cd ..
155 )
156
157 if "%ENABLE_LUCENE%" == "1" (
158 cd lucene-gs
159 call winMake.bat %1
160 cd ..
161 )
162 goto done
163
164
165:failed
166echo ***** Compilation terminated with failure in %~dp0%0
167exit /b 1
168
169:done
Note: See TracBrowser for help on using the repository browser.