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

Annotation of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 51 - (hide annotations) (download)
Sat May 14 01:33:48 2005 UTC (15 years, 3 months ago) by jds
File size: 7554 byte(s)
Minor upgrade to jam build files (correct typo in compiler selection logic).
1 jds 40 #
2     # General Jamrules support file for building Ascend4
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 is a template Jamrules file which supports building the
28     # Ascend libraries and executables. It contains general variable
29     # and rule definitions required for execution of jam in any of the
30     # source subdirectories. The Ascend jam build system currently
31     # supports the MSVC, Borland, MinGW, and Watcom compilers
32     # (extension to gcc on Linux is on the TODO: list).
33     #
34     # This file is not currently customized by the configure mechanism,
35     # although this may be implemented in the future.
36     #
37     # Users should copy/rename this file to 'Jamrules', then modify
38     # the settings manually for their particular system. Ascend
39     # cannot be built by jam unless the Jamrules file is present.
40     #
41     # User-customized Jamrules files should not be placed in version
42     # control. Only the Jamrules.in template should be versioned.
43     #
44     #---------------------------------------------------------------------------
45    
46     # Comment to compile with debugging & assertions enabled
47     #NODEBUG = 1 ;
48    
49     # Comment to compile without using the Epperly malloc debugger
50     #DEBUG_MALLOC = -DMALLOC_DEBUG ;
51    
52     #---------------------------------------------------------------------------
53     # Options from here on should not require routine tweaking
54    
55     # Tools required for complete build (comment out if not present).
56     # The build system works around their absence if necessary.
57     # Note that they are available for Windows, for example:
58     # http://sourceforge.net/projects/gnuWin32
59     SED = sed ;
60     YACC = yacc ;
61     YACCFLAGS = -d ;
62     YACCFILES = y.tab ;
63     LEX = flex ;
64    
65     # Ascend base library names
66     ASC_COMPILER_LIBNAME = libasc_compiler ;
67     ASC_GENERAL_LIBNAME = libasc_general ;
68     ASC_SOLVER_LIBNAME = libasc_solver ;
69     ASC_UTILITIES_LIBNAME = libasc_utilities ;
70     ASC_PACKAGES_LIBNAME = libasc_packages ;
71    
72     ASC_COMPILER_LIB = $(ASC_COMPILER_LIBNAME)$(SUFLIB) ;
73     ASC_GENERAL_LIB = $(ASC_GENERAL_LIBNAME)$(SUFLIB) ;
74     ASC_SOLVER_LIB = $(ASC_SOLVER_LIBNAME)$(SUFLIB) ;
75     ASC_UTILITIES_LIB = $(ASC_UTILITIES_LIBNAME)$(SUFLIB) ;
76     ASC_PACKAGES_LIB = $(ASC_PACKAGES_LIBNAME)$(SUFLIB) ;
77    
78     ASC_BASE_LIBS =
79     $(ASC_COMPILER_LIB)
80     $(ASC_GENERAL_LIB)
81     $(ASC_SOLVER_LIB)
82     $(ASC_UTILITIES_LIB)
83     $(ASC_PACKAGES_LIB)
84     ;
85    
86     # FORTRAN support library names
87     ASC_BLAS_LIBNAME = libblas ;
88     ASC_LINPACK_LIBNAME = liblinpack ;
89    
90     ASC_BLAS_LIB = $(ASC_BLAS_LIBNAME)$(SUFLIB) ;
91     ASC_LINPACK_LIB = $(ASC_LINPACK_LIBNAME)$(SUFLIB) ;
92    
93     # Build directory - - will be qualified for compiler & build type
94     BUILD_DIR_ROOT = $(DOT) ;
95    
96     # Comment for normal jam deletion of object files after building targets
97     KEEPOBJS = true ;
98    
99     if $(NODEBUG)
100     {
101     CCFLAGS += -DNDEBUG ;
102     BUILD_SUBDIR = $(SLASH)Release ;
103     }
104     else
105     {
106     BUILD_SUBDIR = $(SLASH)Debug ;
107     }
108    
109     # platform- & complier-specific options
110     if $(NT)
111     {
112     # Windows-specific defines
113     CCFLAGS += -D_X86_=1 -DWIN32 -D_WIN32 ;
114     SUFSHR = .dll ;
115    
116 jds 51 if $(BCCROOT) || ( $(TOOLSET) = BORLANDC )
117 jds 40 {
118     FORTRAN = ;
119     CCFLAGS += -q -d -g0 -j0 -K -DMOD_ASCMALLOC ;
120     CCWARN = -w ;
121     if $(NODEBUG)
122     {
123     CCDEBUG = -v- -O2 ;
124     }
125     else
126     {
127     CCDEBUG = -v -y -Od ;
128     }
129     C++FLAGS = $(CCFLAGS) ;
130     COFF2OMF = coff2omf ; # add location if not in path
131     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)bcc ;
132     }
133    
134 jds 51 else if $(MSVCNT) || ( $(TOOLSET) = VISUALC )
135 jds 40 {
136     FORTRAN = ;
137     CCFLAGS += /Ze ;
138     CCWARN = /W4 ;
139     if $(NODEBUG)
140     {
141     CCDEBUG = /O2 ;
142     }
143     else
144     {
145     CCDEBUG = /Zi /Od ;
146     }
147     # Libraries are in different paths depending on VC version
148     LINKFLAGS += /LIBPATH:$(VISUALC)\\lib /LIBPATH:$(VISUALC)\\PlatformSDK\\lib\\ ;
149     LINKLIBS = advapi32.lib
150     libc.lib
151     oldnames.lib
152     gdi32.lib
153     user32.lib
154     kernel32.lib ;
155     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)msvc ;
156     }
157    
158 jds 51 else if $(MINGW) || ( $(TOOLSET) = MINGW )
159 jds 40 {
160     FORTRANFLAGS = -c -I4 -O ;
161     F77_LIBS += $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ;
162    
163 jds 47 # uncomment to select desired warning level and ansi-strictness
164     CCWARN += -Wall ;
165     CCWARN += -W ;
166     CCWARN += -pedantic ;
167     #CCWARN += -Wshadow ;
168     #CCWARN += -ansi ;
169 jds 40
170     if $(NODEBUG)
171     {
172     CCDEBUG = -O3 ;
173     }
174     else
175     {
176     CCDEBUG = -g -O0 ;
177     }
178     C++FLAGS = $(CCFLAGS) ;
179     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
180     }
181    
182 jds 51 else if $(WATCOM) || ( $(TOOLSET) = WATCOM )
183 jds 40 {
184     FORTRANFLAGS = /NOER ;
185     CCFLAGS += /fr /dMOD_ASCMALLOC ;
186     CCWARN = /wx ;
187     if $(NODEBUG)
188     {
189     CCDEBUG = /ox ;
190     FORTRANFLAGS += /OX ;
191     }
192     else
193     {
194     CCDEBUG = /od /d2 ;
195     FORTRANFLAGS += /OD /D2 ;
196     }
197     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
198     }
199     }
200    
201     else if $(OS) = LINUX
202     {
203     SUFSHR = .so ;
204     FORTRANFLAGS = -c -I4 -O -lg2c ;
205    
206 jds 47 # uncomment to select desired warning level and ansi-strictness
207     CCWARN += -Wall ;
208     CCWARN += -W ;
209     CCWARN += -pedantic ;
210     #CCWARN += -Wshadow ;
211     #CCWARN += -ansi ;
212    
213 jds 40 if $(NODEBUG)
214     {
215     CCDEBUG = -O3 ;
216     }
217     else
218     {
219     CCDEBUG = -g -O0 ;
220     }
221     BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
222     }
223    
224     CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ;
225     C++FLAGS = $(CCFLAGS) ;
226     BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
227    
228     #======================================================================
229     # Ascend-specific jam instructions
230     #======================================================================
231    
232     #----------------------------------------------------------------------
233     # LEX_or_copy
234     #
235     # Generates a c source file using the lexer defined by $(LEX),
236     # or by copying a specified file if $(LEX) is not defined.
237     # The following parameters are used:
238     #
239     # 1 source file to generate
240     # 2 lex/flex definition file
241     # 3 pre-generated source file to copy if $(LEX) is empty
242     # 4 header file associated with the source file, if any
243     #----------------------------------------------------------------------
244     rule LEX_or_copy
245     {
246     if $(LEX)
247     {
248     Echo Generating $(1) from $(LEX) ;
249     DEPENDS $(1) : $(2) ;
250     Lex_with_options $(1) : $(2) ;
251     }
252     else
253     {
254     Echo Copying $(1) from $(4) ;
255     File $(1) : $(3) ;
256     }
257    
258     # make the header dependent
259     if $(4)
260     {
261     INCLUDES $(1) : $(4) ;
262     }
263    
264     Clean clean : $(1) ;
265     }
266    
267     # run LEX using options specified in LEXOPTS
268     actions Lex_with_options
269     {
270     $(LEX) $(LEXOPTS) -o$(1) $(2)
271     }
272    
273    

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