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

Annotation of /trunk/base/jam/Jamfile

Parent Directory Parent Directory | Revision Log Revision Log


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

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