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

Contents of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 129 - (show annotations) (download)
Tue Dec 20 20:22:56 2005 UTC (13 years, 5 months ago) by jds
File size: 14465 byte(s)
Reworked jam build system:
- integrated Jamrules.in and Jamrules_tcltk98.in with autoconf
- now support single-point building from trunk/jam
- old jam files still in place but deprecated
- may be buggy, please report back bugs for fixing

Compiled on both Windows and Linux.
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 = libasc_compiler ;
273 ASC_GENERAL_LIBROOT = libasc_general ;
274 ASC_SOLVER_LIBROOT = libasc_solver ;
275 ASC_UTILITIES_LIBROOT = libasc_utilities ;
276 ASC_PACKAGES_LIBROOT = libasc_packages ;
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 # Path to base library sources & libs from top-level jam directory
293 ASC_BASE_SOURCE_RELPATH = ..$(SLASH)base$(SLASH)generic ;
294 ASC_BASE_LIBS_RELPATH = ..$(SLASH)base$(SLASH)jam$(SLASH)$(BUILD_DIR)$(SLASH) ;
295
296 #======================================================================
297 # SOLVERS / INTEGRATORS
298 #
299 # If you are linking to MINOS or other external solvers, the solver
300 # interface needs to know about it.
301 # Set the comment flags as appropriate on the following definitions.
302 # If the settings here do not match the libraries you link, you will
303 # almost certainly get runtime errors if not link errors.
304 #======================================================================
305
306 # >>>> UNDER CONSTRUCTION <<<<
307
308 # Slv is the original ASCEND nonlinear solver. It is not currently supported.
309 # to build with slv, uncomment the next line.
310 #SOLVER_DEFS += -DSTATIC_SLV ;
311
312 # Opt is not currently supported.
313 # to build with optsqp, uncomment the next line
314 #SOLVER_DEFS += -DSTATIC_OPTSQP ;
315
316 # QRSlv is the current ASCEND nonlinear algebraic solver.
317 # to build with qrslv, uncomment the next line
318 SOLVER_DEFS += -DSTATIC_QRSLV ;
319
320 # makeMPS is currently not supported.
321 # to build with mps, uncomment the next line
322 #SOLVER_DEFS += -DSTATIC_MPS ;
323
324 # to build with ngslv, uncomment the next line
325 #SOLVER_DEFS += -DSTATIC_NGSLV ;
326
327 # to build with cmslv (requires CONOPT), uncomment the next line
328 #SOLVER_DEFS += -DSTATIC_CMSLV ;
329
330 # to build with lrslv, uncomment the next line
331 #SOLVER_DEFS += -DSTATIC_LRSLV ;
332
333 # TODO the configure script sets the following depending on its search for minos.
334 # Minos is an external solver. It is not currently supported.
335 # to force a build WITHOUT minos, comment the next line
336 #SOLVER_DEFS += -DSTATIC_MINOS ;
337 #
338 # Name & path to the minos library
339 #MINOSLIB = ;
340 #MINOSLIB_RELPATH = ;
341
342 # TODO the configure script sets the following depending on its search for conopt.
343 # to force a build WITHOUT conopt, comment the next line
344 #SOLVER_DEFS += -DSTATIC_CONOPT ;
345 #
346 # Path to the conopt library
347 #CONOPTLIB = ;
348 #CONOPTLIB_RELPATH = ;
349
350 # TODO the configure script sets the following depending on its search for lsode.
351 # Choose one of the following to build with lsode, comment both to build WITHOUT lsode
352 SOLVER_DEFS += -DSTATIC_LSOD ;
353 #SOLVER_DEFS += -DDYNAMIC_LSOD ;
354 #
355 # Name & path to the lsode library. Comment out if not using lsode.
356 ASC_LSOD_LIBROOT = liblsode ;
357 ASC_LSOD_LIB = $(ASC_LSOD_LIBROOT)$(SUFLIB) ;
358 LSODLIB_RELPATH = ..$(SLASH)lsod$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
359 LSODLIB = $(ASC_LSOD_LIB) ;
360
361 #======================================================================
362 # FORTRAN options - set to override compiler defaults
363 #======================================================================
364 # Your FORTRAN compiler
365 #FORTRAN = g77 ;
366
367 # Fortran compilation flags & options:
368 # These are used for making the ASCEND libraries based on FORTRAN codes.
369 # These should be set to get the best performance possible out of your
370 # f77 compiler without optimizing away functions that are not obviously
371 # called, as some compilers do by default.
372 #
373 #FORTRANFLAGS = -c -I4 -O -lg2c ;
374
375 # F77LIBS is for the base f77 libraries. If you are linking no f77
376 # objects to ascend, it may be left undefined.
377 # Set F77LIBS appropriate for your machine and desired loader behavior.
378 #
379 #F77_LIBS = ;
380 if $(UNIX) || $(OS) = LINUX
381 {
382 F77_LIBS = -L$(FOR_LIB_DIRS) -lg2c ;
383 }
384
385 #======================================================================
386 # FORTRAN Support Libraries
387 #
388 # Point BLASLIB and LPAKLIB to machine-specific BLAS and LINPACK
389 # libraries (if you have them) to get the best speed out of ASCEND.
390 # Otherwise, generic versions can be built if FORTRAN is available.
391 #======================================================================
392
393 # Name & path to the blas library
394 ASC_BLAS_LIBROOT = libblas ;
395 ASC_BLAS_LIB = $(ASC_BLAS_LIBROOT)$(SUFLIB) ;
396 BLASLIB_RELPATH = ..$(SLASH)blas$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
397 BLASLIB = $(ASC_BLAS_LIB) ;
398
399 # Name & path to the linpack library
400 ASC_LINPACK_LIBROOT = liblpak ;
401 ASC_LINPACK_LIB = $(ASC_LINPACK_LIBROOT)$(SUFLIB) ;
402 LPAKLIB_RELPATH = ..$(SLASH)linpack$(SLASH)jam$(SLASH)$(BUILD_DIR) ;
403 LPAKLIB = $(ASC_LINPACK_LIB) ;
404
405 #======================================================================
406 # Math libraries
407 #======================================================================
408 if $(UNIX) || $(OS) = LINUX
409 {
410 MATH_LIBS = -L$(MATH_LIB_DIRS) -lieee -lm ;
411 }
412
413 #======================================================================
414 # Dynamic loading support
415 #======================================================================
416 if $(UNIX) || $(OS) = LINUX
417 {
418 DL_LIBS = -L$(DL_LIB_DIRS) -ldl ;
419 }
420
421 #======================================================================
422 # X11
423 #======================================================================
424 if $(UNIX) || $(OS) = LINUX
425 {
426 X11_LIBS = -L$(X11_LIB_DIRS) -lX11 ;
427 }
428
429 #======================================================================
430 # Ascend-specific jam instructions
431 #======================================================================
432
433 #----------------------------------------------------------------------
434 # LEX_or_copy
435 #
436 # Generates a c source file using the lexer defined by $(LEX),
437 # or by copying a specified file if $(LEX) is not defined.
438 # The following parameters are used:
439 #
440 # 1 source file to generate
441 # 2 lex/flex definition file
442 # 3 pre-generated source file to copy if $(LEX) is empty
443 # 4 header file associated with the source file, if any
444 #----------------------------------------------------------------------
445 rule LEX_or_copy
446 {
447 if $(LEX)
448 {
449 Echo Generating $(1) from $(LEX) ;
450 DEPENDS $(1) : $(2) ;
451 Lex_with_options $(1) : $(2) ;
452 }
453 else
454 {
455 Echo Copying $(1) from $(4) ;
456 File $(1) : $(3) ;
457 }
458
459 # make the header dependent
460 if $(4)
461 {
462 INCLUDES $(1) : $(4) ;
463 }
464
465 Clean clean : $(1) ;
466 }
467
468 # run LEX using options specified in LEXOPTS
469 actions Lex_with_options
470 {
471 $(LEX) $(LEXOPTS) -o$(1) $(2)
472 }

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