1 #~ Copyright 2002-2007 Rene Rivera.
2 #~ Distributed under the Boost Software License, Version 1.0.
3 #~ (See accompanying file LICENSE_1_0.txt or copy at
4 #~ http://www.boost.org/LICENSE_1_0.txt)
6 # Clean env vars of any "extra" empty values.
7 for local v in ARGV CC CFLAGS LIBS
10 for local x in $($(v))
20 # Platform related specifics.
21 if $(OS) = NT { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; }
22 else { rule .path { return "$(<:J=/)" ; } }
24 if $(OS) = VMS { . = "_" ; }
28 # Info about what we are building.
31 VERSION = $(_VERSION_:J=$(.)) ;
33 LICENSE = LICENSE_1_0 ;
35 # Generate development debug binaries?
41 if --profile in $(ARGV)
46 # Attempt to generate and/or build the grammar?
47 if --grammar in $(ARGV)
52 # Do we need to add a default build type argument?
53 if ! ( --release in $(ARGV) ) &&
54 ! ( --debug in $(ARGV) ) &&
55 ! ( --profile in $(ARGV) )
60 # Enable, and configure, Python hooks.
62 python-location = [ MATCH --with-python=(.*) : $(ARGV) ] ;
71 --python-include = [ .path $(python-location) include ] ;
73 for local v in 27 26 25 24 23 22
76 [ GLOB [ .path $(python-location) libs ] : "python$(v).lib" ]
77 [ GLOB $(python-location) [ .path $(python-location) libs ]
78 $(Path) $(PATH) $(path) : "python$(v).dll" ]
80 if ! $(--python-lib[2])
85 --python-lib = $(--python-lib[1]) ;
87 else if $(OS) = MACOSX
89 --python-include = [ .path $(python-location) Headers ] ;
90 --python-lib = $(python-location) Python ;
96 for local v in 2.7 2.6 2.5 2.4 2.3 2.2
98 local inc = [ GLOB [ .path $(python-location) include ] : python$(v) ] ;
99 local lib = [ GLOB [ .path $(python-location) lib ] : libpython$(v)* ] ;
102 --python-include ?= $(inc) ;
103 --python-lib ?= $(lib[1]:D) python$(v) ;
109 if $(--python-include) || $(--python-lib)
111 ECHO "Python includes: $(--python-include:J=)" ;
112 ECHO "Python includes: $(--python-lib:J=)" ;
122 --extra-include += [ .path [ PWD ] "boehm_gc" "include" ] ;
132 --extra-include += [ .path [ PWD ] "duma" ] ;
135 # An explicit root for the toolset? (trim spaces)
136 toolset-root = [ MATCH --toolset-root=(.*) : $(ARGV) ] ;
138 local t = [ MATCH "[ ]*(.*)" : $(toolset-root:J=" ") ] ;
142 t = [ MATCH "([^ ]+)([ ]*)(.*)" : $(t) ] ;
143 toolset-root += $(t[1]) ;
144 if $(t[3]) { toolset-root += $(t[2]) ; }
147 toolset-root = $(toolset-root:J="") ;
150 # Configure the implemented toolsets. These are minimal commands and options to
151 # compile the full Jam. When adding new toolsets make sure to add them to the
154 rule toolset ( name command .type ? : opt.out + : opt.define * : flags * : linklibs * )
157 tool.$(name)$(.type).cc ?= $(command) ;
158 tool.$(name)$(.type).opt.out ?= $(opt.out) ;
159 tool.$(name)$(.type).opt.define ?= $(opt.define) ;
160 tool.$(name)$(.type).flags ?= $(flags) ;
161 tool.$(name)$(.type).linklibs ?= $(linklibs) ;
162 if ! $(name) in $(toolsets) { toolsets += $(name) ; }
165 rule if-os ( os + : yes-opt * : no-opt * )
166 { if $(os) in $(OS) { return $(yes-opt) ; } else { return $(no-opt) ; } }
168 rule opt ( type : yes-opt * : no-opt * )
169 { if $(type) in $(ARGV) { return $(yes-opt) ; } else { return $(no-opt) ; } }
171 ## HP-UX aCC compiler
172 toolset acc cc : "-o " : -D
174 [ opt --release : -s -O3 ]
175 [ opt --debug : -g -pg ]
176 -I$(--python-include) -I$(--extra-include)
177 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
179 toolset borland bcc32 : -e -n : /D
180 : -WC -w- -q "-I$(toolset-root)Include" "-L$(toolset-root)Lib"
181 [ opt --release : -O2 -vi -w-inl ]
182 [ opt --debug : -v -Od -vi- ]
183 -I$(--python-include) -I$(--extra-include)
184 : $(--python-lib[1]) ;
186 if ! $(CC) { CC = cc ; }
187 toolset cc $(CC) : "-o " : -D
189 [ opt --release : -s -O ]
191 -I$(--python-include) -I$(--extra-include)
192 : $(LIBS) -L$(--python-lib[1]) -l$(--python-lib[2]) ;
194 toolset como como : "-o " : -D
196 [ opt --release : --inlining ]
197 [ opt --debug : --no_inlining ]
198 -I$(--python-include) -I$(--extra-include)
199 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
201 toolset clang clang : "-o " : -D
202 : -Wno-unused -Wno-format
203 [ opt --release : -Os ]
204 [ opt --debug : -g -O0 -fno-inline ]
205 [ opt --profile : -finline-functions -g ]
206 -I$(--python-include) -I$(--extra-include)
207 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
208 ## MacOSX Darwin, using GCC 2.9.x, 3.x
209 toolset darwin cc : "-o " : -D
211 [ opt --release : -Wl,-x -O3 -finline-functions ]
212 [ opt --debug : -g -O0 -fno-inline -pg ]
213 [ opt --profile : -Wl,-x -O3 -finline-functions -g -pg ]
214 -I$(--python-include) -I$(--extra-include)
215 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
217 toolset gcc gcc : "-o " : -D
218 : -pedantic -fno-strict-aliasing
219 [ opt --release : [ opt --symbols : -g : -s ] -O3 ]
220 [ opt --debug : -g -O0 -fno-inline ]
221 [ opt --profile : -O3 -g -pg ]
222 -I$(--python-include) -I$(--extra-include) -Wno-long-long
223 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
224 ## GCC 2.x, 3.x on CYGWIN but without cygwin1.dll
225 toolset gcc-nocygwin gcc : "-o " : -D
227 [ opt --release : -finline-functions ]
228 [ opt --debug : -s -O3 -fno-inline -pg ]
229 -I$(--python-include) -I$(--extra-include)
230 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
231 ## Intel C/C++ for Darwin
232 toolset intel-darwin icc : "-o " : -D
234 [ opt --release : -O3 ]
235 [ opt --debug : -g -O0 -p ]
236 -I$(--python-include) -I$(--extra-include)
237 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
238 ## Intel C/C++ for Linux
239 toolset intel-linux icc : "-o " : -D
241 [ opt --release : -Xlinker -s -O3 ]
242 [ opt --debug : -g -O0 -p ]
243 -I$(--python-include) -I$(--extra-include)
244 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
245 ## Intel C/C++ for Win32
246 toolset intel-win32 icl : /Fe : -D
248 [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /GB ]
249 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 ]
250 -I$(--python-include) -I$(--extra-include)
251 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
253 toolset kcc KCC : "-o " : -D
255 [ opt --release : -s +K2 ]
256 [ opt --debug : -g +K0 ]
257 -I$(--python-include) -I$(--extra-include)
258 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
260 toolset kylix bc++ : -o : -D
262 [ opt --release : -O2 -vi -w-inl ]
263 [ opt --debug : -v -Od -vi- ]
264 -I$(--python-include) -I$(--extra-include)
265 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
266 ## Metrowerks CodeWarrior 8.x
268 # Even though CW can compile all files at once, it crashes if it tries in
270 local mwcc ; if $(OS) != NT { mwcc = mwc$(OSPLAT:L) ; }
272 toolset metrowerks $(mwcc) : "-o " : -D
273 : -c -lang c -subsystem console -cwd include
274 [ opt --release : -runtime ss -opt full -inline all ]
275 [ opt --debug : -runtime ssd -opt none -inline off ]
276 -I$(--python-include) -I$(--extra-include) ;
277 toolset metrowerks $(mwcc) .link : "-o " :
278 : -subsystem console -lkernel32.lib -ladvapi32.lib -luser32.lib
279 [ opt --release : -runtime ss ]
280 [ opt --debug : -runtime ssd ]
281 : $(--python-lib[1]) ;
284 toolset mipspro cc : "-o " : -D
286 [ opt --release : -s -O3 -g0 -INLINE:none ]
287 [ opt --debug : -g -O0 -INLINE ]
288 -I$(--python-include) -I$(--extra-include)
289 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
290 ## Microsoft Visual Studio C++ 6.x
291 toolset msvc cl : /Fe /Fe /Fd /Fo : -D
293 [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ]
294 [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ]
295 -I$(--python-include) -I$(--extra-include)
296 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
297 ## QNX 6.x GCC 3.x/2.95.3
298 toolset qcc qcc : "-o " : -D
299 : -Wc,-pedantic -Wc,-fno-strict-aliasing
300 [ opt --release : [ opt --symbols : -g ] -O3 -Wc,-finline-functions ]
301 [ opt --debug : -g -O0 -Wc,-fno-inline ]
302 -I$(--python-include) -I$(--extra-include)
303 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
304 ## Qlogic Pathscale 2.4
305 toolset pathscale pathcc : "-o " : -D
307 [ opt --release : -s -O3 ]
309 -I$(--python-include) -I$(--extra-include)
310 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
311 ## Portland Group Pgi 6.2
312 toolset pgi pgcc : "-o " : -D
314 [ opt --release : -s -O3 ]
316 -I$(--python-include) -I$(--extra-include)
317 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
318 ## Sun Workshop 6 C++
319 toolset sun cc : "-o " : -D
321 [ opt --release : -s -xO3 ]
323 -I$(--python-include) -I$(--extra-include)
324 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
325 ## Sun Workshop 6 C++ (old alias)
326 toolset sunpro cc : "-o " : -D
328 [ opt --release : -s -xO3 ]
330 -I$(--python-include) -I$(--extra-include)
331 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
333 toolset tru64cxx cc : "-o " : -D
335 [ opt --release : -s -O5 -inline speed ]
336 [ opt --debug : -g -O0 -pg ]
337 -I$(--python-include) -I$(--extra-include)
338 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
339 ## IBM VisualAge C++ or IBM XL C/C++ for Aix or IBM XL C/C++ for Linux (Big endian)
340 toolset vacpp xlc : "-o " : -D
342 [ opt --release : -s -O3 -qstrict -qinline ]
343 [ opt --debug : -g -qNOOPTimize -qnoinline -pg ]
344 -I$(--python-include) -I$(--extra-include)
345 : -L$(--python-lib[1]) -l$(--python-lib[2]) [ if-os AIX : -bmaxdata:0x40000000 ] ;
347 ## IBM XL C/C++ for Linux (little endian)
348 toolset xlcpp xlC : "-o " : -D
349 : -Wno-unused -Wno-format
350 [ opt --release : -s ]
351 [ opt --debug : -g -qNOOPTimize -qnoinline -pg ]
352 -I$(--python-include) -I$(--extra-include)
353 : -L$(--python-lib[1]) -l$(--python-lib[2]) ;
355 ## Microsoft Visual C++ .NET 7.x
356 toolset vc7 cl : /Fe /Fe /Fd /Fo : -D
358 [ opt --release : /ML /O2 /Ob2 /Gy /GF /GA /GB ]
359 [ opt --debug : /MLd /DEBUG /Z7 /Od /Ob0 ]
360 -I$(--python-include) -I$(--extra-include)
361 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
362 ## Microsoft Visual C++ 2005
363 toolset vc8 cl : /Fe /Fe /Fd /Fo : -D
365 [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
366 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
367 -I$(--python-include) -I$(--extra-include)
368 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
369 ## Microsoft Visual C++ 2008
370 toolset vc9 cl : /Fe /Fe /Fd /Fo : -D
372 [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
373 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
374 -I$(--python-include) -I$(--extra-include)
375 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
376 ## Microsoft Visual C++ 2010
377 toolset vc10 cl : /Fe /Fe /Fd /Fo : -D
379 [ opt --release : /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
380 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
381 -I$(--python-include) -I$(--extra-include)
382 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
383 ## Microsoft Visual C++ 2012
384 toolset vc11 cl : /Fe /Fe /Fd /Fo : -D
386 [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
387 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
388 -I$(--python-include) -I$(--extra-include)
389 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
390 ## Microsoft Visual C++ 2013
391 toolset vc12 cl : /Fe /Fe /Fd /Fo : -D
393 [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
394 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
395 -I$(--python-include) -I$(--extra-include)
396 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
397 ## Microsoft Visual C++ 2015
398 toolset vc14 cl : /Fe /Fe /Fd /Fo : -D
400 [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
401 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
402 -I$(--python-include) -I$(--extra-include)
403 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
404 toolset vc15 cl : /Fe /Fe /Fd /Fo : -D
406 [ opt --release : /GL /MT /O2 /Ob2 /Gy /GF /GA /wd4996 ]
407 [ opt --debug : /MTd /DEBUG /Z7 /Od /Ob0 /wd4996 ]
408 -I$(--python-include) -I$(--extra-include)
409 : kernel32.lib advapi32.lib user32.lib $(--python-lib[1]) ;
411 toolset vmsdecc cc : /OBJECT= : "/DEFINES=(" "," ")"
412 : /STANDARD=VAXC /PREFIX_LIBRARY_ENTRIES=(ALL_ENTRIES)
413 [ opt --release : /OPTIMIZE /NODEBUG /WARN=DISABLE=(LONGEXTERN) ]
414 [ opt --debug : /NOOPTIMIZE /DEBUG ] ;
415 toolset vmsdecc LINK .link : /EXECUTABLE= :
417 [ opt --release : /NODEBUG ]
418 [ opt --debug : /DEBUG ] ;
420 # First set the build commands and options according to the
422 toolset = [ MATCH --toolset=(.*) : $(ARGV) ] ;
425 # For some reason, the following test does not catch empty toolset.
427 ECHO "###" No toolset specified. Please use --toolset option. ;
429 ECHO "###" Known toolsets are: $(toolsets:J=", ") ;
432 if ! $(toolset) in $(toolsets)
435 ECHO "###" Unknown toolset: $(toolset) ;
437 ECHO "###" Known toolsets are: $(toolsets:J=", ") ;
440 --cc = $(tool.$(toolset).cc) ;
441 if $(tool.$(toolset).opt.out[2])
443 if $(tool.$(toolset).opt.out[1]) = $(tool.$(toolset).opt.out[2])
445 --out = $(tool.$(toolset).opt.out[1]) ;
446 --dir = $(tool.$(toolset).opt.out[3-]) ;
450 --bin = $(tool.$(toolset).opt.out[1]) ;
451 --dir = $(tool.$(toolset).opt.out[2-]) ;
456 --out = $(tool.$(toolset).opt.out) ;
458 --def = $(tool.$(toolset).opt.define) ;
459 --flags = $(tool.$(toolset).flags) ;
460 --defs = $(tool.$(toolset).defines) ;
461 --libs = $(tool.$(toolset).linklibs) ;
462 if $(tool.$(toolset).link.cc)
464 --link = $(tool.$(toolset).link.cc) ;
465 if $(tool.$(toolset).link.opt.out[2])
467 if $(tool.$(toolset).link.opt.out[1]) = $(tool.$(toolset).link.opt.out[2])
469 --link-out = $(tool.$(toolset).link.opt.out[1]) ;
470 --link-dir = $(tool.$(toolset).link.opt.out[3-]) ;
474 --link-bin = $(tool.$(toolset).link.opt.out[1]) ;
475 --link-dir = $(tool.$(toolset).link.opt.out[2-]) ;
480 --link-out = $(tool.$(toolset).link.opt.out) ;
482 --link-def = $(tool.$(toolset).link.opt.define) ;
483 --link-flags = $(tool.$(toolset).link.flags) ;
484 --link-defs = $(tool.$(toolset).link.defines) ;
485 --link-libs = $(tool.$(toolset).link.linklibs) ;
488 # Put executables in platform-specific subdirectory.
489 locate-target = $(LOCATE_TARGET) ;
492 locate-target ?= bin$(.)$(OS:L)$(OSPLAT:L) ;
493 platform = $(OS:L)$(OSPLAT:L) ;
497 locate-target ?= bin$(.)$(OS:L) ;
502 locate-target = [ .path $(locate-target)$(.)debug ] ;
506 locate-target = [ .path $(locate-target)$(.)profile ] ;
510 locate-target = [ .path $(locate-target) ] ;
513 if --show-locate-target in $(ARGV)
515 ECHO $(locate-target) ;
518 # We have some different files for UNIX, VMS, and NT.
520 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c
521 hash.c hcache.c headers.c hdrmacro.c jam.c jambase.c jamgram.c lists.c
522 make.c make1.c mem.c object.c option.c output.c parse.c pathsys.c regexp.c
523 rules.c scan.c search.c subst.c w32_getreg.c timestamp.c variable.c
524 modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c
525 [ .path modules set.c ] [ .path modules path.c ] [ .path modules regex.c ]
526 [ .path modules property-set.c ] [ .path modules sequence.c ] [ .path modules order.c ] ;
529 jam.source += execnt.c filent.c pathnt.c ;
533 jam.source += execvms.c filevms.c pathvms.c ;
534 --flags += /INCLUDE=(\""./modules"\") ;
538 jam.source += execunix.c fileunix.c pathunix.c ;
541 # Debug assertions, or not.
542 if ! $(debug) || --noassert in $(ARGV)
547 # Enable some optional features.
548 --defs += OPT_HEADER_CACHE_EXT ;
549 --defs += OPT_GRAPH_DEBUG_EXT ;
550 --defs += OPT_SEMAPHORE ;
551 --defs += OPT_AT_FILES ;
552 --defs += OPT_DEBUG_PROFILE ;
555 --defs += OPT_FIX_TARGET_VARIABLES_EXT ;
556 #~ --defs += OPT_NO_EXTERNAL_VARIABLE_SPLIT ;
559 --defs += OPT_IMPROVED_PATIENCE_EXT ;
561 # Use Boehm GC memory allocator?
564 --defs += OPT_BOEHM_GC ;
576 if ( $(OS) = NT ) && ! NT in $(--defs)
584 --defs += YYSTACKSIZE=5000 ;
588 --defs += HAVE_PYTHON ;
593 --defs += BJAM_NEWSTR_NO_ALLOCATE ;
597 # The basic symbolic targets...
598 NOTFILE all clean dist ;
601 # Utility rules and actions...
604 [DELETE] clean : $(<) ;
606 if $(OS) = NT { actions piecemeal together existing [DELETE] {
609 if $(UNIX) = true { actions piecemeal together existing [DELETE] {
612 if $(OS) = VMS { actions piecemeal together existing [DELETE] {
613 DELETE /NOCONF $(>:WJ=;*, );*
616 --chmod+w = "attrib -r " ;
619 --chmod+w = "chmod +w " ;
622 --chmod+w = "SET FILE/PROT=(W:RWED) " ;
628 if $(<:P) { DEPENDS $(<) : $(<:P) ; .mkdir $(<:P) ; }
629 if ! $(md<$(<)>) { [MKDIR] $(<) ; md<$(<)> = - ; }
631 if $(OS) = NT { actions [MKDIR] {
634 if $(UNIX) = true { actions [MKDIR] {
637 if $(OS) = VMS { actions [MKDIR] {
638 CREATE/DIR $(<:WJ=, )
644 if $(OS) = NT || ( $(UNIX) = true && $(OS) = CYGWIN ) || $(OS) = VMS { exe = $(exe:S=.exe) ; }
645 LOCATE on $(exe) = $(locate-target) ;
646 DEPENDS all : $(exe) ;
647 .mkdir $(locate-target) ;
653 # Translate any subdir elements into a simple file name.
654 local o = [ MATCH "([^/]+)[/]?(.+)" : $(s) ] ;
658 if $(OS) = VMS { o = $(o:S=.obj) ; }
660 LOCATE on $(o) = $(locate-target) ;
661 DEPENDS $(exe) : $(o) ;
662 DEPENDS $(o) : $(s) ;
663 DEPENDS $(o) : $(locate-target) ;
664 [COMPILE] $(o) : $(s) ;
667 DEPENDS $(exe) : $(objs) ;
668 DEPENDS $(exe) : $(locate-target) ;
669 [COMPILE.LINK] $(exe) : $(objs) ;
674 DEPENDS $(exe) : $(>) ;
675 DEPENDS $(exe) : $(locate-target) ;
676 [COMPILE] $(exe) : $(>) ;
682 if $(OS) = VMS { actions [COMPILE] {
683 $(--cc) $(--bin)$(<:WD=) $(--dir)$(<:D)$(./) $(--out)$(<:W) $(--def[1])$(--defs:J=$(--def[2]))$(--def[3]) $(--flags) $(>:W) $(--libs)
685 else if ! $(--def[2]) { actions [COMPILE] {
686 "$(--cc)" "$(--bin)$(<:D=)" "$(--dir)$(<:D)$(./)" $(--out)$(<) "$(--def)$(--defs)" "$(--flags)" "$(>)" "$(--libs)"
688 else { actions [COMPILE] {
689 "$(--cc)" "$(--bin)$(<:D=)" "$(--dir)$(<:D)$(./)" $(--out)$(<) "$(--def[1])$(--defs:J=$(--def[2]))$(--def[3])" "$(--flags)" "$(>)" "$(--libs)"
692 if $(OS) = VMS { actions [COMPILE.LINK] {
693 $(--link) $(--link-bin)$(<:WD=) $(--link-dir)$(<:WD)$(./) $(--link-out)$(<:W) $(--link-def)$(--link-defs) $(--link-flags) $(--link-libs) $(>:WJ=, )
695 else { actions [COMPILE.LINK] {
696 "$(--link)" "$(--link-bin)$(<:D=)" "$(--link-dir)$(<:D)$(./)" "$(--link-out)$(<)" "$(--link-def)$(--link-defs)" "$(--link-flags)" "$(>)" "$(--link-libs)"
702 DEPENDS $(<) : $(>) ;
706 if $(OS) = NT { actions [LINK] {
709 if $(UNIX) = true { actions [LINK] {
712 if $(OS) = VMS { actions [LINK] {
713 COPY/REPLACE $(>:W) $(<:W)
719 DEPENDS $(<) : $(>) ;
724 # Will be redefined later.
725 if $(OS) = VMS { actions [COPY] {
726 COPY/REPLACE $(>:W) $(<:W)
728 else { actions [COPY] {
734 DEPENDS $(<) : $(>) ;
737 if $(OS) = NT { actions [MOVE] {
741 if $(UNIX) = true { actions [MOVE] {
744 if $(OS) = VMS { actions [MOVE] {
745 RENAME /NOCONF $(>:W) $(<:W)
748 # Generate the grammar tokens table, and the real yacc grammar.
751 local exe = [ .exe yyacc : yyacc.c ] ;
753 DEPENDS $(<) : $(exe) $(>) ;
755 yyacc.exe on $(<) = $(exe:R=$(locate-target)) ;
756 [YYACC] $(<) : $(>) ;
761 "$(yyacc.exe)" "$(<)" "$(>)"
765 .yyacc jamgram.y jamgramtab.h : jamgram.yy ;
769 .exe yyacc : yyacc.c ;
772 # How to build the grammar.
776 # try some other likely spellings...
782 yacc ?= [ GLOB $(PATH) : yacc$(SUFEXE) ] ;
783 yacc ?= [ GLOB $(PATH) : bison$(SUFEXE) ] ;
784 yacc ?= [ GLOB "$(ProgramFiles:J= )\\GnuWin32\\bin"
785 "C:\\Program Files\\GnuWin32\\bin" : bison$(SUFEXE) ] ;
789 case bison : yacc += -d --yacc ;
790 case yacc : yacc += -d ;
792 if $(debug) && $(yacc)
796 yacc += $(YACCFLAGS) ;
800 DEPENDS $(<) : $(>) ;
804 if $(OS) = NT { actions [YACC] {
806 if not errorlevel 1 (
808 rename y.tab$(<[1]:S) "$(<[1])"
810 rename y.tab$(<[2]:S) "$(<[2])"
813 if $(UNIX) = true { actions [YACC] {
814 if ` "$(yacc)" "$(>)" ` ; then
815 mv -f y.tab$(<[1]:S) "$(<[1])"
816 mv -f y.tab$(<[2]:S) "$(<[2])"
821 if $(OS) = VMS { actions [YACC] {
824 RENAME /NOCONF y_tab$(<[1]:S) $(<[1]:W)
825 RENAME /NOCONF y_tab$(<[2]:S) $(<[2]:W)
828 if $(grammar) && ! $(yacc)
830 EXIT Could not find the 'yacc' tool, and therefore can not build the
833 if $(grammar) && $(yacc)
835 .yacc jamgram.c jamgram.h : jamgram.y ;
838 # How to build the compiled in jambase.
841 local exe = [ .exe mkjambase : mkjambase.c ] ;
842 DEPENDS $(<) : $(exe) $(>) ;
844 mkjambase.exe on $(<) = $(exe:R=$(locate-target)) ;
845 [MKJAMBASE] $(<) : $(>) ;
847 actions [MKJAMBASE] {
849 $(mkjambase.exe) "$(<)" "$(>)"
853 .mkjambase jambase.c : Jambase ;
859 $(>).exe = [ .exe $(>) : $(jam.source) ] ;
860 DEPENDS all : $($(>).exe) ;
862 # Make a copy under the old name.
863 $(<).exe = $(<:S=$($(>).exe:S)) ;
864 LOCATE on $($(<).exe) = $(locate-target) ;
865 .copy $($(<).exe) : $($(>).exe) ;
866 DEPENDS all : $($(<).exe) ;
871 # Scan sources for header dependencies.
873 # In order to keep things simple, we made a slight compromise here - we only
874 # detect changes in headers included relative to the current folder as opposed
875 # to those included from somewhere on the include path.
876 rule .scan ( targets + )
878 HDRRULE on $(targets) = .hdr.scan ;
879 HDRSCAN on $(targets) = "^[ \t]*#[ \t]*include[ \t]*\"([^\"]*)\".*$" ;
881 rule .hdr.scan ( target : includes * : binding )
883 local target-path = [ NORMALIZE_PATH $(binding:D) ] ;
884 # Extra grist provides target name uniqueness when referencing same name
885 # header files from different folders.
886 local include-targets = <$(target-path)>$(includes) ;
887 NOCARE $(include-targets) ;
888 INCLUDES $(target) : $(include-targets) ;
889 SEARCH on $(include-targets) = $(target-path) ;
890 ISFILE $(include-targets) ;
891 .scan $(include-targets) ;
893 .scan $(jam.source) ;
896 # Distribution making from here on out. Assumes that the docs are already built
897 # as HTML at ../doc/html. Otherwise they will not be included in the built
898 # distribution archive.
900 [ GLOB . : $(LICENSE).txt ]
902 dist.license = $(dist.license:D=)
903 [ GLOB [ .path .. .. .. ] : $(LICENSE).txt ]
904 [ GLOB [ .path .. boost ] : $(LICENSE).txt ] ;
906 [ GLOB . : *.png *.css *.html ]
908 dist.docs = $(dist.docs:D=)
909 [ GLOB [ .path images ] : *.png ]
910 [ GLOB [ .path jam ] : *.html ]
915 dist.source = $(dist.source:D=)
918 build.jam build.bat build.sh build_vms.com
921 [ .path modules set.c ]
922 [ .path modules path.c ]
923 [ .path modules regex.c ]
924 [ .path modules property-set.c ]
925 [ .path modules sequence.c ]
926 [ .path modules order.c ]
927 [ GLOB [ .path boehm_gc ] : * ]
928 [ GLOB [ .path boehm_gc include ] : * ]
929 [ GLOB [ .path boehm_gc include private ] : * ]
930 [ GLOB [ .path boehm_gc cord ] : * ]
931 [ GLOB [ .path boehm_gc Mac_files ] : * ]
932 [ GLOB [ .path boehm_gc tests ] : * ]
933 [ GLOB [ .path boehm_gc doc ] : * ]
940 $(dist.bin:S=$(bjam.exe:S))
945 zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7z.exe" ] ;
946 zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7zn.exe" ] ;
947 zip ?= [ GLOB $(PATH) : zip.exe ] ;
952 case 7z* : zip += a -r -tzip -mx=9 ;
953 case zip : zip += -9r ;
955 actions piecemeal [PACK] {
956 "$(zip)" "$(<)" "$(>)"
958 actions piecemeal [ZIP] {
959 "$(zip)" "$(<)" "$(>)"
961 actions piecemeal [COPY] {
962 copy /Y "$(>)" "$(<)" >NUL:
967 tar ?= [ GLOB $(PATH) : star bsdtar tar ] ;
971 case star : tar += -c artype=pax -D -d -to-stdout ;
972 case * : tar += -c -f - ;
975 "$(tar)" "$(>)" | gzip -c9 > "$(<)"
978 #~ tar cf "$(<:S=.tar)" "$(>)"
981 gzip -c9 "$(>)" > "$(<)"
984 cp -Rpf "$(>)" "$(<)"
988 # The single binary, compressed.
992 if $(OS) = NT { zip = $($(<).exe:S=.zip) ; }
993 if $(UNIX) = true { zip = $($(<).exe:S=.tgz) ; }
994 zip = $(zip:S=)-$(VERSION)-$(RELEASE)-$(platform)$(zip:S) ;
995 DEPENDS $(zip) : $($(<).exe) ;
996 DEPENDS dist : $(zip) ;
997 #~ LOCATE on $(zip) = $(locate-target) ;
998 if $(OS) = NT { [ZIP] $(zip) : $($(<).exe) ; }
999 if $(UNIX) = true { [PACK] $(zip) : $($(<).exe) ; }
1003 # Package some file.
1004 rule .package ( dst-dir : src-files + )
1007 local src-files-actual ;
1008 for local src-path in $(src-files)
1010 if ! [ GLOB $(src-path:P) : $(src-path:B) ] || [ CHECK_IF_FILE $(src-path) ]
1012 local src-subdir = $(src-path:D) ;
1013 local src-file = $(src-path) ;
1014 while $(src-subdir:D) { src-subdir = $(src-subdir:D) ; }
1015 if $(src-subdir) = ".."
1017 src-file = $(src-file:D=) ;
1019 dst-files += $(src-file:R=$(dst-dir)) ;
1020 src-files-actual += $(src-path) ;
1025 if $(OS) = NT { pack = $(dst-dir).zip ; }
1026 if $(UNIX) = true { pack = $(dst-dir).tgz ; }
1028 DEPENDS dist : $(pack) ;
1029 DEPENDS $(pack) : $(dst-files) ;
1031 local dst-files-queue = $(dst-files) ;
1032 for local src-path in $(src-files-actual)
1034 local dst-file = $(dst-files-queue[1]) ;
1035 dst-files-queue = $(dst-files-queue[2-]) ;
1036 DEPENDS $(dst-file) : $(src-path) $(dst-file:D) ;
1037 .mkdir $(dst-file:D) ;
1039 [COPY] $(dst-file) : $(src-path) ;
1040 .clean $(dst-file) ;
1043 [PACK] $(pack) : $(dst-files) ;
1048 rpm-tool = [ GLOB $(PATH) : "rpmbuild" ] ;
1049 rpm-tool ?= [ GLOB $(PATH) : "rpm" ] ;
1050 rpm-tool = $(rpm-tool[1]) ;
1051 rule .rpm ( name : source )
1056 case X86 : rpm-arch ?= i386 ;
1057 case PPC : rpm-arch ?= ppc ;
1058 case AXP : rpm-arch ?= alpha ;
1059 # no guaranty for these:
1060 case IA64 : rpm-arch ?= ia64 ;
1061 case ARM : rpm-arch ?= arm ;
1062 case SPARC : rpm-arch ?= sparc ;
1063 case * : rpm-arch ?= other ;
1065 local target = $(name)-rpm ;
1067 DEPENDS dist : $(target) ;
1068 DEPENDS $(target) : $(name).$(rpm-arch).rpm $(name).src.rpm ;
1069 DEPENDS $(name).$(rpm-arch).rpm : $(source) ;
1070 DEPENDS $(name).src.rpm : $(name).$(rpm-arch).rpm ;
1071 docs on $(target) = $(dist.docs:J=" ") ;
1072 arch on $(target) = $(rpm-arch) ;
1073 if $(rpm-arch) = ppc { target-opt on $(target) = --target= ; }
1074 else { target-opt on $(target) = "--target " ; }
1075 [RPM] $(target) : $(source) ;
1076 .clean $(name).$(rpm-arch).rpm $(name).src.rpm ;
1080 export BOOST_JAM_TOOLSET="$(toolset)"
1081 $(rpm-tool) -ta $(target-opt)$(arch) $(>) | tee rpm.out
1082 cp `grep -e '^Wrote:' rpm.out | sed 's/^Wrote: //'` .
1086 # The distribution targets. Do not bother with them unless this is a
1087 # distribution build.
1091 .package $(NAME)-$(VERSION) : $(dist.source) ;
1092 .package $(NAME)-$(VERSION)-$(RELEASE)-$(platform) : $(dist.bin) ;
1095 #~ .rpm $(NAME)-$(VERSION)-$(RELEASE) : $(NAME)-$(VERSION).tgz ;