/[ascend]/trunk/jam/Jamrules.in
ViewVC logotype

Contents of /trunk/jam/Jamrules.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 216 - (show annotations) (download)
Wed Jan 25 02:12:20 2006 UTC (18 years, 8 months ago) by jds
File size: 18805 byte(s)
Minor rework of jam system to stop relinking of libraries when sources not modified.
Minor tweaks to stem the tide of compiler warnings.
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.
31 #
32 # This file is part of the ASCEND jam build system rooted at ../../jam.
33 # See ../../jam/ReadMe.txt for more information.
34 #
35 # This file is customized on unix/linux by configure.
36 #
37 # On other platforms, users should copy/rename this file to 'Jamrules',
38 # then modify the settings manually for their particular system.
39 # Ascend 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 JAMRULES_ALREADY_SEEN = TRUE ;
47
48 # The slash thing gets messed up sith SubDir somehow - make sure it's correct!
49 SLASH = / ;
50 if $(NT)
51 {
52 SLASH = \\ ;
53 }
54
55 # Comment to compile with debugging & assertions enabled.
56 # Should be commented for regression tests to work properly.
57 #NODEBUG = 1 ;
58
59 # Comment to compile without using the Epperly malloc debugger
60 # Should be UNcommented for regression tests to work properly.
61 DEBUG_MALLOC = -DMALLOC_DEBUG -DALLOCATED_TESTS ;
62
63 #======================================================================
64 # PACKAGES
65 #
66 # Package settings for building Ascend.
67 # Packages are bits of compiled code that represent models, or solvers,
68 # or, in general, any bits of external code.
69 #
70 # Choose one of the following, comment out the others:
71 # STATIC_PACKAGES packages should be statically linked/loaded
72 # DYNAMIC_PACKAGES packages should be dynamically linked/loaded
73 # NO_PACKAGES no packages
74 #
75 # If STATIC_PACKAGES are chosen, also indicate the location of
76 # the packages in PACK_LIBS. Otherwise leave PACK_LIBS empty.
77 #======================================================================
78 #PACKAGE_FLAGS = -DSTATIC_PACKAGES ;
79 PACKAGE_FLAGS = -DDYNAMIC_PACKAGES ;
80 #PACKAGE_FLAGS = -DNO_PACKAGES ;
81
82 PACK_LIBS = $(ASC_PACKAGES_LIB_PATH) ;
83 #PACK_LIBS = ;
84
85 #======================================================================
86 # SIGNAL TRAPS
87 #
88 # If you want to be able to interrupt ASCEND with ctrl-C, then comment the
89 # following line. Uncomment the line for disabling of ctrl-C.
90 #
91 # Comment the line for regression testing to work properly.
92 #======================================================================
93 #CCFLAGS += -DNO_SIGINT_TRAP -DNO_SIGSEGV_TRAP ;
94
95 #---------------------------------------------------------------------------
96
97 # Tools required for complete build (comment out if not present).
98 # The build system works around their absence if necessary.
99 # Note that they are available for Windows, for example:
100 # http://sourceforge.net/projects/gnuWin32
101 SED = sed ;
102 YACC = yacc ;
103 YACCFLAGS = -d ;
104 YACCFILES = y.tab ;
105 LEX = flex ;
106
107 #======================================================================
108 # General build options
109 #======================================================================
110 # Build directory - - will be qualified for compiler & build type
111 BUILD_DIR_ROOT = $(TOP)$(SLASH)jam ;
112
113 # Comment for normal jam deletion of object files after building targets
114 KEEPOBJS = true ;
115
116 #---------------------------------------------------------------------------
117 # platform-independent options
118 #---------------------------------------------------------------------------
119
120 # sizeof(void*) - change value if not a typical 32-bit system
121 # the following are defined by Autoconf, so uncomment if you don't have that:
122 # SIZEOF_VOID_P = 4 ;
123 # CCFLAGS += -DSIZEOF_VOID_P=$(SIZEOF_VOID_P) ;
124
125 CCFLAGS += $(PACKAGE_FLAGS) ;
126
127 if $(NODEBUG)
128 {
129 CCFLAGS += -DNDEBUG ;
130 BUILD_SUBDIR = $(SLASH)Release ;
131 }
132 else
133 {
134 BUILD_SUBDIR = $(SLASH)Debug ;
135 }
136
137 #---------------------------------------------------------------------------
138 # platform- & complier-specific options
139 #---------------------------------------------------------------------------
140 if $(NT)
141 {
142 # Windows-specific commands not done right in Jambase
143 RM = del ;
144 MV = move /Y ;
145
146 # Windows-specific defines
147 CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 -DASC_BUILD_LIB ;
148 SUFSHR = .dll ;
149
150 if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
151 {
152 CC = bcc32 ;
153 C++ = $(CC) ;
154 FORTRAN = ;
155 CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ;
156 CCWARN = -w ;
157 if $(NODEBUG)
158 {
159 CCDEBUG = -v- -O2 ;
160 }
161 else
162 {
163 CCDEBUG = -v -y -Od ;
164 }
165 C++FLAGS = $(CCFLAGS) ;
166 LINKFLAGS += -L$(STDLIBPATH) ;
167 COFF2OMF = coff2omf ; # add location if not in path
168 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ;
169 }
170
171 else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
172 {
173 CC = cl /nologo ;
174 C++ = $(CC) ;
175 FORTRAN = ;
176 CCFLAGS += /Ze ;
177 CCWARN = /W4 ;
178 if $(NODEBUG)
179 {
180 CCDEBUG = /O2 ;
181 }
182 else
183 {
184 CCDEBUG = /Zi /Od ;
185 }
186 # Libraries are in different paths depending on VC version
187 LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ;
188 LINKLIBS = advapi32.lib
189 libc.lib
190 oldnames.lib
191 gdi32.lib
192 user32.lib
193 kernel32.lib ;
194 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ;
195 }
196
197 else if $(MINGW) || ( $(TOOLSET) = MINGW )
198 {
199 CC = gcc ;
200 C++ = $(CC) ;
201
202 CCFLAGS += -DHAVE_ERF=1 ;
203 # uncomment to select desired warning level and ansi-strictness
204 CCWARN += -Wall ;
205 CCWARN += -W ;
206 CCWARN += -pedantic ;
207 #CCWARN += -Wshadow ;
208 #CCWARN += -ansi ;
209 CCWARN += -std=c99 ;
210
211 if $(NODEBUG)
212 {
213 CCDEBUG = -O3 ;
214 }
215 else
216 {
217 CCDEBUG = -g -O0 ;
218 CCFLAGS += -ggdb ;
219 }
220 C++FLAGS = $(CCFLAGS) ;
221
222 FORTRAN = g77 ;
223 FORTRANFLAGS = -c -I4 -O ;
224 F77_LIBS = $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ;
225
226 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
227 }
228
229 else if $(WATCOM) || ( $(TOOLSET) = WATCOM )
230 {
231 CC = wcc386 ;
232 C++ = wpp386 ;
233 FORTRAN = wfc386 ;
234 FORTRANFLAGS = /NOER ;
235 CCFLAGS += /fr /dMOD_ASCMALLOC ;
236 CCWARN = /wx ;
237 if $(NODEBUG)
238 {
239 CCDEBUG = /ox ;
240 FORTRANFLAGS += /OX ;
241 }
242 else
243 {
244 CCDEBUG = /od /d2 ;
245 FORTRANFLAGS += /OD /D2 ;
246 }
247 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
248 }
249 }
250
251 else if $(UNIX) || $(OS) = LINUX
252 {
253 SUFSHR = @SHLIB_SUFFIX@ ;
254 CC = @CC@ ;
255 CPP = @CPP@ ;
256
257 # DEFS = defines generated by configure
258 CCFLAGS += @DEFS@ ;
259 if $(CC) = gcc {
260
261 if $(NODEBUG)
262 {
263 CCDEBUG = -O3 ;
264 }
265 else
266 {
267 CCDEBUG = -g -O0 ;
268 Echo "DEBUGGER SYMBOLS TURNED ON" ;
269 CCFLAGS += -ggdb ;
270 }
271
272 # uncomment to select desired warning level and ansi-strictness
273 CCWARN += -Wall ;
274 CCWARN += -W ;
275 #CCWARN += -pedantic ;
276 #CCWARN += -Wshadow ;
277 #CCWARN += -ansi ;
278 CCWARN += -std=c99 ;
279 }
280
281 # YACC
282 # On some old systems yacc writes some K&R extern definitions to
283 # the .c file that it generates. This has caused havoc on at least
284 # one system. Define your yacc here. For the Suns in particular
285 # /usr/lang/SC1.0/ansi/yacc was required. If you cannot find an ansi
286 # compatible yacc, delete the 'extern char *malloc(), realloc() definitions
287 # if generated at the top of your .c created from the .y file.
288 #
289 YACC = @YACC@ ;
290
291 # LEX
292 # We require the flex lexer
293 #
294 LEX = @LEX@ ;
295 LEXLIB = @LEXLIB@ ;
296
297 # Some compilers need to be told where to find the math libraries
298 # -L$(MATH_LIB_DIRS) -lieee -lm ;
299 MATH_LIBS = @MATH_LIBS@ ;
300
301 # The interface and 1 file in the solver directory need to know where the
302 # include files and library for X11 are. If your C compiler doesn't know
303 # automatically where the X files are, or if they are in a non-standard
304 # place, set the following variables to point at them. These should be
305 # the same X files that Tk was built with on your system.
306 # Most systems do not need these variables to be set.
307 #
308 # The include and library files for X11:
309 X11_INCS = @X11_INCLUDES@ ;
310 X11_LIBS = @X11_LIBRARIES@ -lX11 @X11_EXTRA_LIBS@ @X11_RUN_PATH@ ;
311
312 # Library file(s) to link against for dynamic loading to work
313 DL_LIBS = @DL_LIBS@ ;
314
315 # FORTRAN options
316 # your f77 compiler
317 FORTRAN = @F77@ ;
318
319 # Fortran compilation flags:
320 # These are used for making the ASCEND libraries based on FORTRAN codes.
321 # These should be set to get the best performance possible out of your
322 # f77 compiler without optimizing away functions that are not obviously
323 # called, as some compilers do by default.
324 #
325 F77FLAGS = -c -I4 -O ;
326 #
327 # F77LIBS is for the base f77 libraries. If you are linking no f77
328 # objects to ascend, it may be left undefined.
329 # Set F77LIBS appropriate for your machine and desired loader behavior.
330 # -L$(FOR_LIB_DIRS) -lg2c ;
331 #
332 F77_LIBS += @F77LIBS@ ;
333 #
334 # F77_OPTS are for miscellaneous options, such as -tmpdir=
335 #
336 F77_OPTS = ;
337 #
338 # All the flags to pass to F77
339 #
340 FORTRANFLAGS = $(F77FLAGS) $(F77_OPTS) ;
341
342 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
343 }
344
345 CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ;
346 C++FLAGS = $(CCFLAGS) ;
347 BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
348
349 #======================================================================
350 # Ascend base library names & paths
351 #======================================================================
352 ASC_COMPILER_LIBROOT = libasccompiler ;
353 ASC_GENERAL_LIBROOT = libascgeneral ;
354 ASC_SOLVER_LIBROOT = libascsolver ;
355 ASC_UTILITIES_LIBROOT = libascutils ;
356 ASC_PACKAGES_LIBROOT = libascpackages ;
357
358 ASC_COMPILER_LIB = $(ASC_COMPILER_LIBROOT)$(SUFLIB) ;
359 ASC_GENERAL_LIB = $(ASC_GENERAL_LIBROOT)$(SUFLIB) ;
360 ASC_SOLVER_LIB = $(ASC_SOLVER_LIBROOT)$(SUFLIB) ;
361 ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBROOT)$(SUFLIB) ;
362 ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBROOT)$(SUFLIB) ;
363
364 ASC_BASE_LIBS =
365 $(ASC_COMPILER_LIB)
366 $(ASC_GENERAL_LIB)
367 $(ASC_PACKAGES_LIB)
368 $(ASC_SOLVER_LIB)
369 $(ASC_UTILITIES_LIB)
370 ;
371
372 # Path to base library sources & libs from top-level jam directory
373 ASC_BASE_SOURCE_RELPATH = $(TOP)$(SLASH)base$(SLASH)generic ;
374 ASC_BASE_LIBS_RELPATH = $(BUILD_DIR)$(SLASH) ;
375
376 #======================================================================
377 # SOLVERS / INTEGRATORS
378 #
379 # If you are linking to MINOS or other external solvers, the solver
380 # interface needs to know about it.
381 # Set the comment flags as appropriate on the following definitions.
382 # If the settings here do not match the libraries you link, you will
383 # almost certainly get runtime errors if not link errors.
384 #======================================================================
385
386 #------------------------------------------------------------------------------
387 # Slv is the original ASCEND nonlinear solver. It is not currently supported.
388 # To build with slv:
389 # - add -DSTATIC_SLV or -DDYNAMIC_SLV (unsupported) to SOLVER_DEFS
390 #
391 #SOLVER_DEFS += -DSTATIC_SLV ;
392
393 #------------------------------------------------------------------------------
394 # OptSQP is an interface to the Larry Biegler OPT code.
395 # It is not currently supported.
396 # To build with optsqp:
397 # - add -DSTATIC_OPTSQP or -DDYNAMIC_OPTSQP (unsupported) to SOLVER_DEFS
398 # - add location of OPT library to FOR_LIBS
399 #
400 if $(UNIX) || $(OS) = LINUX
401 {
402 # SOLVER_DEFS += @HAVE_OPTSQP@ ;
403 # FOR_LIBS += @OPTSQPLIB@ ;
404 }
405 else
406 {
407 #SOLVER_DEFS += -DSTATIC_OPTSQP ;
408 #FOR_LIBS += ;
409 }
410
411 #------------------------------------------------------------------------------
412 # QRSlv is the current ASCEND nonlinear algebraic solver.
413 # To build with slv:
414 # - add -DSTATIC_SLV or -DDYNAMIC_SLV (unsupported) to SOLVER_DEFS
415 #
416 SOLVER_DEFS += -DSTATIC_QRSLV ;
417
418 #------------------------------------------------------------------------------
419 # makeMPS is currently not supported.
420 # To build with mps:
421 # - add -DSTATIC_MPS or -DDYNAMIC_MPS (unsupported) to SOLVER_DEFS
422 #
423 #SOLVER_DEFS += -DSTATIC_MPS ;
424
425 #------------------------------------------------------------------------------
426 # NGSlv is an experimental solver (Ken Tyner) that is not currently supported
427 # To build with NGSlv:
428 # - add -DSTATIC_NGSLV or -DDYNAMIC_NGSLV (unsupported) to SOLVER_DEFS
429 #
430 #SOLVER_DEFS += -DSTATIC_NGSLV ;
431
432 #------------------------------------------------------------------------------
433 # CMSlv is the ASCEND conditional modeling solver (requires CONOPT).
434 # To build with cmslv:
435 # - add -DSTATIC_CMSLV or -DDYNAMIC_CMSLV (unsupported) to SOLVER_DEFS
436 #
437 #SOLVER_DEFS += -DSTATIC_CMSLV ;
438
439 #------------------------------------------------------------------------------
440 # LRSlv is the ASCEND logical relation solver.
441 # To build with lrslv:
442 # - add -DSTATIC_LRSLV or -DDYNAMIC_LRSLV (unsupported) to SOLVER_DEFS
443 #
444 #SOLVER_DEFS += -DSTATIC_LRSLV ;
445
446 #------------------------------------------------------------------------------
447 # MINOS is an interface to the MINOS solver. It is not currently functional.
448 # To build with minos:
449 # - add -DSTATIC_MINOS or -DDYNAMIC_MINOS (unsupported) to SOLVER_DEFS
450 # - add location of MINOS library to FOR_LIBS
451 if $(UNIX) || $(OS) = LINUX
452 {
453 # SOLVER_DEFS += @HAVE_MINOS@ ;
454 # FOR_LIBS += @MINOSLIB@ ;
455 }
456 else
457 {
458 #SOLVER_DEFS += -DSTATIC_MINOS ;
459 #FOR_LIBS += ;
460 }
461
462 #------------------------------------------------------------------------------
463 # CONOPT is an interface to the proprietary CONOPT solver.
464 # To build with conopt:
465 # - add -DSTATIC_CONOPT or -DDYNAMIC_CONOPT (unsupported) to SOLVER_DEFS
466 # - add location of CONOPT library to FOR_LIBS
467 if $(UNIX) || $(OS) = LINUX
468 {
469 # SOLVER_DEFS += @HAVE_CONOPT@ ;
470 # FOR_LIBS += @CONOPTLIB@ ;
471 }
472 else
473 {
474 #SOLVER_DEFS += -DSTATIC_CONOPT ;
475 #FOR_LIBS += ;
476 }
477
478 #------------------------------------------------------------------------------
479 # LSODE is an ODE solver. ASCEND is distributed with a standard lsode
480 # implementation that can be used if you have FORTRAN and don't have an
481 # optimized LSODE library.
482 # To build with lsode:
483 # - add -DSTATIC_LSOD or -DDYNAMIC_LSOD to SOLVER_DEFS
484 # - if you are providing an optimized lsode library:
485 # - add the location of the library to FOR_LIBS
486 # - set BUILD_LSODE = FALSE to disable building of the standard lsode
487 #
488 if $(UNIX) || $(OS) = LINUX
489 {
490 SOLVER_DEFS += @HAVE_LSOD@ ;
491 if ! @make_lsodlib@
492 {
493 BUILD_LSODE = FALSE ;
494 FOR_LIBS += @LSODLIB@ ;
495 }
496 }
497 else
498 {
499 SOLVER_DEFS += -DSTATIC_LSOD ;
500 FOR_LIBS += ;
501 # uncomment the following if you are providing an external lsode library
502 # BUILD_LSODE = FALSE ;
503 }
504 BUILD_LSODE ?= TRUE ;
505
506 #======================================================================
507 # FORTRAN options - set to override configure defaults
508 #======================================================================
509 # Your FORTRAN compiler
510 #FORTRAN = g77 ;
511
512 # Fortran compilation flags & options:
513 # These are used for making the ASCEND libraries based on FORTRAN codes.
514 # These should be set to get the best performance possible out of your
515 # f77 compiler without optimizing away functions that are not obviously
516 # called, as some compilers do by default.
517 #
518 #FORTRANFLAGS = -c -I4 -O -lg2c ;
519
520 # F77LIBS is for the base f77 libraries. If you are linking no f77
521 # objects to ascend, it may be left undefined.
522 # Set F77LIBS appropriate for your machine and desired loader behavior.
523 #
524 #F77_LIBS = ;
525
526 #======================================================================
527 # FORTRAN Support Libraries
528 #
529 # Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK
530 # libraries (if you have them) to get the best speed out of ASCEND.
531 # Otherwise, generic versions will be built if FORTRAN is available.
532 #======================================================================
533
534 # Name & path to the blas library
535 ASC_BLAS_LIBROOT = libblas ;
536 ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ;
537 # uncomment the following if you are providing an external lsode library
538 #BUILD_BLAS = FALSE ;
539 BLASLIB = $(BUILD_DIR)$(SLASH)blas$(SLASH)$(ASC_BLAS_LIB) ;
540
541 # Name & path to the linpack library
542 ASC_LINPACK_LIBROOT = liblpak ;
543 ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ;
544 # uncomment the following if you are providing an external linpack library
545 #BUILD_LPAK = FALSE ;
546 LPAKLIB = $(BUILD_DIR)$(SLASH)linpack$(SLASH)$(ASC_LINPACK_LIB) ;
547
548 # Name & path to the internal lsode library.
549 if $(BUILD_LSODE) = TRUE
550 {
551 Echo Building internal LSODE library ;
552 ASC_LSOD_LIBROOT = liblsode ;
553 ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ;
554 LSODLIB = $(BUILD_DIR)$(SLASH)lsode$(SLASH)$(ASC_LSOD_LIB) ;
555 }
556
557 FOR_LIBS += $(LSODLIB) $(LPAKLIB) $(BLASLIB) $(F77_LIBS) ;
558
559 #======================================================================
560 # Ascend-specific jam instructions
561 #======================================================================
562
563 #----------------------------------------------------------------------
564 # LEX_or_copy
565 #
566 # Generates a c source file using the lexer defined by $(LEX),
567 # or by copying a specified file if $(LEX) is not defined.
568 # The following parameters are used:
569 #
570 # 1 source file to generate
571 # 2 lex/flex definition file
572 # 3 pre-generated source file to copy if $(LEX) is empty
573 # 4 header file associated with the source file, if any
574 #----------------------------------------------------------------------
575 rule LEX_or_copy
576 {
577 if $(LEX)
578 {
579 Echo Generating $(1) from $(LEX) ;
580 DEPENDS $(1) : $(2) ;
581 Lex_with_options $(1) : $(2) ;
582 }
583 else
584 {
585 Echo Copying $(1) from $(4) ;
586 File $(1) : $(3) ;
587 }
588
589 # make the header dependent
590 if $(4)
591 {
592 INCLUDES $(1) : $(4) ;
593 }
594
595 Clean clean : $(1) ;
596 }
597
598 # run LEX using options specified in LEXOPTS
599 actions Lex_with_options
600 {
601 $(LEX) $(LEXOPTS) -o$(1) $(2)
602 }

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22