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

Last change on this file since 35702 was 35702, checked in by davidb, 3 years ago

Visual Studio *Major* version now set in build.xml as integer value to make subsequent testing in Windows nmake and bat files

  • Property svn:keywords set to Author Date Id Revision
File size: 3.6 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"" == ""without-jni"" goto without-jni
48
49:all
50:with-jni
51 if NOT EXIST "bin" mkdir bin
52
53 cd packages\windows\iconv
54 set ICONVZIP=iconv-VS14-PLUS.zip
55 if %VISUAL_STUDIO_MAJORVERSION% LSS 14 set ICONVZIP=iconv-PRE-VS14.zip
56 echo Selected iconvzip: %ICONVZIP%
57 if NOT EXIST "iconv" unzip "%ICONVZIP%"
58 cd iconv
59 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
60 cd ..\..\..\..
61
62 cd packages\unac
63 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" copy "%CD%\iconv.h.win" iconv.h
64 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
65 cd ..\..
66
67 if "%ENABLE_MG%" == "1" (
68 cd mg
69 call winMake.bat %1
70 cd ..
71 )
72
73 if "%ENABLE_MGPP%" == "1" (
74 cd mgpp
75 call winMake.bat %1
76 cd ..
77 )
78
79 if "%ENABLE_LUCENE%" == "1" (
80 cd lucene-gs
81 call winMake.bat %1
82 cd ..
83 )
84
85 if ""%1"" == ""clean"" goto clean2
86 goto done
87
88:: Need another clean because a pre-all clean command sent to iconv regenerates some lib
89:: and object files. So we delete these after it's finished processing the clean command
90:clean2
91 for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.obj del packages\windows\iconv\iconv\%%I\*.obj;
92 for %%I in (lib srclib libcharset\lib) do if exist packages\windows\iconv\iconv\%%I\^*.lib del packages\windows\iconv\iconv\%%I\*.lib;
93 goto done
94
95:java
96 if "%ENABLE_MG%" == "1" (
97 cd mg
98 call winMake.bat %1 javaonly
99 cd ..
100 )
101
102 if "%ENABLE_MGPP%" == "1" (
103 cd mgpp
104 call winMake.bat %1 javaonly
105 cd ..
106 )
107
108 if "%ENABLE_LUCENE%" == "1" (
109 cd lucene-gs
110 call winMake.bat %1
111 cd ..
112 )
113 goto done
114
115:nojava
116 cd packages\windows\iconv\iconv
117 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
118 cd ..\..\..\..
119
120 cd packages\unac
121 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" copy "%CD%\iconv.h.win" iconv.h
122 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
123 cd ..\..
124
125 if "%ENABLE_MG%" == "1" (
126 cd mg
127 call winMake.bat %1 nojava
128 cd ..
129 )
130
131 if "%ENABLE_MGPP%" == "1" (
132 cd mgpp
133 call winMake.bat %1 nojava
134 cd ..
135 )
136 goto done
137
138:without-jni
139 if NOT EXIST "bin" mkdir bin
140
141 cd packages\windows\iconv\iconv
142 %MAKE% %MAKE_OPTIONS% Makefile.msvc %MAKE_VARS% NO_NLS=1
143 cd ..\..\..\..
144
145 cd packages\unac
146 if NOT EXIST "iconv.h" if EXIST "iconv.h.win" copy "%CD%\iconv.h.win" iconv.h
147 %MAKE% %MAKE_OPTIONS% win32.mak %1 %MAKE_VARS%
148 cd ..\..
149
150 if "%ENABLE_MG%" == "1" (
151 cd mg
152 call winMake.bat %1 nojava
153 cd ..
154 )
155
156 if "%ENABLE_MGPP%" == "1" (
157 cd mgpp
158 call winMake.bat %1 nojava
159 cd ..
160 )
161
162 if "%ENABLE_LUCENE%" == "1" (
163 cd lucene-gs
164 call winMake.bat %1
165 cd ..
166 )
167 goto done
168
169
170:failed
171echo ***** Compilation terminated with failure in %~dp0%0
172exit /b 1
173
174:done
Note: See TracBrowser for help on using the repository browser.