forked from xHarbour-org/xharbour
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_w32.bat
200 lines (179 loc) · 6.73 KB
/
make_w32.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
@echo off
rem ============================================================================
rem
rem $Id$
rem
rem FILE: make_w32.bat
rem BATCH FILE FOR OPENWATCOM
rem
rem This is Generic File, do not change it. If you should require your own build
rem version, changes should only be made on your local copy.(AJ:2008-04-26)
rem
rem ============================================================================
REM SET HB_OPTIMFLAGS=-gc3
REM SET HB_DEBUG=d
REM SET HB_GUI=1
REM SET HB_NO_BACKGROUND=1
REM SET HB_DIR_POSTGRESQL=
REM SET HB_DIR_OCILIB=
REM SET HB_DIR_MYSQL=
REM SET HB_DIR_FIREBIRD=
REM SET HB_DIR_CAIRO=
REM SET HB_DIR_CURL=
REM SET HB_DIR_OPENSSL=
REM SET HB_DIR_MAGIC=
REM SET HB_DIR_ADS=
IF %SUB_DIR%.==. SET SUB_DIR=w32
IF %CC_DIR%.==. SET CC_DIR=C:\WATCOM
IF %BISON_DIR%.==. SET BISON_DIR=C:\BISON\BIN
SET HB_GT_LIB=$(GTWIN_LIB)
SET _LIB=%LIB%
SET _PATH=%PATH%
SET PATH=%CC_DIR%\BINNT;%CC_DIR%\BINW;%BISON_DIR%;%_PATH%
SET WATCOM=%CC_DIR%
SET EDPATH=%CC_DIR%\EDDAT
SET LIB=%CC_DIR%\lib386;%CC_DIR%\lib386\nt;%_LIB%
rem ============================================================================
rem The followings should never change
rem Do not hard-code in makefile because there are needed for clean build
rem ============================================================================
SET OBJEXT=%HB_ARCH%%HB_DEBUG%.obj
SET LIBEXT=%HB_ARCH%%HB_DEBUG%.lib
SET DIR_SEP=\
REM SET LIBPREFIX=
rem ============================================================================
if "%1"=="/?" goto SYNTAX
if "%1"=="-?" goto SYNTAX
if "%1"=="?" goto SYNTAX
if "%1"=="" goto BUILD
if "%1"=="NOMT" goto BUILD
if "%1"=="nomt" goto BUILD
if "%1"=="clean" goto CLEAN
if "%1"=="CLEAN" goto CLEAN
if "%1"=="CORE" goto BUILD
if "%1"=="core" goto BUILD
if "%1"=="DLL" goto DLL
if "%1"=="dll" goto DLL
if "%1"=="CONTRIB" goto CONTRIBS
if "%1"=="contrib" goto CONTRIBS
if "%1"=="ALL" goto BUILD_ALL
if "%1"=="all" goto BUILD_ALL
goto SYNTAX
rem=============================================================================
:BUILD
rem=============================================================================
SET __BLD__=CORE_BLD
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
wmake -h -ms -f winmake\makefile.wc >make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
if "%1"=="NOMT" goto BUILD_OK
if "%1"=="nomt" goto BUILD_OK
if "%2"=="NOMT" goto BUILD_OK
if "%2"=="nomt" goto BUILD_OK
SET HB_MT=mt
SET HB_MT_DIR=
@CALL winmake\mdir.bat
wmake -h -ms HB_THREAD_SUPPORT=1 -f winmake\makefile.wc >>make_%SUB_DIR%.log
if errorlevel 1 goto BUILD_ERR
goto BUILD_OK
rem=============================================================================
:BUILD_OK
rem=============================================================================
@CALL winmake\mdir.bat copytobin
if "%MAKEALL%"=="" @ECHO ****** End of Job *****
if "%MAKEALL%"=="" goto EXIT
if "%1"=="CORE" @ECHO ****** End of Job *****
if "%1"=="core" @ECHO ****** End of Job *****
if "%1"=="CORE" goto EXIT
if "%1"=="core" goto EXIT
goto DLL
rem=============================================================================
:BUILD_ERR
rem=============================================================================
IF EXIST make_%SUB_DIR%.log notepad make_%SUB_DIR%.log
goto EXIT
rem=============================================================================
:DLL
rem=============================================================================
rem
rem We use HB_MT_DIR envar for DLL object folder here
rem
SET __BLD__=DLL_BLD
SET HB_MT=
SET HB_MT_DIR=\dll
@CALL winmake\mdir.bat dllcreate
wmake -h -ms -f winmake\makefile.wc >dll_%SUB_DIR%.log
if errorlevel 1 goto DLL_ERR
goto DLL_OK
rem=============================================================================
:DLL_OK
rem=============================================================================
@CALL winmake\mdir.bat dllcopy
if "%MAKEALL%"=="" @ECHO ****** End of Job *****
IF "%MAKEALL%"=="" goto EXIT
IF "%1"=="DLL" @ECHO ****** End of Job *****
IF "%1"=="dll" @ECHO ****** End of Job *****
IF "%1"=="DLL" goto EXIT
IF "%1"=="dll" goto EXIT
goto CONTRIBS
rem=============================================================================
:DLL_ERR
rem=============================================================================
if exist dll_%SUB_DIR%.log notepad dll_%SUB_DIR%.log
goto EXIT
rem=============================================================================
:CONTRIBS
rem=============================================================================
SET __BLD__=CONTRIB_BLD
SET HB_MT=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
wmake -h -ms -f winmake\makefile.wc >cont_%SUB_DIR%.log
if errorlevel 1 goto CONTRIBS_ERR
REM SET HB_MT=mt
REM SET HB_MT_DIR=
REM wmake -h -ms HB_THREAD_SUPPORT=1 -f winmake\makefile.wc >>cont_%SUB_DIR%.log
REM if errorlevel 1 goto CONTRIBS_ERR
rem=============================================================================
:CONTRIBS_OK
rem=============================================================================
@CALL winmake\mdir.bat copycontrib
@ECHO ****** End of Job *****
goto EXIT
rem=============================================================================
:CONTRIBS_ERR
rem=============================================================================
IF EXIST cont_%SUB_DIR%.log notepad cont_%SUB_DIR%.log
goto EXIT
rem=============================================================================
:BUILD_ALL
rem=============================================================================
SET MAKEALL=yes
goto BUILD
rem=============================================================================
:SYNTAX
rem=============================================================================
ECHO.
ECHO. ---------------------------------
ECHO. Make Utility for OpenWatcom C/C++
ECHO. ---------------------------------
@CALL winmake\mdir.bat howto
goto EXIT
rem=============================================================================
:CLEAN
rem=============================================================================
@CALL winmake\mdir.bat clean
IF "%2"=="BUILD" goto BUILD_ALL
IF "%2"=="build" goto BUILD_ALL
@ECHO ****** End of Job *****
goto EXIT
rem=============================================================================
:EXIT
rem=============================================================================
SET LIB=%_LIB%
SET _LIB=
SET WATCOM=
SET EDPATH=
@CALL winmake\mdir.bat resetenvar