-
Notifications
You must be signed in to change notification settings - Fork 12
/
Jamrules.in
345 lines (292 loc) · 8.56 KB
/
Jamrules.in
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#
# Jamrules file to build BCUnit - Root Directory
# (see http://www.freetype.org/jam/index.html)
#
# Copyright (C) 2004-2006 Jerry St.Clair
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#---------------------------------------------------------------------------
# On Linux, basic build options are set by configure.
# See else clause below for other platforms.
if $(OS) = LINUX || $(UNIX)
{
SLASH = / ;
VERSION = @VERSION@ ;
RELEASE = @RELEASE@ ;
VERSION_MAJOR = @VERSION_MAJOR@ ;
VERSION_MINOR = @VERSION_MINOR@ ;
# root of install path
prefix = @prefix@ ;
# choice of interfaces to build into library
if @BUILD_AUTOMATED@ = TRUE
{ BUILD_AUTOMATED = 1 ; }
if @BUILD_BASIC@ = TRUE
{ BUILD_BASIC = 1 ; }
if @BUILD_CONSOLE@ = TRUE
{ BUILD_CONSOLE = 1 ; }
if @BUILD_CURSES@ != FALSE
{
BUILD_CURSES = 1 ;
SYS_LIBS = -l@CURSES_LIB@ ;
}
# BUILD_WINDOWS = 1 ;
# choice of whether to build examples
if @BUILD_EXAMPLES@ = TRUE
{ BUILD_EXAMPLES = 1 ; }
# choice of whether to build test program
if @BUILD_TEST@ = TRUE
{ BUILD_TEST = 1 ; }
# choice of whether to build shared library
if @ENABLE_SHARED@ = TRUE
{ BUILD_SHARED_LIB = 1 ; }
# choice of whether to build static library
if @ENABLE_STATIC@ = TRUE
{ BUILD_STATIC_LIB = 1 ; }
# debug compilation mode
if @ENABLE_DEBUG@ = FALSE
{ NODEBUG = 1 ; }
# Use memory tracing
if @ENABLE_MEMTRACE@ = TRUE
{ USE_MEMTRACE = -DMEMTRACE ; }
# Recognize deprecated version 1.1 function names and build V1.1 examples
if @ENABLE_DEPRECATED@ = TRUE
{ USE_DEPRECATED_NAMES = -DUSE_DEPRECATED_BCUNIT_NAMES ; }
}
# On other platforms, comment out the option to disable it
else
{
SLASH = \\ ;
# Version number set manually so may be out-of-date
VERSION = 2.1 ;
RELEASE = 0 ;
VERSION_MAJOR = 2 ;
VERSION_MINOR = 1 ;
# Set the root of install path
prefix = c:\\dev\\BCUnit_install ;
# Comment to not include interface in library
BUILD_AUTOMATED = 1 ;
BUILD_BASIC = 1 ;
BUILD_CONSOLE = 1 ;
# BUILD_CURSES = 1 ;
BUILD_WINDOWS = 1 ;
# Comment to not build examples
BUILD_EXAMPLES = 1 ;
# Comment to not build test program
BUILD_TEST = 1 ;
# Comment to not build BCUnit shared library
BUILD_SHARED_LIB = 1 ;
# Comment to not build BCUnit static library
BUILD_STATIC_LIB = 1 ;
# Comment to compile with debugging & assertions enabled
NODEBUG = 1 ;
# Uncomment to perform memory tracing
#USE_MEMTRACE = -DMEMTRACE ;
# Uncomment to recognize deprecated version 1.1 function names
# and build V1.1 examples
#USE_DEPRECATED_NAMES = -DUSE_DEPRECATED_BCUNIT_NAMES ;
}
#---------------------------------------------------------------------------
# Options from here on should not require routine tweaking
PACKAGE = BCUnit ;
# Install locations - comment out to not install that class of file
INSTALL_BIN_DIR = $(prefix)$(SLASH)bin ;
INSTALL_LIB_DIR = $(prefix)$(SLASH)lib ;
INSTALL_INC_DIR = $(prefix)$(SLASH)include$(SLASH)BCUnit ;
INSTALL_DOC_DIR = $(prefix)$(SLASH)doc$(SLASH)BCUnit ;
INSTALL_MAN_DIR = $(prefix)$(SLASH)man ;
INSTALL_SHARE_DIR = $(prefix)$(SLASH)share$(SLASH)BCUnit ;
#INSTALL_EXAM_DIR = $(prefix)$(SLASH)share$(SLASH)BCUnit$(SLASH)Examples ;
#INSTALL_TEST_DIR = $(prefix)$(SLASH)share$(SLASH)BCUnit$(SLASH)Test ;
# Build directory - - will be qualified for compiler & build type
BUILD_DIR_ROOT = $(TOP) ;
EXAMPLES_DIR = $(TOP)$(SLASH)Examples ;
BCUNIT_HDR_DIR = $(TOP)$(SLASH)BCUnit$(SLASH)Headers ;
BCUNIT_LIB_NAME = libbcunit ;
# Comment for normal jam deletion of object files after building targets
KEEPOBJS = true ;
if $(NODEBUG)
{
CCFLAGS += -DNDEBUG ;
BUILD_SUBDIR = $(SLASH)Release ;
}
else
{
BUILD_SUBDIR = $(SLASH)Debug ;
}
if $(NT)
{
# variables not set properly for Windows/Win9x in Jambase 2.3
RM = del ;
MV = move /Y ;
SUFSHR = .dll ;
# Windows-specific defines
CCFLAGS = -DWIN32 -D_LIB -D_MBCS -D_DELAYTEST ;
BCUNIT_WIN_DIR = $(TOP)$(SLASH)BCUnit$(SLASH)Sources$(SLASH)Win ;
if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
{
CCFLAGS += -q -d -g0 -j0 ;
CCWARN = -w -w-8004 ;
if $(NODEBUG)
{
CCDEBUG = -v- -O2 ;
}
else
{
CCDEBUG = -v -y -Od ;
}
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ;
}
else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
{
CCFLAGS += /Ze ;
CCWARN = /W4 ;
if $(NODEBUG)
{
CCDEBUG = /O2 ;
}
else
{
CCDEBUG = /Zi /Od ;
}
# Libraries are in different paths depending on VC version
LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ;
LINKLIBS = advapi32.lib
libc.lib
oldnames.lib
gdi32.lib
user32.lib
kernel32.lib ;
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ;
}
else if $(MINGW) || ( $(TOOLSET) = MINGW )
{
# uncomment to select desired warning level and ansi-strictness
CCWARN += -Wall ;
CCWARN += -W ;
CCWARN += -pedantic ;
CCWARN += -Wshadow ;
CCWARN += -ansi ;
if $(NODEBUG)
{
CCDEBUG = -O3 ;
}
else
{
CCDEBUG = -g -O0 ;
}
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
}
else if $(WATCOM) || ( $(TOOLSET) = WATCOM )
{
CCFLAGS += /fr ;
CCWARN = /wx ;
if $(NODEBUG)
{
CCDEBUG = /ox ;
}
else
{
CCDEBUG = /od /d2 ;
}
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
}
}
else if $(OS) = LINUX
{
SUFSHR = .so ;
# uncomment to select desired warning level and ansi-strictness
CCWARN += -Wall ;
CCWARN += -W ;
CCWARN += -pedantic ;
CCWARN += -Wshadow ;
CCWARN += -ansi ;
if $(NODEBUG)
{
CCDEBUG = -O3 ;
}
else
{
CCDEBUG = -g -O0 ;
}
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
}
CCFLAGS += $(USE_MEMTRACE) $(CCWARN) $(CCDEBUG) ;
C++FLAGS += $(CCFLAGS) ;
BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
#----------------------------------------------------------------------
# BCUnit-specific rules & actions
#----------------------------------------------------------------------
# If anyone can figure out a better way, good for you
# (and let me (jds) know)! Here's the problem...
# The built-in Jam install rules all convert the grist of
# the source file to (:G=installed). As a result, they
# seem unable to handle files having the same name in
# different directories. If we want to install such files
# as the Jamfile's or Makefile.am's or README's, the built-ins
# can't handle it (in my hands, anyway). As a workaround,
# we define a new rule which does not monkey with the grist
# in this way. Duplicate file names will need to explicitly
# use grist so Jam knows the difference, but the standard
# <$(SOURCE_GRIST)> works in most cases.
#
rule DoInstallBCUnitFile
{
local i t ;
t = $(>:D=$(<)) ;
DEPENDS install : $(t) ;
DEPENDS $(t) : $(>) ;
SEARCH on $(>) = $(SEARCH_SOURCE) ;
MakeLocate $(t) : $(<) ;
# Arrange for jam uninstall
Clean uninstall : $(t) ;
for i in $(>)
{
Install $(i:D=$(<)) : $(i) ;
Chmod $(i:D=$(<)) ;
}
if $(UNIX)
{
if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; }
if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; }
}
}
rule InstallBCUnitBin
{
DoInstallBCUnitFile $(<) : $(>) ;
MODE on $(>:D=$(<)) = $(EXEMODE) ;
}
rule InstallBCUnitFile
{
DoInstallBCUnitFile $(<) : $(>) ;
MODE on $(>:D=$(<)) = $(FILEMODE) ;
}
#----------------------------------------------------------
# MakeImportLibrary
#
# This is a dummy rule. Import libraries are built in
# the dll linking directive. However, jam doesn't know
# that, so we provide a rule which does nothing more
# than define a dependency.
#
# Parameters:
#
# 1 - name of the dll
# 2 - name of the import library
#----------------------------------------------------------
rule MakeImportLibrary
{
DEPENDS $(>) : $(<) ;
LOCATE on $(>) = $(BUILD_DIR) ;
}