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

Contents of /trunk/base/generic/Jamfile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 129 - (show annotations) (download)
Tue Dec 20 20:22:56 2005 UTC (14 years, 9 months ago) by jds
File size: 13609 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 #
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 base library subset of ASCEND using the jam
28 # build tool as a set of static libraries. A regression test suite for
29 # the base libraries is also built.
30 #
31 # This file is part of the ASCEND jam build system rooted at ../../jam.
32 # See ../../jam/ReadMe.txt for more information.
33 #
34 #-------------------------------------------------------------------------
35 #
36 # File-specific Build Instructions
37 #
38 # 1. Follow the general instructions in ../../jam/ReadMe.txt for your platform.
39 #
40 # 2. To generate the base libraries, run:
41 # jam libs
42 #
43 # 3. A prototype CUnit test suite may also be built. At this point it
44 # only covers the general and utilities components. For maximal
45 # testing, NODEBUG should be commented and DEBUG_MALLOC and
46 # ALLOCATED_TESTS should be active in ../../jam/Jamrules. The
47 # ASCEND base libs should be built with these options also.
48 # Build the tests using:
49 # jam tests
50 #
51 #-------------------------------------------------------------------------
52
53 SubDir TOP base generic ;
54 if ! $(JAMRULES_ALREADY_SEEN)
55 {
56 include $(TOP)$(SLASH)jam$(SLASH)Jamrules ;
57 }
58
59 srcdir = $(TOP)$(SLASH)base$(SLASH)generic ;
60
61 # Build flags for Ascend base libraries
62 BUILD_COMPILER = 1 ;
63 BUILD_GENERAL = 1 ;
64 BUILD_SOLVER = 1 ;
65 BUILD_UTILITIES = 1 ;
66 BUILD_PACKAGES = 1 ;
67
68 # Ascend modules subdirectories
69 ASC_COMPILER_DIR = $(srcdir)$(SLASH)compiler ;
70 ASC_GENERAL_DIR = $(srcdir)$(SLASH)general ;
71 ASC_SOLVER_DIR = $(srcdir)$(SLASH)solver ;
72 ASC_UTILITIES_DIR = $(srcdir)$(SLASH)utilities ;
73 ASC_PACKAGES_DIR = $(srcdir)$(SLASH)packages ;
74
75 HDRS += $(srcdir) ;
76
77 DEPENDS all : libs ;
78 NOTFILE libs ;
79
80 # Location of old Ascend Tcl/Tk interface sources.
81 # Some solver modules include headers originally located in
82 # the Tcl/Tk-specific interface subdirectory. Until the
83 # source is reorganized to decouple the base and interface
84 # components, we have to be able to find those headers
85 # TODO: remove/rework when Tcl/Tk decoupled from base library
86 ASC_INTERFACE_ROOT = $(TOP)$(SLASH)tcltk98$(SLASH)generic ;
87
88 #=========================================================================
89 # Compiler module
90 #=========================================================================
91 if $(BUILD_COMPILER)
92 {
93 ASC_COMPILER_SOURCES =
94 anoncopy.c
95 anonmerg.c
96 anontype.c
97 arrayinst.c
98 ascCompiler.c
99 ascParse.c
100 atomsize.c
101 atomvalue.c
102 bintoken.c
103 bit.c
104 braced.c
105 case.c
106 check.c
107 child.c
108 childdef.c
109 childio.c
110 childinfo.c
111 cmpfunc.c
112 commands.c
113 copyinst.c
114 createinst.c
115 destroyinst.c
116 dimen.c
117 dimen_io.c
118 dump.c
119 evaluate.c
120 exprio.c
121 exprs.c
122 exprsym.c
123 extcall.c
124 extfunc.c
125 extinst.c
126 find.c
127 forvars.c
128 fractions.c
129 freestore.c
130 func.c
131 initialize.c
132 instance.c
133 instance_io.c
134 instantiate.c
135 instmacro.c
136 instquery.c
137 interval.c
138 library.c
139 linkinst.c
140 logrel_io.c
141 logrel_util.c
142 logrelation.c
143 mathinst.c
144 mergeinst.c
145 module.c
146 name.c
147 nameio.c
148 notate.c
149 numlist.c
150 packages.c
151 parentchild.c
152 parpend.c
153 pending.c
154 proc.c
155 procframe.c
156 procio.c
157 prototype.c
158 qlfdid.c
159 redirectFile.c
160 refineinst.c
161 rel_common.c
162 relation.c
163 relation_io.c
164 relation_util.c
165 rootfind.c
166 rounded.c
167 safe.c
168 scanner.c
169 select.c
170 setinst_io.c
171 setinstval.c
172 setio.c
173 sets.c
174 slist.c
175 simlist.c
176 statement.c
177 statio.c
178 switch.c
179 symtab.c
180 syntax.c
181 temp.c
182 tmpnum.c
183 type_desc.c
184 type_descio.c
185 typedef.c
186 typelint.c
187 units.c
188 universal.c
189 value_type.c
190 visitinst.c
191 visitlink.c
192 vlist.c
193 vlistio.c
194 watchpt.c
195 watchptio.c
196 when.c
197 when_io.c
198 when_util.c
199 ;
200
201 SEARCH on $(ASC_COMPILER_SOURCES) = $(ASC_COMPILER_DIR) ;
202
203 #----------------------------------------------------------------------
204 # rounded.c needs a special define
205 #----------------------------------------------------------------------
206 CCFLAGS on <base!generic>rounded$(SUFOBJ) += -DSLOPPY ;
207
208 #----------------------------------------------------------------------
209 # ascParse.c & ascParse.h
210 #
211 # ascParse implements the Ascend grammar. It is generated by
212 # yacc with modification (e.g. by sed) to change the default
213 # 'yy' prefixes to 'zz_'. If yacc and sed are available in
214 # the build environment (i.e. $(YACC) and $(SED) are non-null
215 # in jam), ascParse.c and ascParse.h are generated using these
216 # tools. If not, copies of pre-generated files are used instead.
217 #----------------------------------------------------------------------
218
219 # ascParse.c needs a special define
220 CCFLAGS on <base!generic>ascParse$(SUFOBJ) += -DYY_USE_CONST ;
221
222 rule make_ascParse
223 {
224 if $(YACC) && $(SED)
225 {
226 Echo Generating ascParse from $(YACC) and $(SED) ;
227 DEPENDS $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
228 Yacc1 $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
229 YaccMv $(ascParse_c) $(ascParse_h) : $(ascParse_y) ;
230 yy_to_zz_c $(ascParse_c) : $(ascParse_y) ;
231 yy_to_zz_h $(ascParse_h) : $(ascParse_y) ;
232 }
233 else
234 { Echo Copying ascParse.* from ascParse.*.no.yacc ;
235 File $(ascParse_c) : ascParse.c.no.yacc ;
236 File $(ascParse_h) : ascParse.h.no.yacc ;
237 }
238
239 # make the header dependent
240 INCLUDES $(ascParse_c) : $(ascParse_h) ;
241
242 Clean clean : $(ascParse_c) $(ascParse_h) ;
243 }
244
245 actions yy_to_zz_c
246 {
247 $(SED) -e "/#ifndef YYSTYPE/,/#endif/d" -e "/^#line /d" -e "s\yy\zz_\g" -e "s\YY\ZZ_\g" $(1) > tempfile.tmp
248 $(MV) tempfile.tmp $(1)
249 }
250
251 actions yy_to_zz_h
252 {
253 $(SED) -e "s\yy\zz_\g" -e "s\YY\ZZ_\g" $(1) > tempfile.tmp
254 $(MV) tempfile.tmp $(1)
255 }
256
257 ascParse_c = [ FGristSourceFiles ascParse.c ] ;
258 ascParse_h = [ FGristSourceFiles ascParse.h ] ;
259 ascParse_y = ascParse.y ;
260
261 LOCATE on $(ascParse_c) = $(ASC_COMPILER_DIR) ;
262 LOCATE on $(ascParse_h) = $(ASC_COMPILER_DIR) ;
263 LOCATE on $(ascParse_y) = $(ASC_COMPILER_DIR) ;
264
265 make_ascParse ;
266
267 #----------------------------------------------------------------------
268 # scanner.c
269 #
270 # scanner.c implements the Ascend lexical analyzer. It is
271 # generated by lex/flex if available in the build environment
272 # (i.e. $(LEX) is non-null in jam). If lex/flex is not available,
273 # the a copy of a pre-generated file is used instead.
274 #----------------------------------------------------------------------
275
276 # scanner.c needs a special define (Watcom requires the '=""'. )
277 CCFLAGS on <base!generic>scanner$(SUFOBJ) += -DYY_USE_CONST="" ;
278
279 scanner_c = [ FGristSourceFiles scanner.c ] ;
280 scanner_h = scanner.h ;
281 scanner_l = scanner.l ;
282 LEXOPTS on $(scanner_c) = -Pzz_ ;
283
284 LOCATE on $(scanner_c) = $(ASC_COMPILER_DIR) ;
285 LOCATE on $(scanner_h) = $(ASC_COMPILER_DIR) ;
286 LOCATE on $(scanner_l) = $(ASC_COMPILER_DIR) ;
287
288 LEX_or_copy $(scanner_c) : $(scanner_l) : scanner_c_no_flex : $(scanner_h) ;
289
290 #----------------------------------------------------------------------
291 # Build the compiler library
292 #----------------------------------------------------------------------
293 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)compiler ;
294 SEARCH_SOURCE = $(ASC_COMPILER_DIR) ;
295
296 Library $(ASC_COMPILER_LIBROOT) : $(ASC_COMPILER_SOURCES) ;
297 MakeLocate $(ASC_COMPILER_LIB) : $(BUILD_DIR) ;
298
299 DEPENDS libs : $(ASC_COMPILER_LIB) ;
300
301 # Main $(ASC_COMPILER_LIBROOT)$(SUFSHR) : $(ASC_COMPILER_SOURCES) ;
302 # MakeLocate $(ASC_COMPILER_LIB)$(SUFSHR) : $(BUILD_DIR) ;
303 }
304
305 #=========================================================================
306 # General module
307 #=========================================================================
308 if $(BUILD_GENERAL)
309 {
310 ASC_GENERAL_SOURCES =
311 dstring.c
312 hashpjw.c
313 list.c
314 listio.c
315 pool.c
316 pretty.c
317 stack.c
318 table.c
319 tm_time.c
320 ;
321
322 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)general ;
323 SEARCH_SOURCE = $(ASC_GENERAL_DIR) ;
324
325 Library $(ASC_GENERAL_LIBROOT) : $(ASC_GENERAL_SOURCES) ;
326 MakeLocate $(ASC_GENERAL_LIB) : $(BUILD_DIR) ;
327
328 DEPENDS libs : $(ASC_GENERAL_LIB) ;
329 }
330
331 #=========================================================================
332 # Solver module
333 #=========================================================================
334 if $(BUILD_SOLVER)
335 {
336 ASC_SOLVER_SOURCES =
337 analyze.c
338 bnd.c
339 bndman.c
340 calc.c
341 cond_config.c
342 conditional.c
343 conopt.c
344 discrete.c
345 linsol.c
346 linsolqr.c
347 linutils.c
348 logrel.c
349 logrelman.c
350 model_reorder.c
351 mps.c
352 mtx_basic.c
353 mtx_linal.c
354 mtx_perms.c
355 mtx_query.c
356 mtx_reorder.c
357 mtx_use_only.c
358 rel.c
359 relman.c
360 slv.c
361 slv0.c
362 slv1.c
363 slv2.c
364 slv3.c
365 slv6.c
366 slv7.c
367 slv8.c
368 slv9.c
369 slv9a.c
370 slvDOF.c
371 slv_common.c
372 slv_interface.c
373 slv_stdcalls.c
374 system.c
375 var.c
376 ;
377
378 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)solver ;
379 SEARCH_SOURCE = $(ASC_SOLVER_DIR) ;
380
381 Library $(ASC_SOLVER_LIBROOT) : $(ASC_SOLVER_SOURCES) ;
382 MakeLocate $(ASC_SOLVER_LIB) : $(BUILD_DIR) ;
383 ObjectCcFlags $(ASC_SOLVER_SOURCES) : $(SOLVER_DEFS) ;
384
385 # TODO: remove when Tcl/Tk interface decoupled from base library
386 ObjectHdrs slv6.c slv_interface.c : $(ASC_INTERFACE_ROOT) ;
387
388 DEPENDS libs : $(ASC_SOLVER_LIB) ;
389 }
390
391 #=========================================================================
392 # Utilities module
393 #=========================================================================
394 if $(BUILD_UTILITIES)
395 {
396 ASC_UTILITIES_SOURCES =
397 ascDynaLoad.c
398 ascEnvVar.c
399 ascMalloc.c
400 ascPanic.c
401 ascPrint.c
402 error.c
403 ascSignal.c
404 mem.c
405 readln.c
406 set.c
407 ;
408
409 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)utilities ;
410 SEARCH_SOURCE = $(ASC_UTILITIES_DIR) ;
411
412 Library $(ASC_UTILITIES_LIBROOT) : $(ASC_UTILITIES_SOURCES) ;
413 MakeLocate $(ASC_UTILITIES_LIB) : $(BUILD_DIR) ;
414
415 # TODO: remove when Tcl/Tk decoupled from base library
416 ObjectHdrs ascPrint.c : $(TK_HDRS) ;
417
418 DEPENDS libs : $(ASC_UTILITIES_LIB) ;
419 }
420
421 #=========================================================================
422 # Packages module
423 #=========================================================================
424 if $(BUILD_PACKAGES)
425 {
426 ASC_PACKAGES_SOURCES =
427 sensitivity.c
428 ascFreeAllVars.c
429 ;
430
431 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)packages ;
432 SEARCH_SOURCE = $(ASC_PACKAGES_DIR) ;
433
434 Library $(ASC_PACKAGES_LIBROOT) : $(ASC_PACKAGES_SOURCES) ;
435 MakeLocate $(ASC_PACKAGES_LIB) : $(BUILD_DIR) ;
436
437 DEPENDS libs : $(ASC_PACKAGES_LIB) ;
438 }
439
440 #======================================================================
441 # ASCEND base regression test
442 #======================================================================
443
444 TEST_PROG = test_ascend_base ;
445
446 # set location for target, source, and temporary files
447 LOCATE_TARGET = $(BUILD_DIR)$(SLASH)test ;
448 SEARCH_SOURCE =
449 $(ASC_COMPILER_DIR)$(SLASH)test
450 $(ASC_GENERAL_DIR)$(SLASH)test
451 $(ASC_SOLVER_DIR)$(SLASH)test
452 $(ASC_UTILITIES_DIR)$(SLASH)test
453 $(ASC_PACKAGES_DIR)$(SLASH)test
454 $(srcdir)$(SLASH)test
455 $(srcdir)$(SLASH)..$(SLASH)..$(SLASH)test ;
456
457 # extra symbolic targets for building test program
458 DEPENDS tests : $(TEST_PROG)$(SUFEXE) ;
459 NOTFILE tests ;
460
461 TEST_SOURCES =
462 assertimpl.c
463 printutil.c
464 redirectStdStreams.c
465 test_ascend_base.c
466 test_register_general.c
467 test_dstring.c
468 test_hashpjw.c
469 test_list.c
470 test_listio.c
471 test_pool.c
472 test_pretty.c
473 test_stack.c
474 test_table.c
475 test_tm_time.c
476 test_register_utilities.c
477 test_ascDynaLoad.c
478 test_ascEnvVar.c
479 test_ascMalloc.c
480 test_ascPanic.c
481 test_ascPrint.c
482 test_ascSignal.c
483 test_mem.c
484 test_readln.c
485 test_set.c
486 test_register_solver.c
487 test_slv_common.c
488 # slv_test.c
489 # test_slv.c
490 ;
491
492 CCFLAGS on <base!generic>$(TEST_SOURCES:S=$(SUFOBJ)) +=
493 -I..$(SLASH)..$(SLASH)test
494 -DALLOCATED_TESTS
495 ;
496
497 Main $(TEST_PROG) : $(TEST_SOURCES) ;
498 MakeLocate $(TEST_PROG)$(SUFEXE) : $(BUILD_DIR) ;
499
500 CUNIT_LIB_NAME = libcunit ;
501
502 if $(NT)
503 {
504 if ($(BCCROOT) || ($(TOOLSET) = BORLANDC))
505 {
506 # need to fix Borland to include library location
507 LINKFLAGS on $(TEST_PROG)$(SUFEXE) += -L$(STDLIBPATH) -tWC ;
508 }
509 else if $(MINGW) || ( $(TOOLSET) = MINGW )
510 {
511 CUNIT_LIB_NAME = libcunit_mingw ;
512 }
513 }
514
515 if $(UNIX) || $(OS) = LINUX
516 {
517 LINKFLAGS on $(TEST_PROG)$(SUFEXE) += $(DL_LIBS) $(MATH_LIBS) ;
518 }
519
520 LinkLibraries $(TEST_PROG) :
521 $(ASC_BASE_LIBS)
522 $(ASC_BASE_LIBS)
523 $(TOP)$(SLASH)test$(SLASH)$(CUNIT_LIB_NAME)$(SUFLIB)
524 ;
525
526 #LINKLIBS on $(TEST_PROG)$(SUFEXE) +=
527 # $(FOR_LIBS)
528 # $(PC_LIBS)
529 # $(MATH_LIBS)
530 # $(DL_LIBS)
531 # $(DEBUG_LIBS)
532 # ;
533

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