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