/[ascend]/trunk/base/jam/Jamfile
ViewVC logotype

Contents of /trunk/base/jam/Jamfile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (show annotations) (download)
Sat Jan 22 14:22:13 2005 UTC (19 years, 6 months ago) by jds
File size: 15000 byte(s)
Initial commit of WinVC7 and jam build files.  jam builds Ascend base libs and tcltk98 executable on Windows using msvc, borland, mingw, and watcom (watcom can't yet link executable due to lack of isnan() and copysign() functions).

Also includes minor source updates to compile & run on Windows.
1 #
2 # Jamfile to build Ascend4 base libraries
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 Jamfile builds the Ascend base libraries using the jam* build
28 # tool. Using generic Jambase and Jamrules_general files (located at
29 # ../../jam), it builds the Ascend base functionality as a set of static
30 # libraries. It does not currently support building dynamic libraries,
31 # executables, or interface libraries.
32 #
33 # The Ascend jam build system currently supports building the libraries
34 # under Windows using the MSVC, Borland, MinGW, and Watcom** compilers,
35 # and under Linux with gcc. With use of the customized ../.../jam/Jambase
36 # file, it should work with both the original and ftjam variants of jam.
37 # The system was developed primarily using ftjam.
38 #
39 # The libraries are built in ./CONFIGTYPE/COMPILER where
40 # CONFIGTYPE = Debug, Release
41 # COMPILER = bcc, msvc, mingw, watcom, unix
42 #
43 # Installation of the libraries or headers is not supported at this time.
44 #-------------------------------------------------------------------------
45 #
46 # Build Instructions
47 #
48 # 1. jam must be installed and configured for the compiler in use.
49 #
50 # 2. Copy the ../../jam/Jamrules_general.in to ../../jam/Jamrules_general.
51 #
52 # 3. Manually edit Jamrules_general and (if necessary) the Jamfile to set
53 # configuration and local directory options.
54 #
55 # 4. Run jam from using the provided Jambase:
56 # jam -f ../../jam/Jambase libs
57 #
58 #-------------------------------------------------------------------------
59 # Notes:
60 #
61 # * jam is an open source, multi-platform build tool which is
62 # available in several flavors. These include the original
63 # (http://www.perforce.com) and ftjam
64 # (http://www.freetype.org/jam/index.html) variants, among others.
65 #
66 # ** Currently, Open Watcom 1.3 can compile the Ascend sources
67 # and build the libraries. However, it does not supply the required
68 # IEEE math functions isnan() and copysign(). At present, Ascend does
69 # not supply these, so the use must provide these functions to use
70 # the libraries under Watcom.
71 #
72 #---------------------------------------------------------------------------
73
74 # TODO: remove if end up using SubDir rules
75 JAM_GENERAL_DIR = ..$(SLASH)..$(SLASH)jam ;
76 include $(JAM_GENERAL_DIR)$(SLASH)Jamrules_general ;
77
78 srcdir = ..$(SLASH)generic ;
79
80 # Build flags for Ascend base libraries
81 BUILD_COMPILER = 1 ;
82 BUILD_GENERAL = 1 ;
83 BUILD_SOLVER = 1 ;
84 BUILD_UTILITIES = 1 ;
85 BUILD_PACKAGES = 1 ;
86
87 # Ascend modules subdirectories
88 ASC_COMPILER_DIR = $(srcdir)$(SLASH)compiler ;
89 ASC_GENERAL_DIR = $(srcdir)$(SLASH)general ;
90 ASC_SOLVER_DIR = $(srcdir)$(SLASH)solver ;
91 ASC_UTILITIES_DIR = $(srcdir)$(SLASH)utilities ;
92 ASC_PACKAGES_DIR = $(srcdir)$(SLASH)packages ;
93
94 HDRS += $(srcdir) ;
95
96 DEPENDS all : libs ;
97 NOTFILE libs ;
98
99 # Location of old Ascend Tcl/Tk interface sources.
100 # Some solver modules include headers originally located in
101 # the Tcl/Tk-specific interface subdirectory. Until the
102 # source is reorganized to decouple the base and interface
103 # components, we have to be able to find those headers
104 # TODO: remove/rework when Tcl/Tk decoupled from base library
105 ASC_INTERFACE_ROOT = ..$(SLASH)..$(SLASH)tcltk98$(SLASH)generic ;
106
107 # Comment to compile without using the Epperly malloc debugger
108 #DEBUG_MALLOC = -DMALLOC_DEBUG ;
109
110 # Location of the tcl.h and tk.h header files
111 # TODO: remove when Tcl/Tk decoupled from base library
112 TK_HDRS = ..$(SLASH)..$(SLASH)..$(SLASH)Tcl$(SLASH)include ;
113
114 #=========================================================================
115 # Compiler module
116 #=========================================================================
117 if $(BUILD_COMPILER)
118 {
119 ASC_COMPILER_SOURCES =
120 anoncopy.c
121 anonmerg.c
122 anontype.c
123 arrayinst.c
124 ascCompiler.c
125 ascParse.c
126 atomsize.c
127 atomvalue.c
128 bintoken.c
129 bit.c
130 braced.c
131 case.c
132 check.c
133 child.c
134 childdef.c
135 childio.c
136 childinfo.c
137 cmpfunc.c
138 commands.c
139 copyinst.c
140 createinst.c
141 destroyinst.c
142 dimen.c
143 dimen_io.c
144 dump.c
145 evaluate.c
146 exprio.c
147 exprs.c
148 exprsym.c
149 extcall.c
150 extfunc.c
151 extinst.c
152 find.c
153 forvars.c
154 fractions.c
155 freestore.c
156 func.c
157 initialize.c
158 instance.c
159 instance_io.c
160 instantiate.c
161 instmacro.c
162 instquery.c
163 interval.c
164 library.c
165 linkinst.c
166 logrel_io.c
167 logrel_util.c
168 logrelation.c
169 mathinst.c
170 mergeinst.c
171 module.c
172 name.c
173 nameio.c
174 notate.c
175 numlist.c
176 packages.c
177 parentchild.c
178 parpend.c
179 pending.c
180 proc.c
181 procframe.c
182 procio.c
183 prototype.c
184 refineinst.c
185 rel_common.c
186 relation.c
187 relation_io.c
188 relation_util.c
189 rootfind.c
190 rounded.c
191 safe.c
192 scanner.c
193 select.c
194 setinst_io.c
195 setinstval.c
196 setio.c
197 sets.c
198 slist.c
199 simlist.c
200 statement.c
201 statio.c
202 switch.c
203 symtab.c
204 syntax.c
205 temp.c
206 tmpnum.c
207 type_desc.c
208 type_descio.c
209 typedef.c
210 typelint.c
211 redirectFile.c
212 units.c
213 universal.c
214 value_type.c
215 visitinst.c
216 visitlink.c
217 vlist.c
218 vlistio.c
219 watchpt.c
220 watchptio.c
221 when.c
222 when_io.c
223 when_util.c
224 ;
225
226 SEARCH on $(ASC_COMPILER_SOURCES) = $(ASC_COMPILER_DIR) ;
227
228 #----------------------------------------------------------------------
229 # rounded.c needs a special define
230 #----------------------------------------------------------------------
231 CCFLAGS on rounded$(SUFOBJ) += -DSLOPPY ;
232
233 #----------------------------------------------------------------------
234 # ascParse.c & ascParse.h
235 #
236 # ascParse implements the Ascend grammar. It is generated by
237 # yacc with modification (e.g. by sed) to change the default
238 # 'yy' prefixes to 'zz_'. If yacc and sed are available in
239 # the build environment (i.e. $(YACC) and $(SED) are non-null
240 # in jam), ascParse.c and ascParse.h are generated using these
241 # tools. If not, copies of pre-generated files are used instead.
242 #----------------------------------------------------------------------
243
244 # ascParse.c needs a special define
245 CCFLAGS on ascParse$(SUFOBJ) += -DYY_USE_CONST ;
246
247 rule make_ascParse
248 {
249 if $(YACC) && $(SED)
250 {
251 Echo Generating ascParse from $(YACC) and $(SED) ;
252 DEPENDS $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
253 Yacc1 $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
254 YaccMv $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
255 yy_to_zz_c $(ascParse_c) : $(ascParse_y) ;
256 yy_to_zz_h $(ascParse_h) : $(ascParse_y) ;
257 }
258 else
259 {
260 Echo Copying ascParse.* from ascParse.*.no.yacc ;
261 File $(ascParse_c) : ascParse.c.no.yacc ;
262 File $(ascParse_h) : ascParse.h.no.yacc ;
263 }
264
265 # make the header dependent
266 INCLUDES $(ascParse_c) : $(ascParse_h) ;
267
268 Clean clean : $(ascParse_c) $(ascParse_h) ;
269 }
270
271 actions yy_to_zz_c
272 {
273 $(SED) -e "/#ifndef YYSTYPE/,/#endif/d" -e "/^#line /d" -e "s\yy\zz_\g" -e "s\YY\ZZ_\g" $(1) > tempfile.tmp
274 $(MV) tempfile.tmp $(1)
275 }
276
277 actions yy_to_zz_h
278 {
279 $(SED) -e "s\yy\zz_\g" -e "s\YY\ZZ_\g" $(1) > tempfile.tmp
280 $(MV) tempfile.tmp $(1)
281 }
282
283 ascParse_c = [ FGristSourceFiles ascParse.c ] ;
284 ascParse_h = [ FGristSourceFiles ascParse.h ] ;
285 ascParse_y = ascParse.y ;
286
287 LOCATE on $(ascParse_c) = $(ASC_COMPILER_DIR) ;
288 LOCATE on $(ascParse_h) = $(ASC_COMPILER_DIR) ;
289 LOCATE on $(ascParse_y) = $(ASC_COMPILER_DIR) ;
290
291 make_ascParse ;
292
293 #----------------------------------------------------------------------
294 # scanner.c
295 #
296 # scanner.c implements the Ascend lexical analyzer. It is
297 # generated by lex/flex if available in the build environment
298 # (i.e. $(LEX) is non-null in jam). If lex/flex is not available,
299 # the a copy of a pre-generated file is used instead.
300 #----------------------------------------------------------------------
301
302 # scanner.c needs a special define (Watcom requires the '=""'. )
303 CCFLAGS on scanner$(SUFOBJ) += -DYY_USE_CONST="" ;
304
305 scanner_c = [ FGristSourceFiles scanner.c ] ;
306 scanner_h = scanner.h ;
307 scanner_l = scanner.l ;
308 LEXOPTS on $(scanner_c) = -Pzz_ ;
309
310 LOCATE on $(scanner_c) = $(ASC_COMPILER_DIR) ;
311 LOCATE on $(scanner_h) = $(ASC_COMPILER_DIR) ;
312 LOCATE on $(scanner_l) = $(ASC_COMPILER_DIR) ;
313
314 LEX_or_copy $(scanner_c) : $(scanner_l) : scanner_c_no_flex : $(scanner_h) ;
315
316 #----------------------------------------------------------------------
317 # Build the compiler library
318 #----------------------------------------------------------------------
319 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)compiler ;
320 SEARCH_SOURCE = $(ASC_COMPILER_DIR) ;
321
322 Library $(ASC_COMPILER_LIBNAME) : $(ASC_COMPILER_SOURCES) ;
323 MakeLocate $(ASC_COMPILER_LIB) : $(BUILD_DIR) ;
324
325 DEPENDS libs : $(ASC_COMPILER_LIB) ;
326 }
327
328 #=========================================================================
329 # General module
330 #=========================================================================
331 if $(BUILD_GENERAL)
332 {
333 ASC_GENERAL_SOURCES =
334 dstring.c
335 hashpjw.c
336 list.c
337 listio.c
338 pool.c
339 pretty.c
340 stack.c
341 table.c
342 tm_time.c
343 ;
344
345 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)general ;
346 SEARCH_SOURCE = $(ASC_GENERAL_DIR) ;
347
348 Library $(ASC_GENERAL_LIBNAME) : $(ASC_GENERAL_SOURCES) ;
349 MakeLocate $(ASC_GENERAL_LIB) : $(BUILD_DIR) ;
350
351 DEPENDS libs : $(ASC_GENERAL_LIB) ;
352 }
353
354 #=========================================================================
355 # Solver module
356 #=========================================================================
357 if $(BUILD_SOLVER)
358 {
359 ASC_SOLVER_SOURCES =
360 analyze.c
361 bnd.c
362 bndman.c
363 calc.c
364 cond_config.c
365 conditional.c
366 conopt.c
367 discrete.c
368 linsol.c
369 linsolqr.c
370 linutils.c
371 logrel.c
372 logrelman.c
373 model_reorder.c
374 mps.c
375 mtx_basic.c
376 mtx_linal.c
377 mtx_perms.c
378 mtx_query.c
379 mtx_reorder.c
380 mtx_use_only.c
381 rel.c
382 relman.c
383 rootfind.c
384 slv.c
385 slv0.c
386 slv1.c
387 slv2.c
388 slv3.c
389 slv6.c
390 slv7.c
391 slv8.c
392 slv9.c
393 slv9a.c
394 slvDOF.c
395 slv_common.c
396 slv_interface.c
397 slv_stdcalls.c
398 system.c
399 var.c
400 ;
401
402 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)solver ;
403 SEARCH_SOURCE = $(ASC_SOLVER_DIR) ;
404
405 Library $(ASC_SOLVER_LIBNAME) : $(ASC_SOLVER_SOURCES) ;
406 MakeLocate $(ASC_SOLVER_LIB) : $(BUILD_DIR) ;
407 ObjectCcFlags $(ASC_SOLVER_SOURCES) : $(SOLVER_DEFS) ;
408
409 # TODO: remove when Tcl/Tk interface decoupled from base library
410 ObjectHdrs slv6.c slv_interface.c : $(ASC_INTERFACE_ROOT) ;
411
412 DEPENDS libs : $(ASC_SOLVER_LIB) ;
413 }
414
415 #=========================================================================
416 # Utilities module
417 #=========================================================================
418 if $(BUILD_UTILITIES)
419 {
420 ASC_UTILITIES_SOURCES =
421 ascDynaLoad.c
422 ascEnvVar.c
423 ascMalloc.c
424 ascPanic.c
425 ascPrint.c
426 ascSignal.c
427 mem.c
428 readln.c
429 set.c
430 ;
431
432 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)utilities ;
433 SEARCH_SOURCE = $(ASC_UTILITIES_DIR) ;
434
435 Library $(ASC_UTILITIES_LIBNAME) : $(ASC_UTILITIES_SOURCES) ;
436 MakeLocate $(ASC_UTILITIES_LIB) : $(BUILD_DIR) ;
437
438 # TODO: remove when Tcl/Tk decoupled from base library
439 ObjectHdrs ascPrint.c : $(TK_HDRS) ;
440
441 DEPENDS libs : $(ASC_UTILITIES_LIB) ;
442 }
443
444 #=========================================================================
445 # Packages module
446 #=========================================================================
447 if $(BUILD_PACKAGES)
448 {
449 ASC_PACKAGES_SOURCES =
450 sensitivity.c
451 ascFreeAllVars.c
452 ;
453
454 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)packages ;
455 SEARCH_SOURCE = $(ASC_PACKAGES_DIR) ;
456
457 Library $(ASC_PACKAGES_LIBNAME) : $(ASC_PACKAGES_SOURCES) ;
458 MakeLocate $(ASC_PACKAGES_LIB) : $(BUILD_DIR) ;
459
460 DEPENDS libs : $(ASC_PACKAGES_LIB) ;
461 }
462
463 #======================================================================
464 # SOLVERS / INTEGRATORS
465 #
466 # If you are linking to MINOS or other external solvers, the solver
467 # interface needs to know about it.
468 # Set the comment flags as appropriate on the following definitions.
469 # If the settings here do not match the libraries you link, you will
470 # almost certainly get runtime errors if not link errors.
471 #======================================================================
472
473 # >>>> UNDER CONSTRUCTION <<<<
474
475 # to build with slv, uncomment the next line
476 #SOLVER_DEFS += -DSTATIC_SLV ;
477
478 # to build with optsqp, uncomment the next line
479 #SOLVER_DEFS += -DSTATIC_OPTSQP ;
480
481 # to build with qrslv, uncomment the next line
482 SOLVER_DEFS += -DSTATIC_QRSLV ;
483
484 # to build with mps, uncomment the next line
485 #SOLVER_DEFS += -DSTATIC_MPS ;
486
487 # to build with ngslv, uncomment the next line
488 #SOLVER_DEFS += -DSTATIC_NGSLV ;
489
490 # to build with cmslv (requires CONOPT), uncomment the next line
491 #SOLVER_DEFS += -DSTATIC_CMSLV ;
492
493 # to build with lrslv, uncomment the next line
494 #SOLVER_DEFS += -DSTATIC_LRSLV ;
495
496 # the configure script sets the following depending on its search for minos.
497 # to force a build WITHOUT minos, comment the next line
498 #SOLVER_DEFS += -DSTATIC_MINOS ;
499 #
500 # name & location of the minos library
501 #MINOSLIB = ;
502 #LOCATE on $(MINOSLIB) = ;
503
504 # TODO the configure script sets the following depending on its search for conopt.
505 # to force a build WITHOUT conopt, comment the next line
506 #SOLVER_DEFS += -DSTATIC_CONOPT ;
507 #
508 # name & location of the conopt library
509 #CONOPTLIB = ;
510 #LOCATE on $(CONOPTLIB) = ;
511
512 # TODO the configure script sets the following depending on its search for lsode.
513 # to force a build WITHOUT lsode, comment the next line
514 SOLVER_DEFS += -DSTATIC_LSOD ;

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