-
Notifications
You must be signed in to change notification settings - Fork 18
/
make_xc.bat
214 lines (189 loc) · 6.75 KB
/
make_xc.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
@echo off
rem ============================================================================
rem
rem $Id$
rem
rem FILE: make_xc.bat
rem BATCH FILE FOR XCC
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 __MAKE__=D:\VC9\BIN\NMAKE.EXE
REM NOTE: POMAKE 6.50 is buggy. In this case, please use NMAKE.EXE of MSVC.
REM NOTE: POMAKE 7.00 is working fine
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=
REM SET CC_DIR=..\XCC
REM Must set because using makefile.pc
SET __COMP__=__XCC__
IF "%__MAKE__%" == "" SET __MAKE__=POMAKE
IF "%SUB_DIR%" == "" SET SUB_DIR=xc
IF "%HB_GT_LIB%" == "" SET HB_GT_LIB=$(GTWIN_LIB)
IF NOT "%CC_DIR%"=="" GOTO FIND_BISON
:FIND_BISON
IF NOT "%BISON_DIR%"=="" GOTO READY
IF EXIST "%ProgramFiles%\GnuWin32\Bin" GOTO SET_BISON1
IF EXIST \GnuWin32\Bin GOTO SET_BISON2
GOTO READY
:SET_BISON1
SET BISON_DIR=%ProgramFiles%\GnuWin32\Bin
GOTO READY
:SET_BISON2
SET BISON_DIR=\GnuWin32\Bin
GOTO READY
:READY
SET _PATH=%PATH%
SET PATH=%CC_DIR%\BIN;%BISON_DIR%;%PATH%
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
%__MAKE__% /F winmake\makefile.pc >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
%__MAKE__% /F winmake\makefile.pc >>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 __MT__=
SET HB_MT_DIR=\dll
@CALL winmake\mdir.bat dllcreate
%__MAKE__% /F winmake\makefile.pc >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 __MT__=
SET HB_MT_DIR=
@CALL winmake\mdir.bat
%__MAKE__% /F winmake\makefile.pc >cont_%SUB_DIR%.log
if errorlevel 1 goto CONTRIBS_ERR
goto CONTRIBS_OK
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 PellesC
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 HB_MT=
@CALL winmake\mdir.bat resetenvar