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

Contents of /trunk/base/jam/Jamfile

Parent Directory Parent Directory | Revision Log Revision Log


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

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