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

Contents of /trunk/jam/Jamrules_general.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 43 - (show annotations) (download)
Wed Feb 16 21:13:33 2005 UTC (19 years, 4 months ago) by jds
File size: 7395 byte(s)
Minor update to jam build files.
1 #
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 if $(BCCROOT) || ($(TOOLSET) = BORLANDC)
117 {
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 else if $(MSVCNT) || $(TOOLSET) = VISUALC)
135 {
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 else if $(MINGW) || $(TOOLSET) = MINGW)
159 {
160 FORTRANFLAGS = -c -I4 -O ;
161 F77_LIBS += $(MINGW)$(SLASH)lib$(SLASH)libg2c.a ;
162
163 # uncomment to compile as strict ansi with full warnings
164 #CCWARN = -ansi -Wall -W -pedantic -Wshadow ;
165
166 if $(NODEBUG)
167 {
168 CCDEBUG = -O3 ;
169 }
170 else
171 {
172 CCDEBUG = -g -O0 ;
173 }
174 C++FLAGS = $(CCFLAGS) ;
175 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)mingw ;
176 }
177
178 else if $(WATCOM) || $(TOOLSET) = WATCOM)
179 {
180 FORTRANFLAGS = /NOER ;
181 CCFLAGS += /fr /dMOD_ASCMALLOC ;
182 CCWARN = /wx ;
183 if $(NODEBUG)
184 {
185 CCDEBUG = /ox ;
186 FORTRANFLAGS += /OX ;
187 }
188 else
189 {
190 CCDEBUG = /od /d2 ;
191 FORTRANFLAGS += /OD /D2 ;
192 }
193 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)watcom ;
194 }
195 }
196
197 else if $(OS) = LINUX
198 {
199 SUFSHR = .so ;
200 FORTRANFLAGS = -c -I4 -O -lg2c ;
201
202 # uncomment to compile as strict ansi with full warnings
203 #CCWARN = -ansi -Wall -W -pedantic -Wshadow ;
204 if $(NODEBUG)
205 {
206 CCDEBUG = -O3 ;
207 }
208 else
209 {
210 CCDEBUG = -g -O0 ;
211 }
212 BUILD_SUBDIR = $(BUILD_SUBDIR)$(SLASH)linux ;
213 }
214
215 CCFLAGS += $(CCWARN) $(CCDEBUG) $(DEBUG_MALLOC) ;
216 C++FLAGS = $(CCFLAGS) ;
217 BUILD_DIR = $(BUILD_DIR_ROOT)$(BUILD_SUBDIR) ;
218
219 #======================================================================
220 # Ascend-specific jam instructions
221 #======================================================================
222
223 #----------------------------------------------------------------------
224 # LEX_or_copy
225 #
226 # Generates a c source file using the lexer defined by $(LEX),
227 # or by copying a specified file if $(LEX) is not defined.
228 # The following parameters are used:
229 #
230 # 1 source file to generate
231 # 2 lex/flex definition file
232 # 3 pre-generated source file to copy if $(LEX) is empty
233 # 4 header file associated with the source file, if any
234 #----------------------------------------------------------------------
235 rule LEX_or_copy
236 {
237 if $(LEX)
238 {
239 Echo Generating $(1) from $(LEX) ;
240 DEPENDS $(1) : $(2) ;
241 Lex_with_options $(1) : $(2) ;
242 }
243 else
244 {
245 Echo Copying $(1) from $(4) ;
246 File $(1) : $(3) ;
247 }
248
249 # make the header dependent
250 if $(4)
251 {
252 INCLUDES $(1) : $(4) ;
253 }
254
255 Clean clean : $(1) ;
256 }
257
258 # run LEX using options specified in LEXOPTS
259 actions Lex_with_options
260 {
261 $(LEX) $(LEXOPTS) -o$(1) $(2)
262 }

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