1 [+] PWD/Pwd built-in added; usage:
3 [+] SORT/Sort built-in added; usage:
4 sorted = [ SORT $(list) ] ;
5 [+] COMMAND/Command built-in added; usage:
6 res = [ COMMAND shellcmd-list [[ : options ]] ];
8 exit-status, exit-code:
9 return exit code as last list element
11 don't return command output
13 don't trim command output;
14 default: trim left and right
16 don't left-trim command output
18 don't right-trim command output
19 status-first, code-first:
22 parse output as list (break on whitespaces -- <= ' ')
24 don't break on spaces (' ') when 'parse-output' activated
26 don't break on tabs ('\t') when 'parse-output' activated
27 no-nl-break, no-lf-break:
28 don't break on LF ('\n') when 'parse-output' activated
30 don't break on CR ('\r') when 'parse-output' activated
31 default: ignore command output, return empty string if everything is ok
32 or numeric exit code (non-zero)
33 [+] COMMAND/Command built-in synthax changed; new synthax:
34 res = [ COMMAND shellcmd-list [[ : options ]] ];
35 new options (added to common description)
36 [+] COMMAND/Command built-in now can parse command output
39 # VAR = [ RemoveOpt options-to-remove : options-list ] ;
40 # remove options from list
41 [+] rule RemoveOptWild
42 # VAR = [ RemoveOpt regexp-options-to-remove : options-list ] ;
43 # remove options from list with egrep-like regexps
46 # set compile flags for profile; works only for gcc/g++
48 # none, default: don't change
49 # empty: remove optimisation flags
50 # speed: optimise for speed and pIII
51 # size: optimise for size
52 # debug: don't optimize, add debug info
54 [+] rule ObjectNoAliasing
55 # ObjectNoAliasing filelist ;
56 # turn off aliasing optimization for specified files
57 # works only for gcc/g++
59 [*] MainC++ wasn't working properly
60 [*] XXXC++ variables changed to XXXC++ZZZ (MainC++ --> C++Main)
61 [+] LOCATE_BIN and ALL_LOCATE_BIN variables added (for Main and MainC++ targets)
62 so now one can do something like this:
63 ALL_LOCATE_TARGET = $(TOP)/build/obj ;
64 ALL_LOCATE_BIN = $(TOP)/build ;
65 and have a nice bunch of *.o files in build/obj and binary in build/
66 [+] new rule: lib-config
67 call $(1) --cflags and $(1) --libs (many libs provides such configurators)
68 add necessary flags to compiler and linker vars
69 return "tan" (non-empty string) if library is present
70 if $(2) != "" -- don't add flags, just check
71 [+] PATH_SEPARATOR variable added
72 [*] build process changed (.o and .a moved to subdir)
73 [+] allow []...] and [^]...] in globs (so ranges can include ']')
74 [+] :Q now quotes all special shell chars, not only '\'
75 [*] some regexprs was broken by tab expansion; fixed
76 [*] OPTIMC++ renamed to C++OPTIM
78 [+] LOCATE_LIB, LOCATE_LIBSO and ALL_LOCATE_LIB[SO] variables added (for Library and SharedLibrary targets)
79 so now one can do something like this:
80 ALL_LOCATE_TARGET = $(TOP)/build/obj ;
81 ALL_LOCATE_LIB = $(TOP)/build/liba ;
82 ALL_LOCATE_LIBSO = $(TOP)/build/libso ;
83 ALL_LOCATE_BIN = $(TOP)/build ;
84 and have a nice bunch of files in various dirs.
86 [*] JAMCMDARGS now set before parsing Jamfiles (and what sense was to set it after? %-)
87 [+] JAM_TARGETS variable added; scripts are free to modify it, so we can easy define targets from whithin
89 [+] SubIncludeOnce varname : TOP ... ;
90 will do SubInclude iff 'varname' is not set (and will set 'varname')
91 so one can include all necessary libraries in all necessary projects
93 [+] partial Objective C support:
94 ObjC-Main, std. set of OBJC* vars
95 OBJC_GNUSTEP_BASE_LIB = gnustep-base ;
96 OBJC_GNUSTEP_GUI_LIB = gnustep-gui ;
97 rules: ObjCUseGNUstepBase, ObjCUseGNUstepGui, ObjCUseGNUstep
99 [+] 'lib-config-ex' rule:
100 lib-config-ex "command" : "var-name-to-modify"
101 "var-name-to-modify" can be omited;
102 rule returs value of command
105 Echo-n: same as Echo, but does not writes '\n'
106 O-Flush: flush standard output (for Echo-n)
107 [+] added rules: LinkFlagsOn, C++LinkFlagsOn, ObjCLinkFlagsOn
108 same as Object*Flags, but for linker flags
109 we need this due to 'gristing' in multidir builds
111 [+] new variable: JAM_FORCE_GCC_OPTIONS
112 set it to override GCC detection
114 [+] rule set-profile:
115 selects 'debug', 'standard', 'speed' or 'size' profile according to vars:
118 OPT_SPEED = 1 : speed
121 [+] rule set-default-subdir-locates (sets my defaults for ALL_LOCATE_XXX: _build/, etc)
123 [+] alias for set-default-subdir-locates: set-default-target-locations ;
127 [+] jam now correctly creates dirs for files like 'dir/source'
128 [+] alias for set-default-subdir-locates: set-default-locations ;
130 [+] added acions for WINDOZE=1 (my own way to cross-build windoze soft with wine and mingw)
132 WINE -- wine command; default is "wine"
133 MGPATH -- path to mingw bin dir; default is "c:\mingw\bin\" (note the last '\')
134 MGCC -- mingw gcc compiler name; default is "mingw32-gcc.exe";
135 MG -- mingw g++ compiler name; default is "mingw32-g++.exe -static-libgcc"
136 vars for 'windoze-fix' rule (this rule should be invoked in Jamrules; it is harmless to
137 invoke it for any build scheme):
138 WINDOZE_THREADS -- if not empty, add "-mthreads"
139 WINSUBSYS -- either 'console' or 'windows'; default is 'console'
140 WINLIBS -- list of windoze libraries to add; default is '-lkernel32'
142 [!] WARNING! COMPATIBILITY BREAKING CHANGE!
143 [*] old SubInclude rule renamed to SubIncludeMany
144 [*] new SubInclude rule works as SubIncludeOnce (autogenerates guard var)
146 [+] new built-in: [ ExprI1 num0 op num1 ]
147 integer math; understands 5 standard ops ('%' as C '%')
148 [ ExprI1 40 + 2 ] ==> "42"
149 it also understands "<", "<=", ">", ">=", "=" and "!="
150 [+] [ ExprI1 "#" string ] -- return string length
151 [+] new built-in: [ Split str : delims ]
152 split `str` using `delims`
153 [ Split "a,b,c;d" : ",;" ] ==> a b c d
154 if `delims` is not specified, split string to chars
156 [+] lexer now needs less spaces (and sometimes more quoting)
157 [+] added header caching (when using set-default-locations rule)
159 [+] new build-in: [ NormPath pathstr ]
160 it will add 'pwd' if path is not absolute and will try to resolve some '.' and '..'
161 (only leading '..' though).
162 it can be used in SubDir replacement to automate dir building
164 [+] added 'rule name expansion':
165 rule print-foo { Echo "foo" ; }
169 [+] added default 'help' and 'push' targets
170 redefine actions AShowHelp and AGitPush in Jamrules to use the correspoinding target
172 [+] added help-profile target
174 [+] new variables: CFLAGS.all, OPTIM.all, LINKFLAGS.all, LINKLIBS.all
175 profile now sets *.all flags
177 [+] K8JAM-PROGRESS-TIME-DELTA variable (float, seconds between progress/time indicator)
179 [+] regexp engine now undestands some character classes (like :space:) and non-greedy ops
181 [+] call 'check-setup-windoze' rule to enable WINDOZE=1 builds
182 [+] setup-windoze rule will setup windoze build regardless of WINDOZE=1
183 [+] call use-mingw32 rule to use i686-pc-mingw32 crosscompiler instead of wine
184 [+] call windoze-fix after setting WINDOZE_THREADS, WINLIBS and WINSUBSYS
186 [+] sys-has-command cmd -- perform `which`, return "tan" or ""
188 [+] new built-in: ListLength
190 [+] `PreUserObject` rule
191 this rule will be called before `Object` rule decides how to build something;
192 the calling convention is the same as for `UserObject`, but `PreUserObject`
193 should return non-empty string if it wants to bypass default generator rules.
195 [+] documentation: built-in DependsList
197 returns a list of child dependencies for a given target
199 [+] new built-ins: HaveRule, HaveActions
200 HaveRule rulename [rulename...] [ : glob/regexp case-insensitive ignore-case ]
201 HaveActions rulename [rulename...] [ : glob/regexp case-insensitive ignore-case ]
202 returns non-empty string if all specified rules or actions are defined
203 note that we can have rule without actions and actions without rule
204 specify `glob` option to treat names as shell-like globs
205 specify `regexp` option to treat names as regexps
206 specify `case-insensitive` option to ignore case
208 [+] new built-in: ForceFile
209 reverts NoFile effect
211 [+] added flags to Glob and Match: now we can use globs and regexps, and do
212 that ignoring the case.
214 [+] new rule: FileExists fname [fname...] ;
215 returns non-empty string if all files exists; understand pathes.
230 [+] set-default-locations now recognizes DEBUG and respects BUILD_DIR
232 [+] new variables: CC.standard and C++.standard; defaults to gnu99 and gnu++98 if set-profile called
234 [+] new rule: DetectLibrary libnames [: includes [: pathes]]
235 default path list is $(DETECT_LIBRARY_PATH)
236 it will check $(p)/lib for library and $(p)/include for header
237 returns prefix or empty list
239 LIBJIMTCL_PFX = [ DetectLibrary libjim.a : jim.h : /opt/jim /opt/jim-tcl ] ;
240 if $(LIBJIMTCL_PFX) {
241 LINKFLAGS.all += -L$(LIBJIMTCL_PFX)/lib ;
242 LINKLIBS.all += -ljim ;
243 HDRS += $(LIBJIMTCL_PFX)/include ;
244 DEFINES += USE_JIM_TCL ;
247 [+] you can set K8JAM-JOBS variable to force number of jobs
249 [+] use DBG=1 to suppress NDEBUG define for non-debug profiles
251 [+] easy independent targets in *Main:
252 specify independent target name as 3rd arg to *Main:
253 Main alsatest : alsatest.c : alsatest ; # or Main alsatest : alsatest.c : _ ;
254 Main zytest : zytest.c : test tests ;
260 [+] 'clean' now doesn't clean 'Jamrules.auto.configure'; use 'distclean' to kill it
262 [+] JAMCONFIGARGS variable, which collects --* arguments
263 [+] 'config' now understands '--prefix' and sets PREFIX =? xxx
264 [+] InstallUserDefined rule:
265 # $(1): gristed source file
267 # $(3): directory to install
268 # $(LOCATE): the same as $(2) -- can be used in actions
270 [+] -configure-detect-library- now allows additional parameters (allow-any-lib and allow-any-header)
273 [+] *Main now understands some flags, which must be specified after file name:
276 processing.c !no-aliasing # add OPTIM_NOALIAS to build command
278 '!xyz' actually calls rule named --main-option-xyz-- if any, passing GRISTED filename as $(1) and
279 UNMODIFIED file name as $(2). sample no-aliasing rule:
280 rule --main-option-no-aliasing-- {
281 if $(OPTIM_NOALIAS) {
282 CCFLAGS on $(1) += $(OPTIM_NOALIAS) ;
283 C++FLAGS on $(1) += $(OPTIM_NOALIAS) ;
284 OBJCFLAGS on $(1) += $(OPTIM_NOALIAS) ;
287 use '!!filename' if your file name starts with '!'
289 [+] -configure-pkg-config-necessary- rule
290 optional: set PROJECT_NAME to project name which should be displayed on failure
291 -configure-pkg-config-necessary-
292 "GLib" "glib-2.0 >= 2.30.0"
297 [+] -configure-enable-disable-vars- variable to easy '--enable-xxx' and '--disable-xxx' options:
298 # "auto": check with pkg-config or so, show '--disable-xxx'
299 # "": disabled by default, show '--enable-xxx'
300 # non-empty string: enabled by default, show '--disable-xxx'
301 -configure-enable-disable-vars- +=
302 "sqlite" USE_SQLITE "auto" "don't use sqlite"
303 "gtkhtml" USE_GTKHTML "auto" "don't use GTKHTML"
304 "gtkspell" USE_GTKSPELL "auto" "don't use GTKSpell"
305 "svg" USE_RSVG "auto" "don't use librsvg"
306 "soup" USE_SOUP "auto" "don't use libsoup"
307 "curl" USE_CURL "auto" "don't use libcurl"
308 "dock" USE_DOCK "tan" "disable dock icon"
311 [*] Exit ; now exits without output and with SUCCESS exit code
313 [+] PROFILE variable now selects profile in set-profile rule
315 [+] RandName rule: generate random name
316 [ RandName ] -- /tmp/XXX
317 [ RandName "abc/" ] -- abc/XXX
318 [ RandName "" ] -- XXX
320 [+] ListWrite rule: write string list to file
321 ListFileWrite filename : list [: terminator] [: append]
322 default terminator is '\n'
325 [+] -configure-try-compile-cc- rule
326 $(1) -- program, string list
327 $(2) -- additional compiler flags (optional)
328 $(3) -- additional linker flags (optional)
329 rule -configure-test-timegm- {
330 return [ -configure-try-compile-cc-
331 "#include <stdlib.h>"
334 "struct tm _tm = { 0 };"
335 "_tm.tm_year = 2000;"
344 [+] -configure-test-compile-cc- rule:
346 $(2) -- program, string list
347 $(3) -- additional compiler flags (optional)
348 $(4) -- additional linker flags (optional)
350 [*] Echo-n removed, O-Flush removed, Echo now accepts some flags as $(2):
351 -n -- don't write newline
352 -Q -- don't write anything (so Echo : -n -Q will effectively do fflush(stdout);)
353 -S -- don't print spaces betwen args
354 -s -- print space after last arg (if there were some args at all)
355 -w -- use stderr instead of stdout
357 [*] Exit now accepts the same $(2) args as Echo
359 [+] semaphores (TOTALLY UNTESTED!)
360 It is sometimes desirable to disallow parallel execution of some actions. For example:
361 Old versions of yacc use files with fixed names. So, running two yacc actions is dangerous.
362 One might want to perform parallel compiling, but not do parallel linking, because linking
363 is i/o bound and only gets slower. Craig McPeeters has extended Perforce Jam to solve such
364 problems, and that extension was integrated in Boost.Jam (and in k8jam).
366 Any target can be assigned a semaphore, by setting a variable called JAM_SEMAPHORE on that
367 target. The value of the variable is the semaphore name. It must be different from names of
368 any declared target, but is arbitrary otherwise.
370 The semantic of semaphores is that in a group of targets which have the same semaphore, only
371 one can be updated at the moment, regardless of "-j" option.
374 Whenever a target is bound to a location in the filesystem, K8Jam will
375 look for a variable called BINDRULE. If non-empty, $(BINDRULE[1]) names
376 a rule which is called with the name of the target and the path it is
377 being bound to. The signature of the rule named by $(BINDRULE[1]) should
380 rule bind-rule target : path
382 This facility is useful for correct header file scanning, since many
383 compilers will search for #included files first in the directory
384 containing the file doing the #include directive. $(BINDRULE) can be
385 used to make a record of that directory.
387 [+] for local var in xyz { ... }
389 [+] strings in single quotes -- '\' in such strings is just an ordinary character
390 to embed single quote in such string use "''" (two single quotes in a row)
391 this is useful for regular expressions
393 [+] define -configure-user-help- rule to show user 'configure' options
395 [+] single-quoted strings now should not be expanded. i.e. '$(a)' means literal
396 string "$(a)", not string with value of $(a) expanded.
398 [+] ListRemoveDuplicates rule added. *Main now will remove all duplicate '.o' from
401 [*] heavily modified GenFile rule:
402 GenFile target : image sources [: dependencies ] ;
404 Runs the command "_image_ _target_ _sources_" to create _target_ from
405 _sources_ and _image_ (where _image_ is an executable built by the @Main rule).
406 'source' starts with '-' or '/' is an option, don't include it in dependency graph.
407 'source' starts with '*' switches generator to GenFile2, which will not automatically
408 add target to argument list.
409 'source' equals to $$ means 'target' and switches to GenFile2.
410 if 'image' starts with ':', this is standalone file, don't append any suffix to it.
412 [+] added 'UserObject' rule chain. define rule with arbitrary name and signature:
413 / <grist>outfile.o : <grist>infile.ext : exetarget ;
414 then add it to chain with 'RegisterUserObjectRule rulename'.
415 'rulename' should return true if it is in effect (to break chain).
416 if no rule in chain in effect, standard 'UserObject' rule will be called.
418 [+] added $(out) and $(in) as aliases for $(1) and $(2) (tnx to tzirechnoy)
420 [+] added `~=` for regexp comparison:
423 [+] all regexps now can contain options. if regexp starts with '/', it MUST
424 be closed with '/' too, and can have such options after it:
426 u: this is utf-8 string
427 m: '.' matches newline
428 default mode: case-sensitive non-utf-8, '.' will not match newline
430 [*] new variable expander: bigger, better and uncut!
431 WARNING! selector logic changed!
432 you can do the things like this now:
433 a = /usr/local/bin/fuck.elf ;
435 previously this prints 'fuck.elf', but now it prints 'heh.elf'
437 [*] Q modifier extended: now it can have '=qset' argument; it will use
438 first char from qset as 'screening' char and other chars as chars
439 that must be screened. if there is only one char, it will use
442 [*] new scanner; sometimes better, sometimes worst. samle of better:
443 $(a:Q=\\/) -- no more "\\\\" here!
445 [+] :W=width: pad string to the given width; if width<0: left padding
446 [+] :W -- return string length
447 [+] :C=width: cut string to the given width
450 [+] NormalizePath path [: pwd ]
451 prepend 'pwd' if path is not absolute (use current working dir if no 'pwd' given).
452 resolve '.' and '..' (it will not use filesystem for this, just string processing).
453 if path ends with '/', result will end with '/' too
455 [*] FReverse rule removed: use ListReverse instead.
457 [+] k8jam will try to load ~/.jam.rc before main Jamfile. you can use it to disable
458 idiotic 'diagnostic caret' in gcc 4.8+. just put this to ~/.jam.rc:
459 CFLAGS.all += -fno-diagnostics-show-caret ;
461 [+] if user-set-subdir-locates rule is present, it will be called from set-target-locations
462 after jam locations processed, with built dir as arg. rule MUST return dir
464 [+] added UNITTEST, RELEASE and NODEBUG flags for D
466 [+] -configure-pkg-config-var- rule: the same as -configure-pkg-config- but 1st arg is
467 'enable/disable' var name. var value will be changed accordingly to check result
469 [+] D support in set-profile:
470 RELEASE=1 -- build release version
471 UNITTEST=1 -- build unittest version
472 for non-release mode:
473 D_NO_ASSERT=1: turn off assert()
474 D_NO_IN=1: turn off in {}
475 D_NO_OUT=1: turn off out {}
476 D_NO_INVARIANTS=1: turn off invariant {}
477 D_NO_BOUNDS=1: turn off bounds checking
478 D_NO_DEBUG=1: turn off 'debug'
479 D_DEBUG=list: add -fdebug=xxx for each list item
480 D_MAXSPEED=1: DON'T USE!
482 [+] set-profile now understands 'speed', 'size', 'debug' and 'release' targets
483 'release' target sets RELEASE variable and some flags for GDC compiler
485 [+] set-profile now accepts list of flags. known flags:
486 no-targets -- don't process 'profile targets'
488 [-] no more D_RELEASE and D_UNITTEST
490 [+] D_VERSION variable; works similar to DEFINES but for gdc
492 [+] TARGET_SUBDIR variable, contains custom subdir for targets set with set-target-locations.
493 can be used to differentiate builds by specifying CLI vars or so
494 if it's a list, it will be joined with PATH_SEPARATOR
496 [+] ObjectDFlags rule
498 [+] ObjectDInlineFlags rule which adds $(GDC_INLINE_FLAGS) to force gdc do maximal inlining
499 without resorting to -O3
501 [+] added HDRPATH_IGNORE var which contains list of path prefixes to ignore in header scanner
503 [+] you can list libxyz.a in Main rule now, this will work exactly as LinkLibraries