| 1 |
# |
| 2 |
# Jamrules file to build CUnit - Root Directory |
| 3 |
# (see http://www.freetype.org/jam/index.html) |
| 4 |
# |
| 5 |
# Copyright (C) 2004-2006 Jerry St.Clair |
| 6 |
# |
| 7 |
# This library is free software; you can redistribute it and/or |
| 8 |
# modify it under the terms of the GNU Library General Public |
| 9 |
# License as published by the Free Software Foundation; either |
| 10 |
# version 2 of the License, or (at your option) any later version. |
| 11 |
# |
| 12 |
# This library is distributed in the hope that it will be useful, |
| 13 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
# Library General Public License for more details. |
| 16 |
# |
| 17 |
# You should have received a copy of the GNU Library General Public |
| 18 |
# License along with this library; if not, write to the Free Software |
| 19 |
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 |
#--------------------------------------------------------------------------- |
| 21 |
|
| 22 |
# On Linux, basic build options are set by configure. |
| 23 |
# See else clause below for other platforms. |
| 24 |
if $(OS) = LINUX || $(UNIX) |
| 25 |
{ |
| 26 |
SLASH = / ; |
| 27 |
VERSION = 2.1 ; |
| 28 |
RELEASE = 3 ; |
| 29 |
VERSION_MAJOR = 2 ; |
| 30 |
VERSION_MINOR = 1 ; |
| 31 |
|
| 32 |
# root of install path |
| 33 |
prefix = /Users/aks/CUnitHome ; |
| 34 |
|
| 35 |
# choice of interfaces to build into library |
| 36 |
if TRUE = TRUE |
| 37 |
{ BUILD_AUTOMATED = 1 ; } |
| 38 |
if TRUE = TRUE |
| 39 |
{ BUILD_BASIC = 1 ; } |
| 40 |
if TRUE = TRUE |
| 41 |
{ BUILD_CONSOLE = 1 ; } |
| 42 |
if FALSE != FALSE |
| 43 |
{ |
| 44 |
BUILD_CURSES = 1 ; |
| 45 |
SYS_LIBS = -l ; |
| 46 |
} |
| 47 |
# BUILD_WINDOWS = 1 ; |
| 48 |
|
| 49 |
# choice of whether to build examples |
| 50 |
if TRUE = TRUE |
| 51 |
{ BUILD_EXAMPLES = 1 ; } |
| 52 |
|
| 53 |
# choice of whether to build test program |
| 54 |
if TRUE = TRUE |
| 55 |
{ BUILD_TEST = 1 ; } |
| 56 |
|
| 57 |
# choice of whether to build shared library |
| 58 |
if @ENABLE_SHARED@ = TRUE |
| 59 |
{ BUILD_SHARED_LIB = 1 ; } |
| 60 |
|
| 61 |
# choice of whether to build static library |
| 62 |
if @ENABLE_STATIC@ = TRUE |
| 63 |
{ BUILD_STATIC_LIB = 1 ; } |
| 64 |
|
| 65 |
# debug compilation mode |
| 66 |
if TRUE = FALSE |
| 67 |
{ NODEBUG = 1 ; } |
| 68 |
|
| 69 |
# Use memory tracing |
| 70 |
if TRUE = TRUE |
| 71 |
{ USE_MEMTRACE = -DMEMTRACE ; } |
| 72 |
|
| 73 |
# Recognize deprecated version 1.1 function names and build V1.1 examples |
| 74 |
if FALSE = TRUE |
| 75 |
{ USE_DEPRECATED_NAMES = -DUSE_DEPRECATED_CUNIT_NAMES ; } |
| 76 |
} |
| 77 |
|
| 78 |
# On other platforms, comment out the option to disable it |
| 79 |
else |
| 80 |
{ |
| 81 |
SLASH = \\ ; |
| 82 |
|
| 83 |
# Version number set manually so may be out-of-date |
| 84 |
VERSION = 2.1 ; |
| 85 |
RELEASE = 0 ; |
| 86 |
VERSION_MAJOR = 2 ; |
| 87 |
VERSION_MINOR = 1 ; |
| 88 |
|
| 89 |
# Set the root of install path |
| 90 |
prefix = c:\\dev\\CUnit_install ; |
| 91 |
|
| 92 |
# Comment to not include interface in library |
| 93 |
BUILD_AUTOMATED = 1 ; |
| 94 |
BUILD_BASIC = 1 ; |
| 95 |
BUILD_CONSOLE = 1 ; |
| 96 |
# BUILD_CURSES = 1 ; |
| 97 |
BUILD_WINDOWS = 1 ; |
| 98 |
|
| 99 |
# Comment to not build examples |
| 100 |
BUILD_EXAMPLES = 1 ; |
| 101 |
|
| 102 |
# Comment to not build test program |
| 103 |
BUILD_TEST = 1 ; |
| 104 |
|
| 105 |
# Comment to not build CUnit shared library |
| 106 |
BUILD_SHARED_LIB = 1 ; |
| 107 |
|
| 108 |
# Comment to not build CUnit static library |
| 109 |
BUILD_STATIC_LIB = 1 ; |
| 110 |
|
| 111 |
# Comment to compile with debugging & assertions enabled |
| 112 |
NODEBUG = 1 ; |
| 113 |
|
| 114 |
# Uncomment to perform memory tracing |
| 115 |
#USE_MEMTRACE = -DMEMTRACE ; |
| 116 |
|
| 117 |
# Uncomment to recognize deprecated version 1.1 function names |
| 118 |
# and build V1.1 examples |
| 119 |
#USE_DEPRECATED_NAMES = -DUSE_DEPRECATED_CUNIT_NAMES ; |
| 120 |
} |
| 121 |
|
| 122 |
#--------------------------------------------------------------------------- |
| 123 |
# Options from here on should not require routine tweaking |
| 124 |
|
| 125 |
PACKAGE = CUnit ; |
| 126 |
|
| 127 |
# Install locations - comment out to not install that class of file |
| 128 |
INSTALL_BIN_DIR = $(prefix)$(SLASH)bin ; |
| 129 |
INSTALL_LIB_DIR = $(prefix)$(SLASH)lib ; |
| 130 |
INSTALL_INC_DIR = $(prefix)$(SLASH)include$(SLASH)CUnit ; |
| 131 |
INSTALL_DOC_DIR = $(prefix)$(SLASH)doc$(SLASH)CUnit ; |
| 132 |
INSTALL_MAN_DIR = $(prefix)$(SLASH)man ; |
| 133 |
INSTALL_SHARE_DIR = $(prefix)$(SLASH)share$(SLASH)CUnit ; |
| 134 |
#INSTALL_EXAM_DIR = $(prefix)$(SLASH)share$(SLASH)CUnit$(SLASH)Examples ; |
| 135 |
#INSTALL_TEST_DIR = $(prefix)$(SLASH)share$(SLASH)CUnit$(SLASH)Test ; |
| 136 |
|
| 137 |
# Build directory - - will be qualified for compiler & build type |
| 138 |
BUILD_DIR_ROOT = $(TOP) ; |
| 139 |
|
| 140 |
EXAMPLES_DIR = $(TOP)$(SLASH)Examples ; |
| 141 |
|
| 142 |
CUNIT_HDR_DIR = $(TOP)$(SLASH)CUnit$(SLASH)Headers ; |
| 143 |
CUNIT_LIB_NAME = libcunit ; |
| 144 |
|
| 145 |
# Comment for normal jam deletion of object files after building targets |
| 146 |
KEEPOBJS = true ; |
| 147 |
|
| 148 |
if $(NODEBUG) |
| 149 |
{ |
| 150 |
CCFLAGS += -DNDEBUG ; |
| 151 |
BUILD_SUBDIR = $(SLASH)Release ; |
| 152 |
} |
| 153 |
else |
| 154 |
{ |
| 155 |
BUILD_SUBDIR = $(SLASH)Debug ; |
| 156 |
} |
| 157 |
|
| 158 |
if $(NT) |
| 159 |
{ |
| 160 |
# variables not set properly for Windows/Win9x in Jambase 2.3 |
| 161 |
RM = del ; |
| 162 |
MV = move /Y ; |
| 163 |
|
| 164 |
SUFSHR = .dll ; |
| 165 |
|
| 166 |
# Windows-specific defines |
| 167 |
CCFLAGS = -DWIN32 -D_LIB -D_MBCS -D_DELAYTEST ; |
| 168 |
CUNIT_WIN_DIR = $(TOP)$(SLASH)CUnit$(SLASH)Sources$(SLASH)Win ; |
| 169 |
|
| 170 |
if $(BCCROOT) || ( $(TOOLSET) = BORLANDC ) |
| 171 |
{ |
| 172 |
CCFLAGS += -q -d -g0 -j0 ; |
| 173 |
CCWARN = -w -w-8004 ; |
| 174 |
if $(NODEBUG) |
| 175 |
{ |
| 176 |
CCDEBUG = -v- -O2 ; |
| 177 |
} |
| 178 |
else |
| 179 |
{ |
| 180 |
CCDEBUG = -v -y -Od ; |
| 181 |
} |
| 182 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ; |
| 183 |
} |
| 184 |
|
| 185 |
else if $(MSVCNT) || ( $(TOOLSET) = VISUALC ) |
| 186 |
{ |
| 187 |
CCFLAGS += /Ze ; |
| 188 |
CCWARN = /W4 ; |
| 189 |
if $(NODEBUG) |
| 190 |
{ |
| 191 |
CCDEBUG = /O2 ; |
| 192 |
} |
| 193 |
else |
| 194 |
{ |
| 195 |
CCDEBUG = /Zi /Od ; |
| 196 |
} |
| 197 |
# Libraries are in different paths depending on VC version |
| 198 |
LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ; |
| 199 |
LINKLIBS = advapi32.lib |
| 200 |
libc.lib |
| 201 |
oldnames.lib |
| 202 |
gdi32.lib |
| 203 |
user32.lib |
| 204 |
kernel32.lib ; |
| 205 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ; |
| 206 |
} |
| 207 |
|
| 208 |
|
| 209 |
else if $(MINGW) || ( $(TOOLSET) = MINGW ) |
| 210 |
{ |
| 211 |
# uncomment to select desired warning level and ansi-strictness |
| 212 |
CCWARN += -Wall ; |
| 213 |
CCWARN += -W ; |
| 214 |
CCWARN += -pedantic ; |
| 215 |
CCWARN += -Wshadow ; |
| 216 |
CCWARN += -ansi ; |
| 217 |
|
| 218 |
if $(NODEBUG) |
| 219 |
{ |
| 220 |
CCDEBUG = -O3 ; |
| 221 |
} |
| 222 |
else |
| 223 |
{ |
| 224 |
CCDEBUG = -g -O0 ; |
| 225 |
} |
| 226 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ; |
| 227 |
} |
| 228 |
|
| 229 |
else if $(WATCOM) || ( $(TOOLSET) = WATCOM ) |
| 230 |
{ |
| 231 |
CCFLAGS += /fr ; |
| 232 |
CCWARN = /wx ; |
| 233 |
if $(NODEBUG) |
| 234 |
{ |
| 235 |
CCDEBUG = /ox ; |
| 236 |
} |
| 237 |
else |
| 238 |
{ |
| 239 |
CCDEBUG = /od /d2 ; |
| 240 |
} |
| 241 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ; |
| 242 |
} |
| 243 |
} |
| 244 |
|
| 245 |
else if $(OS) = LINUX |
| 246 |
{ |
| 247 |
SUFSHR = .so ; |
| 248 |
|
| 249 |
# uncomment to select desired warning level and ansi-strictness |
| 250 |
CCWARN += -Wall ; |
| 251 |
CCWARN += -W ; |
| 252 |
CCWARN += -pedantic ; |
| 253 |
CCWARN += -Wshadow ; |
| 254 |
CCWARN += -ansi ; |
| 255 |
|
| 256 |
if $(NODEBUG) |
| 257 |
{ |
| 258 |
CCDEBUG = -O3 ; |
| 259 |
} |
| 260 |
else |
| 261 |
{ |
| 262 |
CCDEBUG = -g -O0 ; |
| 263 |
} |
| 264 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ; |
| 265 |
} |
| 266 |
|
| 267 |
CCFLAGS += $(USE_MEMTRACE) $(CCWARN) $(CCDEBUG) ; |
| 268 |
C++FLAGS += $(CCFLAGS) ; |
| 269 |
BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ; |
| 270 |
|
| 271 |
#---------------------------------------------------------------------- |
| 272 |
# CUnit-specific rules & actions |
| 273 |
#---------------------------------------------------------------------- |
| 274 |
# If anyone can figure out a better way, good for you |
| 275 |
# (and let me (jds) know)! Here's the problem... |
| 276 |
# The built-in Jam install rules all convert the grist of |
| 277 |
# the source file to (:G=installed). As a result, they |
| 278 |
# seem unable to handle files having the same name in |
| 279 |
# different directories. If we want to install such files |
| 280 |
# as the Jamfile's or Makefile.am's or README's, the built-ins |
| 281 |
# can't handle it (in my hands, anyway). As a workaround, |
| 282 |
# we define a new rule which does not monkey with the grist |
| 283 |
# in this way. Duplicate file names will need to explicitly |
| 284 |
# use grist so Jam knows the difference, but the standard |
| 285 |
# <$(SOURCE_GRIST)> works in most cases. |
| 286 |
# |
| 287 |
rule DoInstallCUnitFile |
| 288 |
{ |
| 289 |
local i t ; |
| 290 |
|
| 291 |
t = $(>:D=$(<)) ; |
| 292 |
|
| 293 |
DEPENDS install : $(t) ; |
| 294 |
DEPENDS $(t) : $(>) ; |
| 295 |
SEARCH on $(>) = $(SEARCH_SOURCE) ; |
| 296 |
MakeLocate $(t) : $(<) ; |
| 297 |
|
| 298 |
# Arrange for jam uninstall |
| 299 |
|
| 300 |
Clean uninstall : $(t) ; |
| 301 |
|
| 302 |
for i in $(>) |
| 303 |
{ |
| 304 |
Install $(i:D=$(<)) : $(i) ; |
| 305 |
Chmod $(i:D=$(<)) ; |
| 306 |
} |
| 307 |
|
| 308 |
if $(UNIX) |
| 309 |
{ |
| 310 |
if $(OWNER) { Chown $(t) ; OWNER on $(t) = $(OWNER) ; } |
| 311 |
if $(GROUP) { Chgrp $(t) ; GROUP on $(t) = $(GROUP) ; } |
| 312 |
} |
| 313 |
} |
| 314 |
|
| 315 |
rule InstallCUnitBin |
| 316 |
{ |
| 317 |
DoInstallCUnitFile $(<) : $(>) ; |
| 318 |
MODE on $(>:D=$(<)) = $(EXEMODE) ; |
| 319 |
} |
| 320 |
|
| 321 |
rule InstallCUnitFile |
| 322 |
{ |
| 323 |
DoInstallCUnitFile $(<) : $(>) ; |
| 324 |
MODE on $(>:D=$(<)) = $(FILEMODE) ; |
| 325 |
} |
| 326 |
|
| 327 |
#---------------------------------------------------------- |
| 328 |
# MakeImportLibrary |
| 329 |
# |
| 330 |
# This is a dummy rule. Import libraries are built in |
| 331 |
# the dll linking directive. However, jam doesn't know |
| 332 |
# that, so we provide a rule which does nothing more |
| 333 |
# than define a dependency. |
| 334 |
# |
| 335 |
# Parameters: |
| 336 |
# |
| 337 |
# 1 - name of the dll |
| 338 |
# 2 - name of the import library |
| 339 |
#---------------------------------------------------------- |
| 340 |
rule MakeImportLibrary |
| 341 |
{ |
| 342 |
DEPENDS $(>) : $(<) ; |
| 343 |
LOCATE on $(>) = $(BUILD_DIR) ; |
| 344 |
} |
| 345 |
|