| 1 |
# |
| 2 |
# General Jamrules support file for building Ascend4 |
| 3 |
# (see http://www.freetype.org/jam/index.html) |
| 4 |
# |
| 5 |
# This file is part of the Ascend Build System. |
| 6 |
# |
| 7 |
# Copyright (C) 2005 Jerry D. St.Clair |
| 8 |
# |
| 9 |
# The Ascend Build System is free software; you can redistribute |
| 10 |
# it and/or modify it under the terms of the GNU General Public |
| 11 |
# License as published by the Free Software Foundation; either |
| 12 |
# version 2 of the License, or (at your option) any later version. |
| 13 |
# |
| 14 |
# This program is distributed in hope that it will be useful, |
| 15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 |
# GNU General Public License for more details. |
| 18 |
# |
| 19 |
# You should have received a copy of the GNU General Public License |
| 20 |
# along with the program; if not, write to the Free Software |
| 21 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139 USA. |
| 22 |
# Check the file named COPYING. |
| 23 |
#--------------------------------------------------------------------------- |
| 24 |
# |
| 25 |
# UNDER CONSTRUCTION |
| 26 |
# |
| 27 |
# This is a template Jamrules file which supports building the |
| 28 |
# Ascend libraries and executables. It contains general variable |
| 29 |
# and rule definitions required for execution of jam in any of the |
| 30 |
# source subdirectories. The Ascend jam build system currently |
| 31 |
# supports the MSVC, Borland, MinGW, and Watcom compilers |
| 32 |
# (extension to gcc on Linux is on the TODO: list). |
| 33 |
# |
| 34 |
# This file is not currently customized by the configure mechanism, |
| 35 |
# although this may be implemented in the future. |
| 36 |
# |
| 37 |
# Users should copy/rename this file to 'Jamrules', then modify |
| 38 |
# the settings manually for their particular system. Ascend |
| 39 |
# cannot be built by jam unless the Jamrules file is present. |
| 40 |
# |
| 41 |
# User-customized Jamrules files should not be placed in version |
| 42 |
# control. Only the Jamrules.in template should be versioned. |
| 43 |
# |
| 44 |
#--------------------------------------------------------------------------- |
| 45 |
|
| 46 |
# Comment to compile with debugging & assertions enabled |
| 47 |
NODEBUG = 1 ; |
| 48 |
|
| 49 |
# Comment to compile without using the Epperly malloc debugger |
| 50 |
#DEBUG_MALLOC = -DMALLOC_DEBUG ; |
| 51 |
|
| 52 |
#--------------------------------------------------------------------------- |
| 53 |
# Options from here on should not require routine tweaking |
| 54 |
|
| 55 |
# Tools required for complete build (comment out if not present). |
| 56 |
# The build system works around their absence if necessary. |
| 57 |
# Note that they are available for Windows, for example: |
| 58 |
# http://sourceforge.net/projects/gnuWin32 |
| 59 |
SED = sed ; |
| 60 |
YACC = yacc ; |
| 61 |
YACCFLAGS = -d ; |
| 62 |
YACCFILES = y.tab ; |
| 63 |
LEX = flex ; |
| 64 |
|
| 65 |
#====================================================================== |
| 66 |
# General build options |
| 67 |
#====================================================================== |
| 68 |
# Build directory - - will be qualified for compiler & build type |
| 69 |
BUILD_DIR_ROOT = $(DOT) ; |
| 70 |
|
| 71 |
# Comment for normal jam deletion of object files after building targets |
| 72 |
KEEPOBJS = true ; |
| 73 |
|
| 74 |
# platform-independent options |
| 75 |
# sizeof(void*) - change value if not a typical 32-bit system |
| 76 |
SIZEOF_VOIDPTR = 4 ; |
| 77 |
|
| 78 |
CCFLAGS += -DTHIS_IS_AN_UNUSED_FUNCTION -DSIZEOF_VOID_P=$(SIZEOF_VOIDPTR) ; |
| 79 |
|
| 80 |
if $(NODEBUG) |
| 81 |
{ |
| 82 |
CCFLAGS += -DNDEBUG ; |
| 83 |
BUILD_SUBDIR = $(SLASH)Release ; |
| 84 |
} |
| 85 |
else |
| 86 |
{ |
| 87 |
BUILD_SUBDIR = $(SLASH)Debug ; |
| 88 |
} |
| 89 |
|
| 90 |
# platform- & complier-specific options |
| 91 |
if $(NT) |
| 92 |
{ |
| 93 |
# Windows-specific defines |
| 94 |
CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 -DASC_BUILD_LIB -D$(HAVE_PACKAGES) ; |
| 95 |
SUFSHR = .dll ; |
| 96 |
|
| 97 |
if $(BCCROOT) || ( $(TOOLSET) = BORLANDC ) |
| 98 |
{ |
| 99 |
FORTRAN = ; |
| 100 |
CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ; |
| 101 |
CCWARN = -w ; |
| 102 |
if $(NODEBUG) |
| 103 |
{ |
| 104 |
CCDEBUG = -v- -O2 ; |
| 105 |
} |
| 106 |
else |
| 107 |
{ |
| 108 |
CCDEBUG = -v -y -Od ; |
| 109 |
} |
| 110 |
C++FLAGS = $(CCFLAGS) ; |
| 111 |
COFF2OMF = coff2omf ; # add location if not in path |
| 112 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ; |
| 113 |
} |
| 114 |
|
| 115 |
else if $(MSVCNT) || ( $(TOOLSET) = VISUALC ) |
| 116 |
{ |
| 117 |
FORTRAN = ; |
| 118 |
CCFLAGS += /Ze ; |
| 119 |
CCWARN = /W4 ; |
| 120 |
if $(NODEBUG) |
| 121 |
{ |
| 122 |
CCDEBUG = /O2 ; |
| 123 |
} |
| 124 |
else |
| 125 |
{ |
| 126 |
CCDEBUG = /Zi /Od ; |
| 127 |
} |
| 128 |
# Libraries are in different paths depending on VC version |
| 129 |
LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ; |
| 130 |
LINKLIBS = advapi32.lib |
| 131 |
libc.lib |
| 132 |
oldnames.lib |
| 133 |
gdi32.lib |
| 134 |
user32.lib |
| 135 |
kernel32.lib ; |
| 136 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ; |
| 137 |
} |
| 138 |
|
| 139 |
else if $(MINGW) || ( $(TOOLSET) = MINGW ) |
| 140 |
{ |
| 141 |
FORTRANFLAGS = -c -I4 -O ; |
| 142 |
F77_LIBS += $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ; |
| 143 |
|
| 144 |
CCFLAGS += -DHAVE_ERF=1 ; |
| 145 |
# uncomment to select desired warning level and ansi-strictness |
| 146 |
CCWARN += -Wall ; |
| 147 |
CCWARN += -W ; |
| 148 |
CCWARN += -pedantic ; |
| 149 |
#CCWARN += -Wshadow ; |
| 150 |
#CCWARN += -ansi ; |
| 151 |
|
| 152 |
if $(NODEBUG) |
| 153 |
{ |
| 154 |
CCDEBUG = -O3 ; |
| 155 |
} |
| 156 |
else |
| 157 |
{ |
| 158 |
CCDEBUG = -g -O0 ; |
| 159 |
} |
| 160 |
C++FLAGS = $(CCFLAGS) ; |
| 161 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ; |
| 162 |
} |
| 163 |
|
| 164 |
else if $(WATCOM) || ( $(TOOLSET) = WATCOM ) |
| 165 |
{ |
| 166 |
FORTRANFLAGS = /NOER ; |
| 167 |
CCFLAGS += /fr /dMOD_ASCMALLOC ; |
| 168 |
CCWARN = /wx ; |
| 169 |
if $(NODEBUG) |
| 170 |
{ |
| 171 |
CCDEBUG = /ox ; |
| 172 |
FORTRANFLAGS += /OX ; |
| 173 |
} |
| 174 |
else |
| 175 |
{ |
| 176 |
CCDEBUG = /od /d2 ; |
| 177 |
FORTRANFLAGS += /OD /D2 ; |
| 178 |
} |
| 179 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ; |
| 180 |
} |
| 181 |
} |
| 182 |
|
| 183 |
else if $(OS) = LINUX |
| 184 |
{ |
| 185 |
SUFSHR = .so ; |
| 186 |
CCFLAGS += -D$(HAVE_PACKAGES) ; |
| 187 |
FORTRANFLAGS = -c -I4 -O -lg2c ; |
| 188 |
|
| 189 |
# uncomment to select desired warning level and ansi-strictness |
| 190 |
CCWARN += -Wall ; |
| 191 |
CCWARN += -W ; |
| 192 |
CCWARN += -pedantic ; |
| 193 |
#CCWARN += -Wshadow ; |
| 194 |
#CCWARN += -ansi ; |
| 195 |
|
| 196 |
if $(NODEBUG) |
| 197 |
{ |
| 198 |
CCDEBUG = -O3 ; |
| 199 |
} |
| 200 |
else |
| 201 |
{ |
| 202 |
CCDEBUG = -g -O0 ; |
| 203 |
} |
| 204 |
BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ; |
| 205 |
} |
| 206 |
|
| 207 |
CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ; |
| 208 |
C++FLAGS = $(CCFLAGS) ; |
| 209 |
BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ; |
| 210 |
|
| 211 |
#====================================================================== |
| 212 |
# Ascend base library names & paths |
| 213 |
#====================================================================== |
| 214 |
ASC_COMPILER_LIBROOT = libasc_compiler ; |
| 215 |
ASC_GENERAL_LIBROOT = libasc_general ; |
| 216 |
ASC_SOLVER_LIBROOT = libasc_solver ; |
| 217 |
ASC_UTILITIES_LIBROOT = libasc_utilities ; |
| 218 |
ASC_PACKAGES_LIBROOT = libasc_packages ; |
| 219 |
|
| 220 |
ASC_COMPILER_LIB = $(ASC_COMPILER_LIBROOT)$(SUFLIB) ; |
| 221 |
ASC_GENERAL_LIB = $(ASC_GENERAL_LIBROOT)$(SUFLIB) ; |
| 222 |
ASC_SOLVER_LIB = $(ASC_SOLVER_LIBROOT)$(SUFLIB) ; |
| 223 |
ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBROOT)$(SUFLIB) ; |
| 224 |
ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBROOT)$(SUFLIB) ; |
| 225 |
|
| 226 |
ASC_BASE_LIBS = |
| 227 |
$(ASC_COMPILER_LIB) |
| 228 |
$(ASC_GENERAL_LIB) |
| 229 |
$(ASC_SOLVER_LIB) |
| 230 |
$(ASC_PACKAGES_LIB) |
| 231 |
$(ASC_UTILITIES_LIB) |
| 232 |
; |
| 233 |
|
| 234 |
ASC_BASE_SOURCE_RELPATH = ..$(SLASH)base$(SLASH)generic ; |
| 235 |
ASC_BASE_LIBS_RELPATH = ..$(SLASH)base$(SLASH)jam$(SLASH)$(BUILD_DIR)$(SLASH) ; |
| 236 |
|
| 237 |
#====================================================================== |
| 238 |
# PACKAGES |
| 239 |
# |
| 240 |
# Package settings for building Ascend. |
| 241 |
# Packages are bits of compiled code that represent models, or solvers, |
| 242 |
# or, in general, any bits of external code. |
| 243 |
# |
| 244 |
# Choose one of the following, comment out the others: |
| 245 |
# STATIC_PACKAGES packages should be statically linked/loaded |
| 246 |
# DYNAMIC_PACKAGES packages should be dynamically linked/loaded |
| 247 |
# NO_PACKAGES no packages |
| 248 |
# |
| 249 |
# If STATIC_PACKAGES are chosen, also indicate the location of |
| 250 |
# the packages in PACK_LIBS. Otherwise leave PACK_LIBS empty. |
| 251 |
#====================================================================== |
| 252 |
HAVE_PACKAGES = STATIC_PACKAGES ; |
| 253 |
#HAVE_PACKAGES = DYNAMIC_PACKAGES ; |
| 254 |
#HAVE_PACKAGES = NO_PACKAGES ; |
| 255 |
|
| 256 |
PACK_LIBS = $(ASC_PACKAGES_LIB_PATH) ; |
| 257 |
#PACK_LIBS = ; |
| 258 |
|
| 259 |
#====================================================================== |
| 260 |
# SOLVERS / INTEGRATORS |
| 261 |
# |
| 262 |
# If you are linking to MINOS or other external solvers, the solver |
| 263 |
# interface needs to know about it. |
| 264 |
# Set the comment flags as appropriate on the following definitions. |
| 265 |
# If the settings here do not match the libraries you link, you will |
| 266 |
# almost certainly get runtime errors if not link errors. |
| 267 |
#====================================================================== |
| 268 |
|
| 269 |
# >>>> UNDER CONSTRUCTION <<<< |
| 270 |
|
| 271 |
# to build with slv, uncomment the next line |
| 272 |
#SOLVER_DEFS += -DSTATIC_SLV ; |
| 273 |
|
| 274 |
# to build with optsqp, uncomment the next line |
| 275 |
#SOLVER_DEFS += -DSTATIC_OPTSQP ; |
| 276 |
|
| 277 |
# to build with qrslv, uncomment the next line |
| 278 |
SOLVER_DEFS += -DSTATIC_QRSLV ; |
| 279 |
|
| 280 |
# to build with mps, uncomment the next line |
| 281 |
#SOLVER_DEFS += -DSTATIC_MPS ; |
| 282 |
|
| 283 |
# to build with ngslv, uncomment the next line |
| 284 |
#SOLVER_DEFS += -DSTATIC_NGSLV ; |
| 285 |
|
| 286 |
# to build with cmslv (requires CONOPT), uncomment the next line |
| 287 |
#SOLVER_DEFS += -DSTATIC_CMSLV ; |
| 288 |
|
| 289 |
# to build with lrslv, uncomment the next line |
| 290 |
#SOLVER_DEFS += -DSTATIC_LRSLV ; |
| 291 |
|
| 292 |
# the configure script sets the following depending on its search for minos. |
| 293 |
# to force a build WITHOUT minos, comment the next line |
| 294 |
#SOLVER_DEFS += -DSTATIC_MINOS ; |
| 295 |
# |
| 296 |
# Name & path to the minos library |
| 297 |
#MINOSLIB = ; |
| 298 |
#MINOSLIB_RELPATH = ; |
| 299 |
|
| 300 |
# TODO the configure script sets the following depending on its search for conopt. |
| 301 |
# to force a build WITHOUT conopt, comment the next line |
| 302 |
#SOLVER_DEFS += -DSTATIC_CONOPT ; |
| 303 |
# |
| 304 |
# Path to the conopt library |
| 305 |
#CONOPTLIB = ; |
| 306 |
#CONOPTLIB_RELPATH = ; |
| 307 |
|
| 308 |
# TODO the configure script sets the following depending on its search for lsode. |
| 309 |
# Choose one of the following to build with lsode, comment both to build WITHOUT lsode |
| 310 |
SOLVER_DEFS += -DSTATIC_LSOD ; |
| 311 |
#SOLVER_DEFS += -DDYNAMIC_LSOD ; |
| 312 |
# |
| 313 |
# Name & path to the lsode library. Comment out if not using lsode. |
| 314 |
ASC_LSOD_LIBROOT = liblsode ; |
| 315 |
ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ; |
| 316 |
LSODLIB_RELPATH = ..$(SLASH)lsod$(SLASH)jam$(SLASH)$(BUILD_DIR) ; |
| 317 |
LSODLIB = $(ASC_LSOD_LIB) ; |
| 318 |
|
| 319 |
#====================================================================== |
| 320 |
# FORTRAN options - set to override compiler defaults |
| 321 |
#====================================================================== |
| 322 |
# Your FORTRAN compiler |
| 323 |
#FORTRAN = g77 ; |
| 324 |
|
| 325 |
# Fortran compilation flags & options: |
| 326 |
# These are used for making the ASCEND libraries based on FORTRAN codes. |
| 327 |
# These should be set to get the best performance possible out of your |
| 328 |
# f77 compiler without optimizing away functions that are not obviously |
| 329 |
# called, as some compilers do by default. |
| 330 |
# |
| 331 |
#FORTRANFLAGS = -c -I4 -O -lg2c ; |
| 332 |
|
| 333 |
# F77LIBS is for the base f77 libraries. If you are linking no f77 |
| 334 |
# objects to ascend, it may be left undefined. |
| 335 |
# Set F77LIBS appropriate for your machine and desired loader behavior. |
| 336 |
# |
| 337 |
#F77_LIBS = ; |
| 338 |
|
| 339 |
#====================================================================== |
| 340 |
# FORTRAN Support Libraries |
| 341 |
# |
| 342 |
# Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK |
| 343 |
# libraries (if you have them) to get the best speed out of ASCEND. |
| 344 |
# Otherwise, generic versions can be built if FORTRAN is available. |
| 345 |
#====================================================================== |
| 346 |
|
| 347 |
# Name & path to the blas library |
| 348 |
ASC_BLAS_LIBROOT = libblas ; |
| 349 |
ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ; |
| 350 |
BLASLIB_RELPATH = ..$(SLASH)blas$(SLASH)jam$(SLASH)$(BUILD_DIR) ; |
| 351 |
BLASLIB = $(ASC_BLAS_LIB) ; |
| 352 |
|
| 353 |
# Name & path to the linpack library |
| 354 |
ASC_LINPACK_LIBROOT = liblpak ; |
| 355 |
ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ; |
| 356 |
LPAKLIB_RELPATH = ..$(SLASH)linpack$(SLASH)jam$(SLASH)$(BUILD_DIR) ; |
| 357 |
LPAKLIB = $(ASC_LINPACK_LIB) ; |
| 358 |
|
| 359 |
#====================================================================== |
| 360 |
# Ascend-specific jam instructions |
| 361 |
#====================================================================== |
| 362 |
|
| 363 |
#---------------------------------------------------------------------- |
| 364 |
# LEX_or_copy |
| 365 |
# |
| 366 |
# Generates a c source file using the lexer defined by $(LEX), |
| 367 |
# or by copying a specified file if $(LEX) is not defined. |
| 368 |
# The following parameters are used: |
| 369 |
# |
| 370 |
# 1 source file to generate |
| 371 |
# 2 lex/flex definition file |
| 372 |
# 3 pre-generated source file to copy if $(LEX) is empty |
| 373 |
# 4 header file associated with the source file, if any |
| 374 |
#---------------------------------------------------------------------- |
| 375 |
rule LEX_or_copy |
| 376 |
{ |
| 377 |
if $(LEX) |
| 378 |
{ |
| 379 |
Echo Generating $(1) from $(LEX) ; |
| 380 |
DEPENDS $(1) : $(2) ; |
| 381 |
Lex_with_options $(1) : $(2) ; |
| 382 |
} |
| 383 |
else |
| 384 |
{ |
| 385 |
Echo Copying $(1) from $(4) ; |
| 386 |
File $(1) : $(3) ; |
| 387 |
} |
| 388 |
|
| 389 |
# make the header dependent |
| 390 |
if $(4) |
| 391 |
{ |
| 392 |
INCLUDES $(1) : $(4) ; |
| 393 |
} |
| 394 |
|
| 395 |
Clean clean : $(1) ; |
| 396 |
} |
| 397 |
|
| 398 |
# run LEX using options specified in LEXOPTS |
| 399 |
actions Lex_with_options |
| 400 |
{ |
| 401 |
$(LEX) $(LEXOPTS) -o$(1) $(2) |
| 402 |
} |