1BMAKE(1) FreeBSD General Commands Manual BMAKE(1) 2 3[1mNAME[0m 4 [1mbmake [22m-- maintain program dependencies 5 6[1mSYNOPSIS[0m 7 [1mbmake [22m[[1m-BeikNnqrSstWwX[22m] [[1m-C [4m[22mdirectory[24m] [[1m-D [4m[22mvariable[24m] [[1m-d [4m[22mflags[24m] 8 [[1m-f [4m[22mmakefile[24m] [[1m-I [4m[22mdirectory[24m] [[1m-J [4m[22mprivate[24m] [[1m-j [4m[22mmax_jobs[24m] 9 [[1m-m [4m[22mdirectory[24m] [[1m-T [4m[22mfile[24m] [[1m-V [4m[22mvariable[24m] [[1m-v [4m[22mvariable[24m] 10 [[4mvariable[24m[1m=[4m[22mvalue[24m] [[4mtarget[24m ...] 11 12[1mDESCRIPTION[0m 13 [1mbmake [22mis a program designed to simplify the maintenance of other pro- 14 grams. Its input is a list of specifications as to the files upon which 15 programs and other files depend. If no [1m-f [4m[22mmakefile[24m option is given, 16 [1mbmake [22mtries to open `[4mmakefile[24m' then `[4mMakefile[24m' in order to find the spec- 17 ifications. If the file `[4m.depend[24m' exists, it is read (see mkdep(1)). 18 19 This manual page is intended as a reference document only. For a more 20 thorough description of [1mbmake [22mand makefiles, please refer to [4mPMake[24m [4m-[24m [4mA[0m 21 [4mTutorial[24m (from 1993). 22 23 [1mbmake [22mprepends the contents of the MAKEFLAGS environment variable to the 24 command line arguments before parsing them. 25 26 The options are as follows: 27 28 [1m-B [22mTry to be backwards compatible by executing a single shell per 29 command and by making the sources of a dependency line in se- 30 quence. 31 32 [1m-C [4m[22mdirectory[0m 33 Change to [4mdirectory[24m before reading the makefiles or doing any- 34 thing else. If multiple [1m-C [22moptions are specified, each is inter- 35 preted relative to the previous one: [1m-C [4m[22m/[24m [1m-C [4m[22metc[24m is equivalent to 36 [1m-C [4m[22m/etc[24m. 37 38 [1m-D [4m[22mvariable[0m 39 Define [4mvariable[24m to be 1, in the global scope. 40 41 [1m-d [22m[[1m-[22m][4mflags[0m 42 Turn on debugging, and specify which portions of [1mbmake [22mare to 43 print debugging information. Unless the flags are preceded by 44 `-', they are added to the MAKEFLAGS environment variable and are 45 passed on to any child make processes. By default, debugging in- 46 formation is printed to standard error, but this can be changed 47 using the [1mF [22mdebugging flag. The debugging output is always un- 48 buffered; in addition, if debugging is enabled but debugging out- 49 put is not directed to standard output, the standard output is 50 line buffered. The available [4mflags[24m are: 51 52 [1mA [22mPrint all possible debugging information; equivalent to 53 specifying all of the debugging flags. 54 55 [1ma [22mPrint debugging information about archive searching and 56 caching. 57 58 [1mC [22mPrint debugging information about the current working di- 59 rectory. 60 61 [1mc [22mPrint debugging information about conditional evaluation. 62 63 [1md [22mPrint debugging information about directory searching and 64 caching. 65 66 [1me [22mPrint debugging information about failed commands and 67 targets. 68 69 [1mF[22m[[1m+[22m][4mfilename[0m 70 Specify where debugging output is written. This must be 71 the last flag, because it consumes the remainder of the 72 argument. If the character immediately after the [1mF [22mflag 73 is `+', the file is opened in append mode; otherwise the 74 file is overwritten. If the file name is `stdout' or 75 `stderr', debugging output is written to the standard 76 output or standard error output file descriptors respec- 77 tively (and the `+' option has no effect). Otherwise, 78 the output is written to the named file. If the file 79 name ends with `.%d', the `%d' is replaced by the pid. 80 81 [1mf [22mPrint debugging information about loop evaluation. 82 83 [1mg1 [22mPrint the input graph before making anything. 84 85 [1mg2 [22mPrint the input graph after making everything, or before 86 exiting on error. 87 88 [1mg3 [22mPrint the input graph before exiting on error. 89 90 [1mh [22mPrint debugging information about hash table operations. 91 92 [1mj [22mPrint debugging information about running multiple 93 shells. 94 95 [1mL [22mTurn on lint checks. This throws errors for variable as- 96 signments that do not parse correctly, at the time of as- 97 signment, so the file and line number are available. 98 99 [1ml [22mPrint commands in Makefiles regardless of whether or not 100 they are prefixed by `@' or other "quiet" flags. Also 101 known as "loud" behavior. 102 103 [1mM [22mPrint debugging information about "meta" mode decisions 104 about targets. 105 106 [1mm [22mPrint debugging information about making targets, includ- 107 ing modification dates. 108 109 [1mn [22mDon't delete the temporary command scripts created when 110 running commands. These temporary scripts are created in 111 the directory referred to by the TMPDIR environment vari- 112 able, or in [4m/tmp[24m if TMPDIR is unset or set to the empty 113 string. The temporary scripts are created by mkstemp(3), 114 and have names of the form [4mmakeXXXXXX[24m. [4mNOTE[24m: This can 115 create many files in TMPDIR or [4m/tmp[24m, so use with care. 116 117 [1mp [22mPrint debugging information about makefile parsing. 118 119 [1ms [22mPrint debugging information about suffix-transformation 120 rules. 121 122 [1mt [22mPrint debugging information about target list mainte- 123 nance. 124 125 [1mV [22mForce the [1m-V [22moption to print raw values of variables, 126 overriding the default behavior set via 127 [4m.MAKE.EXPAND_VARIABLES[24m. 128 129 [1mv [22mPrint debugging information about variable assignment and 130 expansion. 131 132 [1mx [22mRun shell commands with [1m-x [22mso the actual commands are 133 printed as they are executed. 134 135 [1m-e [22mLet environment variables override global variables within make- 136 files. 137 138 [1m-f [4m[22mmakefile[0m 139 Specify a makefile to read instead of the default [4mmakefile[24m or 140 [4mMakefile[24m. If [4mmakefile[24m is `-', standard input is read. Multiple 141 makefiles may be specified, and are read in the order specified. 142 143 [1m-I [4m[22mdirectory[0m 144 Specify a directory in which to search for makefiles and included 145 makefiles. The system makefile directory (or directories, see 146 the [1m-m [22moption) is automatically included as part of this list. 147 148 [1m-i [22mIgnore non-zero exit of shell commands in the makefile. Equiva- 149 lent to specifying `[1m-[22m' before each command line in the makefile. 150 151 [1m-J [4m[22mprivate[0m 152 This option should [4mnot[24m be specified by the user. 153 154 When the [1m-j [22moption is in use in a recursive build, this option is 155 passed by a make to child makes to allow all the make processes 156 in the build to cooperate to avoid overloading the system. 157 158 [1m-j [4m[22mmax_jobs[0m 159 Specify the maximum number of jobs that [1mbmake [22mmay have running at 160 any one time. The value is saved in [4m.MAKE.JOBS[24m. Turns compati- 161 bility mode off, unless the [1m-B [22moption is also specified. When 162 compatibility mode is off, all commands associated with a target 163 are executed in a single shell invocation as opposed to the tra- 164 ditional one shell invocation per line. This can break tradi- 165 tional scripts which change directories on each command invoca- 166 tion and then expect to start with a fresh environment on the 167 next line. It is more efficient to correct the scripts rather 168 than turn backwards compatibility on. 169 170 [1m-k [22mContinue processing after errors are encountered, but only on 171 those targets that do not depend on the target whose creation 172 caused the error. 173 174 [1m-m [4m[22mdirectory[0m 175 Specify a directory in which to search for [4msys.mk[24m and makefiles 176 included via the <[4mfile[24m>-style include statement. The [1m-m [22moption 177 can be used multiple times to form a search path. This path 178 overrides the default system include path [4m/usr/share/mk[24m. Fur- 179 thermore, the system include path is appended to the search path 180 used for "[4mfile[24m"-style include statements (see the [1m-I [22moption). 181 182 If a directory name in the [1m-m [22margument (or the MAKESYSPATH envi- 183 ronment variable) starts with the string `.../', [1mbmake [22msearches 184 for the specified file or directory named in the remaining part 185 of the argument string. The search starts with the current di- 186 rectory and then works upward towards the root of the file sys- 187 tem. If the search is successful, the resulting directory re- 188 places the `.../' specification in the [1m-m [22margument. This feature 189 allows [1mbmake [22mto easily search in the current source tree for cus- 190 tomized [4msys.mk[24m files (e.g., by using `.../mk/sys.mk' as an argu- 191 ment). 192 193 [1m-n [22mDisplay the commands that would have been executed, but do not 194 actually execute them unless the target depends on the [4m.MAKE[24m spe- 195 cial source (see below) or the command is prefixed with `[1m+[22m'. 196 197 [1m-N [22mDisplay the commands that would have been executed, but do not 198 actually execute any of them; useful for debugging top-level 199 makefiles without descending into subdirectories. 200 201 [1m-q [22mDo not execute any commands, instead exit 0 if the specified tar- 202 gets are up to date, and 1 otherwise. 203 204 [1m-r [22mDo not use the built-in rules specified in the system makefile. 205 206 [1m-S [22mStop processing if an error is encountered. This is the default 207 behavior and the opposite of [1m-k[22m. 208 209 [1m-s [22mDo not echo any commands as they are executed. Equivalent to 210 specifying `[1m@[22m' before each command line in the makefile. 211 212 [1m-T [4m[22mtracefile[0m 213 When used with the [1m-j [22mflag, append a trace record to [4mtracefile[0m 214 for each job started and completed. 215 216 [1m-t [22mRather than re-building a target as specified in the makefile, 217 create it or update its modification time to make it appear up- 218 to-date. 219 220 [1m-V [4m[22mvariable[0m 221 Print the value of [4mvariable[24m. Do not build any targets. Multiple 222 instances of this option may be specified; the variables are 223 printed one per line, with a blank line for each null or unde- 224 fined variable. The value printed is extracted from the global 225 scope after all makefiles have been read. By default, the raw 226 variable contents (which may include additional unexpanded vari- 227 able references) are shown. If [4mvariable[24m contains a `$', the 228 value is recursively expanded to its complete resultant text be- 229 fore printing. The expanded value is also printed if 230 [4m.MAKE.EXPAND_VARIABLES[24m is set to true and the [1m-dV [22moption has not 231 been used to override it. Note that loop-local and target-local 232 variables, as well as values taken temporarily by global vari- 233 ables during makefile processing, are not accessible via this op- 234 tion. The [1m-dv [22mdebug mode can be used to see these at the cost of 235 generating substantial extraneous output. 236 237 [1m-v [4m[22mvariable[0m 238 Like [1m-V[22m, but all printed variables are always expanded to their 239 complete value. The last occurrence of [1m-V [22mor [1m-v [22mdecides whether 240 all variables are expanded or not. 241 242 [1m-W [22mTreat any warnings during makefile parsing as errors. 243 244 [1m-w [22mPrint entering and leaving directory messages, pre and post pro- 245 cessing. 246 247 [1m-X [22mDon't export variables passed on the command line to the environ- 248 ment individually. Variables passed on the command line are 249 still exported via the MAKEFLAGS environment variable. This op- 250 tion may be useful on systems which have a small limit on the 251 size of command arguments. 252 253 [4mvariable[24m[1m=[4m[22mvalue[0m 254 Set the value of the variable [4mvariable[24m to [4mvalue[24m. Normally, all 255 values passed on the command line are also exported to sub-makes 256 in the environment. The [1m-X [22mflag disables this behavior. Vari- 257 able assignments should follow options for POSIX compatibility 258 but no ordering is enforced. 259 260 There are several different types of lines in a makefile: dependency 261 specifications, shell commands, variable assignments, include statements, 262 conditional directives, for loops, other directives, and comments. 263 264 Lines may be continued from one line to the next by ending them with a 265 backslash (`\'). The trailing newline character and initial whitespace 266 on the following line are compressed into a single space. 267 268[1mFILE DEPENDENCY SPECIFICATIONS[0m 269 Dependency lines consist of one or more targets, an operator, and zero or 270 more sources. This creates a relationship where the targets "depend" on 271 the sources and are customarily created from them. A target is consid- 272 ered out of date if it does not exist, or if its modification time is 273 less than that of any of its sources. An out-of-date target is re-cre- 274 ated, but not until all sources have been examined and themselves re-cre- 275 ated as needed. Three operators may be used: 276 277 [1m: [22mMany dependency lines may name this target but only one may have 278 attached shell commands. All sources named in all dependency lines 279 are considered together, and if needed the attached shell commands 280 are run to create or re-create the target. If [1mbmake [22mis inter- 281 rupted, the target is removed. 282 283 [1m! [22mThe same, but the target is always re-created whether or not it is 284 out of date. 285 286 [1m:: [22mAny dependency line may have attached shell commands, but each one 287 is handled independently: its sources are considered and the at- 288 tached shell commands are run if the target is out of date with re- 289 spect to (only) those sources. Thus, different groups of the at- 290 tached shell commands may be run depending on the circumstances. 291 Furthermore, unlike [1m:, [22mfor dependency lines with no sources, the 292 attached shell commands are always run. Also unlike [1m:, [22mthe target 293 is not removed if [1mbmake [22mis interrupted. 294 All dependency lines mentioning a particular target must use the same op- 295 erator. 296 297 Targets and sources may contain the shell wildcard values `?', `*', `[]', 298 and `{}'. The values `?', `*', and `[]' may only be used as part of the 299 final component of the target or source, and only match existing files. 300 The value `{}' need not necessarily be used to describe existing files. 301 Expansion is in directory order, not alphabetically as done in the shell. 302 303[1mSHELL COMMANDS[0m 304 Each target may have associated with it one or more lines of shell com- 305 mands, normally used to create the target. Each of the lines in this 306 script [4mmust[24m be preceded by a tab. (For historical reasons, spaces are 307 not accepted.) While targets can occur in many dependency lines if de- 308 sired, by default only one of these rules may be followed by a creation 309 script. If the `[1m::[22m' operator is used, however, all rules may include 310 scripts and the scripts are executed in the order found. 311 312 Each line is treated as a separate shell command, unless the end of line 313 is escaped with a backslash (`\'), in which case that line and the next 314 are combined. If the first characters of the command are any combination 315 of `[1m@[22m', `[1m+[22m', or `[1m-[22m', the command is treated specially. A `[1m@[22m' causes the 316 command not to be echoed before it is executed. A `[1m+[22m' causes the command 317 to be executed even when [1m-n [22mis given. This is similar to the effect of 318 the [4m.MAKE[24m special source, except that the effect can be limited to a sin- 319 gle line of a script. A `[1m-[22m' in compatibility mode causes any non-zero 320 exit status of the command line to be ignored. 321 322 When [1mbmake [22mis run in jobs mode with [1m-j [4m[22mmax_jobs[24m, the entire script for 323 the target is fed to a single instance of the shell. In compatibility 324 (non-jobs) mode, each command is run in a separate process. If the com- 325 mand contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n'), it is 326 passed to the shell; otherwise [1mbmake [22mattempts direct execution. If a 327 line starts with `[1m-[22m' and the shell has ErrCtl enabled, failure of the 328 command line is ignored as in compatibility mode. Otherwise `[1m-[22m' affects 329 the entire job; the script stops at the first command line that fails, 330 but the target is not deemed to have failed. 331 332 Makefiles should be written so that the mode of [1mbmake [22moperation does not 333 change their behavior. For example, any command which uses "cd" or 334 "chdir" without the intention of changing the directory for subsequent 335 commands should be put in parentheses so it executes in a subshell. To 336 force the use of a single shell, escape the line breaks so as to make the 337 whole script one command. For example: 338 339 avoid-chdir-side-effects: 340 @echo Building $@ in `pwd` 341 @(cd ${.CURDIR} && ${MAKE} $@) 342 @echo Back in `pwd` 343 344 ensure-one-shell-regardless-of-mode: 345 @echo Building $@ in `pwd`; \ 346 (cd ${.CURDIR} && ${MAKE} $@); \ 347 echo Back in `pwd` 348 349 Since [1mbmake [22mchanges the current working directory to `[4m.OBJDIR[24m' before ex- 350 ecuting any targets, each child process starts with that as its current 351 working directory. 352 353[1mVARIABLE ASSIGNMENTS[0m 354 Variables in make behave much like macros in the C preprocessor. 355 356 Variable assignments have the form `[4mNAME[24m [4mop[24m [4mvalue[24m', where: 357 358 [4mNAME[24m is a single-word variable name, consisting, by tradition, of all 359 upper-case letters, 360 361 [4mop[24m is one of the five variable assignment operators described below, 362 and 363 364 [4mvalue[24m is interpreted according to the variable assignment operator. 365 366 Whitespace around [4mNAME[24m, [4mop[24m and [4mvalue[24m is discarded. 367 368 [1mVariable assignment operators[0m 369 The five operators that assign values to variables are: 370 371 [1m= [22mAssign the value to the variable. Any previous value is over- 372 written. 373 374 [1m+= [22mAppend the value to the current value of the variable, separating 375 them by a single space. 376 377 [1m?= [22mAssign the value to the variable if it is not already defined. 378 379 [1m:= [22mAssign with expansion, i.e. expand the value before assigning it 380 to the variable. Normally, expansion is not done until the vari- 381 able is referenced. 382 383 [4mNOTE[24m: References to undefined variables are [4mnot[24m expanded. This 384 can cause problems when variable modifiers are used. 385 386 [1m!= [22mExpand the value and pass it to the shell for execution, then as- 387 sign the output from the child's standard output to the variable. 388 Any newlines in the result are replaced with spaces. 389 390 [1mExpansion of variables[0m 391 In most contexts where variables are expanded, `$$' expands to a single 392 dollar sign. In other contexts (most variable modifiers, string literals 393 in conditions), `\$' expands to a single dollar sign. 394 395 References to variables have the form [1m${[4m[22mname[24m[[1m:[4m[22mmodifiers[24m][1m} [22mor 396 [1m$([4m[22mname[24m[[1m:[4m[22mmodifiers[24m][1m)[22m. If the variable name consists of only a single 397 character, the surrounding curly braces or parentheses are not required. 398 This shorter form is not recommended. 399 400 If the variable name contains a dollar, the name itself is expanded 401 first. This allows almost arbitrary variable names, however names con- 402 taining dollar, braces, parentheses or whitespace are really best 403 avoided. 404 405 If the result of expanding a nested variable expression contains a dollar 406 sign (`$'), the string is subject to further expansion. 407 408 Variable substitution occurs at four distinct times, depending on where 409 the variable is being used. 410 411 1. Variables in dependency lines are expanded as the line is read. 412 413 2. Variables in conditionals are expanded individually, but only as far 414 as necessary to determine the result of the conditional. 415 416 3. Variables in shell commands are expanded when the shell command is 417 executed. 418 419 4. [1m.for [22mloop index variables are expanded on each loop iteration. Note 420 that other variables are not expanded when composing the body of a 421 loop, so the following example code: 422 423 .for i in 1 2 3 424 a+= ${i} 425 j= ${i} 426 b+= ${j} 427 .endfor 428 429 all: 430 @echo ${a} 431 @echo ${b} 432 433 prints: 434 435 1 2 3 436 3 3 3 437 438 Because while [4ma[24m contains `${:U1} ${:U2} ${:U3}' after the loop is 439 executed, [4mb[24m contains `${j} ${j} ${j}' which expands to `3 3 3' since 440 after the loop completes [4mj[24m contains `${:U3}'. 441 442 [1mVariable classes[0m 443 The four different classes of variables (in order of increasing prece- 444 dence) are: 445 446 Environment variables 447 Variables defined as part of [1mbmake[22m's environment. 448 449 Global variables 450 Variables defined in the makefile or in included makefiles. 451 452 Command line variables 453 Variables defined as part of the command line. 454 455 Local variables 456 Variables that are defined specific to a certain target. 457 458 Local variables can be set on a dependency line, unless 459 [4m.MAKE.TARGET_LOCAL_VARIABLES[24m is set to `false'. The rest of the line 460 (which already has had global variables expanded) is the variable value. 461 For example: 462 463 COMPILER_WRAPPERS= ccache distcc icecc 464 465 ${OBJS}: .MAKE.META.CMP_FILTER=${COMPILER_WRAPPERS:S,^,N,} 466 467 Only the targets `${OBJS}' are impacted by that filter (in "meta" mode) 468 and simply enabling/disabling any of the compiler wrappers does not ren- 469 der all of those targets out-of-date. 470 471 [4mNOTE[24m: target-local variable assignments behave differently in that; 472 473 [1m+= [22mOnly appends to a previous local assignment for the same 474 target and variable. 475 476 [1m:= [22mIs redundant with respect to global variables, which have 477 already been expanded. 478 479 The seven built-in local variables are: 480 481 [4m.ALLSRC[24m The list of all sources for this target; also known as 482 `[4m>[24m'. 483 484 [4m.ARCHIVE[24m The name of the archive file; also known as `[4m![24m'. 485 486 [4m.IMPSRC[24m In suffix-transformation rules, the name/path of the 487 source from which the target is to be transformed (the 488 "implied" source); also known as `[4m<[24m'. It is not defined 489 in explicit rules. 490 491 [4m.MEMBER[24m The name of the archive member; also known as `[4m%[24m'. 492 493 [4m.OODATE[24m The list of sources for this target that were deemed out- 494 of-date; also known as `[4m?[24m'. 495 496 [4m.PREFIX[24m The file prefix of the target, containing only the file 497 portion, no suffix or preceding directory components; 498 also known as `[4m*[24m'. The suffix must be one of the known 499 suffixes declared with [1m.SUFFIXES[22m, or it is not recog- 500 nized. 501 502 [4m.TARGET[24m The name of the target; also known as `[4m@[24m'. For compati- 503 bility with other makes this is an alias for [4m.ARCHIVE[24m in 504 archive member rules. 505 506 The shorter forms (`[4m>[24m', `[4m![24m', `[4m<[24m', `[4m%[24m', `[4m?[24m', `[4m*[24m', and `[4m@[24m') are permitted 507 for backward compatibility with historical makefiles and legacy POSIX 508 make and are not recommended. 509 510 Variants of these variables with the punctuation followed immediately by 511 `D' or `F', e.g. `$(@D)', are legacy forms equivalent to using the `:H' 512 and `:T' modifiers. These forms are accepted for compatibility with AT&T 513 System V UNIX makefiles and POSIX but are not recommended. 514 515 Four of the local variables may be used in sources on dependency lines 516 because they expand to the proper value for each target on the line. 517 These variables are `[4m.TARGET[24m', `[4m.PREFIX[24m', `[4m.ARCHIVE[24m', and `[4m.MEMBER[24m'. 518 519 [1mAdditional built-in variables[0m 520 In addition, [1mbmake [22msets or knows about the following variables: 521 522 [4m.ALLTARGETS[24m The list of all targets encountered in the makefiles. If 523 evaluated during makefile parsing, lists only those tar- 524 gets encountered thus far. 525 526 [4m.CURDIR[24m A path to the directory where [1mbmake [22mwas executed. Refer 527 to the description of `[4mPWD[24m' for more details. 528 529 [4m.INCLUDEDFROMDIR[0m 530 The directory of the file this Makefile was included 531 from. 532 533 [4m.INCLUDEDFROMFILE[0m 534 The filename of the file this Makefile was included from. 535 536 [4mMAKE[24m The name that [1mbmake [22mwas executed with ([4margv[0][24m). For 537 compatibility, [1mbmake [22malso sets [4m.MAKE[24m with the same value. 538 The preferred variable to use is the environment variable 539 MAKE because it is more compatible with other make vari- 540 ants and cannot be confused with the special target with 541 the same name. 542 543 [4m.MAKE.DEPENDFILE[0m 544 Names the makefile (default `[4m.depend[24m') from which gener- 545 ated dependencies are read. 546 547 [4m.MAKE.EXPAND_VARIABLES[0m 548 A boolean that controls the default behavior of the [1m-V[0m 549 option. If true, variable values printed with [1m-V [22mare 550 fully expanded; if false, the raw variable contents 551 (which may include additional unexpanded variable refer- 552 ences) are shown. 553 554 [4m.MAKE.EXPORTED[24m The list of variables exported by [1mbmake[22m. 555 556 [4m.MAKE.JOBS[24m The argument to the [1m-j [22moption. 557 558 [4m.MAKE.JOB.PREFIX[0m 559 If [1mbmake [22mis run with [1m-j[22m, the output for each target is 560 prefixed with a token 561 --- [4mtarget[24m --- 562 the first part of which can be controlled via 563 [4m.MAKE.JOB.PREFIX[24m. If [4m.MAKE.JOB.PREFIX[24m is empty, no token 564 is printed. For example, setting [4m.MAKE.JOB.PREFIX[24m to 565 `${.newline}---${.MAKE:T}[${.MAKE.PID}]' would produce 566 tokens like 567 ---make[1234] [4mtarget[24m --- 568 making it easier to track the degree of parallelism being 569 achieved. 570 571 [4m.MAKE.TARGET_LOCAL_VARIABLES[0m 572 If set to `false', apparent variable assignments in de- 573 pendency lines are treated as normal sources. 574 575 [4mMAKEFLAGS[24m The environment variable `MAKEFLAGS' may contain anything 576 that may be specified on [1mbmake[22m's command line. Anything 577 specified on [1mbmake[22m's command line is appended to the 578 [4mMAKEFLAGS[24m variable, which is then added to the environ- 579 ment for all programs that [1mbmake [22mexecutes. 580 581 [4m.MAKE.LEVEL[24m The recursion depth of [1mbmake[22m. The top-level instance of 582 [1mbmake [22mhas level 0, and each child make has its parent 583 level plus 1. This allows tests like: .if ${.MAKE.LEVEL} 584 == 0 to protect things which should only be evaluated in 585 the top-level instance of [1mbmake[22m. 586 587 [4m.MAKE.MAKEFILE_PREFERENCE[0m 588 The ordered list of makefile names (default `[4mmakefile[24m', 589 `[4mMakefile[24m') that [1mbmake [22mlooks for. 590 591 [4m.MAKE.MAKEFILES[0m 592 The list of makefiles read by [1mbmake[22m, which is useful for 593 tracking dependencies. Each makefile is recorded only 594 once, regardless of the number of times read. 595 596 [4m.MAKE.MODE[24m Processed after reading all makefiles. Affects the mode 597 that [1mbmake [22mruns in. It can contain a number of keywords: 598 599 [1mcompat [22mLike [1m-B[22m, puts [1mbmake [22minto "compat" 600 mode. 601 602 [1mmeta [22mPuts [1mbmake [22minto "meta" mode, where 603 meta files are created for each tar- 604 get to capture the command run, the 605 output generated, and if filemon(4) 606 is available, the system calls which 607 are of interest to [1mbmake[22m. The cap- 608 tured output can be useful when di- 609 agnosing errors. 610 611 [1mcurdirOk=[4m[22mbf[24m By default, [1mbmake [22mdoes not create 612 [4m.meta[24m files in `[4m.CURDIR[24m'. This can 613 be overridden by setting [4mbf[24m to a 614 value which represents true. 615 616 [1mmissing-meta=[4m[22mbf[24m If [4mbf[24m is true, a missing [4m.meta[24m file 617 makes the target out-of-date. 618 619 [1mmissing-filemon=[4m[22mbf[24m If [4mbf[24m is true, missing filemon data 620 makes the target out-of-date. 621 622 [1mnofilemon [22mDo not use filemon(4). 623 624 [1menv [22mFor debugging, it can be useful to 625 include the environment in the [4m.meta[0m 626 file. 627 628 [1mverbose [22mIf in "meta" mode, print a clue 629 about the target being built. This 630 is useful if the build is otherwise 631 running silently. The message 632 printed is the expanded value of 633 [4m.MAKE.META.PREFIX[24m. 634 635 [1mignore-cmd [22mSome makefiles have commands which 636 are simply not stable. This keyword 637 causes them to be ignored for deter- 638 mining whether a target is out of 639 date in "meta" mode. See also 640 [1m.NOMETA_CMP[22m. 641 642 [1msilent=[4m[22mbf[24m If [4mbf[24m is true, when a .meta file is 643 created, mark the target [1m.SILENT[22m. 644 645 [1mrandomize-targets [22mIn both compat and parallel mode, do 646 not make the targets in the usual 647 order, but instead randomize their 648 order. This mode can be used to de- 649 tect undeclared dependencies between 650 files. 651 652 [4m.MAKE.META.BAILIWICK[0m 653 In "meta" mode, provides a list of prefixes which match 654 the directories controlled by [1mbmake[22m. If a file that was 655 generated outside of [4m.OBJDIR[24m but within said bailiwick is 656 missing, the current target is considered out-of-date. 657 658 [4m.MAKE.META.CMP_FILTER[0m 659 In "meta" mode, it can (very rarely!) be useful to filter 660 command lines before comparison. This variable can be 661 set to a set of modifiers that are applied to each line 662 of the old and new command that differ, if the filtered 663 commands still differ, the target is considered out-of- 664 date. 665 666 [4m.MAKE.META.CREATED[0m 667 In "meta" mode, this variable contains a list of all the 668 meta files updated. If not empty, it can be used to 669 trigger processing of [4m.MAKE.META.FILES[24m. 670 671 [4m.MAKE.META.FILES[0m 672 In "meta" mode, this variable contains a list of all the 673 meta files used (updated or not). This list can be used 674 to process the meta files to extract dependency informa- 675 tion. 676 677 [4m.MAKE.META.IGNORE_PATHS[0m 678 Provides a list of path prefixes that should be ignored; 679 because the contents are expected to change over time. 680 The default list includes: `[4m/dev[24m [4m/etc[24m [4m/proc[24m [4m/tmp[24m [4m/var/run[0m 681 [4m/var/tmp[24m' 682 683 [4m.MAKE.META.IGNORE_PATTERNS[0m 684 Provides a list of patterns to match against pathnames. 685 Ignore any that match. 686 687 [4m.MAKE.META.IGNORE_FILTER[0m 688 Provides a list of variable modifiers to apply to each 689 pathname. Ignore if the expansion is an empty string. 690 691 [4m.MAKE.META.PREFIX[0m 692 Defines the message printed for each meta file updated in 693 "meta verbose" mode. The default value is: 694 Building ${.TARGET:H:tA}/${.TARGET:T} 695 696 [4m.MAKEOVERRIDES[24m This variable is used to record the names of variables 697 assigned to on the command line, so that they may be ex- 698 ported as part of `MAKEFLAGS'. This behavior can be dis- 699 abled by assigning an empty value to `[4m.MAKEOVERRIDES[24m' 700 within a makefile. Extra variables can be exported from 701 a makefile by appending their names to `[4m.MAKEOVERRIDES[24m'. 702 `MAKEFLAGS' is re-exported whenever `[4m.MAKEOVERRIDES[24m' is 703 modified. 704 705 [4m.MAKE.PATH_FILEMON[0m 706 If [1mbmake [22mwas built with filemon(4) support, this is set 707 to the path of the device node. This allows makefiles to 708 test for this support. 709 710 [4m.MAKE.PID[24m The process ID of [1mbmake[22m. 711 712 [4m.MAKE.PPID[24m The parent process ID of [1mbmake[22m. 713 714 [4m.MAKE.SAVE_DOLLARS[0m 715 If true, `$$' are preserved when doing `:=' assignments. 716 The default is false, for backwards compatibility. Set 717 to true for compatability with other makes. If set to 718 false, `$$' becomes `$' per normal evaluation rules. 719 720 [4m.MAKE.UID[24m The numeric ID of the user running [1mbmake[22m. 721 722 [4m.MAKE.GID[24m The numeric group ID of the user running [1mbmake[22m. 723 724 [4mMAKE_PRINT_VAR_ON_ERROR[0m 725 When [1mbmake [22mstops due to an error, it sets `[4m.ERROR_TARGET[24m' 726 to the name of the target that failed, `[4m.ERROR_CMD[24m' to 727 the commands of the failed target, and in "meta" mode, it 728 also sets `[4m.ERROR_CWD[24m' to the getcwd(3), and 729 `[4m.ERROR_META_FILE[24m' to the path of the meta file (if any) 730 describing the failed target. It then prints its name 731 and the value of `[4m.CURDIR[24m' as well as the value of any 732 variables named in `[4mMAKE_PRINT_VAR_ON_ERROR[24m'. 733 734 [4m.newline[24m This variable is simply assigned a newline character as 735 its value. This allows expansions using the [1m:@ [22mmodifier 736 to put a newline between iterations of the loop rather 737 than a space. For example, in case of an error, [1mbmake[0m 738 prints the variable names and their values using: 739 ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} 740 741 [4m.OBJDIR[24m A path to the directory where the targets are built. Its 742 value is determined by trying to chdir(2) to the follow- 743 ing directories in order and using the first match: 744 745 1. [1m${MAKEOBJDIRPREFIX}${.CURDIR}[0m 746 747 (Only if `MAKEOBJDIRPREFIX' is set in the environ- 748 ment or on the command line.) 749 750 2. [1m${MAKEOBJDIR}[0m 751 752 (Only if `MAKEOBJDIR' is set in the environment or 753 on the command line.) 754 755 3. [1m${.CURDIR}[4m[22m/obj.[24m[1m${MACHINE}[0m 756 757 4. [1m${.CURDIR}[4m[22m/obj[0m 758 759 5. [4m/usr/obj/[24m[1m${.CURDIR}[0m 760 761 6. [1m${.CURDIR}[0m 762 763 Variable expansion is performed on the value before it is 764 used, so expressions such as 765 [1m${.CURDIR:S,^/usr/src,/var/obj,} [22mmay be used. This is 766 especially useful with `MAKEOBJDIR'. 767 768 `[4m.OBJDIR[24m' may be modified in the makefile via the special 769 target `[1m.OBJDIR[22m'. In all cases, [1mbmake [22mchanges to the 770 specified directory if it exists, and sets `[4m.OBJDIR[24m' and 771 `[4mPWD[24m' to that directory before executing any targets. 772 773 Except in the case of an explicit `[1m.OBJDIR[22m' target, [1mbmake[0m 774 checks that the specified directory is writable and ig- 775 nores it if not. This check can be skipped by setting 776 the environment variable `MAKE_OBJDIR_CHECK_WRITABLE' to 777 "no". 778 779 [4m.PARSEDIR[24m The directory name of the current makefile being parsed. 780 781 [4m.PARSEFILE[24m The basename of the current makefile being parsed. This 782 variable and `[4m.PARSEDIR[24m' are both set only while the 783 makefiles are being parsed. To retain their current val- 784 ues, assign them to a variable using assignment with ex- 785 pansion `[1m:=[22m'. 786 787 [4m.PATH[24m The space-separated list of directories that [1mbmake[0m 788 searches for files. To update this search list, use the 789 special target `[1m.PATH[22m' rather than modifying the variable 790 directly. 791 792 [4mPWD[24m Alternate path to the current directory. [1mbmake [22mnormally 793 sets `[4m.CURDIR[24m' to the canonical path given by getcwd(3). 794 However, if the environment variable `PWD' is set and 795 gives a path to the current directory, [1mbmake [22msets 796 `[4m.CURDIR[24m' to the value of `PWD' instead. This behavior 797 is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR' 798 contains a variable transform. `[4mPWD[24m' is set to the value 799 of `[4m.OBJDIR[24m' for all programs which [1mbmake [22mexecutes. 800 801 [4m.SHELL[24m The pathname of the shell used to run target scripts. It 802 is read-only. 803 804 [4m.SUFFIXES[24m The list of known suffixes. It is read-only. 805 806 [4m.TARGETS[24m The list of targets explicitly specified on the command 807 line, if any. 808 809 [4mVPATH[24m The colon-separated (":") list of directories that [1mbmake[0m 810 searches for files. This variable is supported for com- 811 patibility with old make programs only, use `[4m.PATH[24m' in- 812 stead. 813 814 [1mVariable modifiers[0m 815 The general format of a variable expansion is: 816 817 [1m${[4m[22mvariable[24m[[1m:[4m[22mmodifier[24m[[1m:[22m...]][1m}[0m 818 819 Each modifier begins with a colon. To escape a colon, precede it with a 820 backslash `\'. 821 822 A list of indirect modifiers can be specified via a variable, as follows: 823 824 [4mmodifier_variable[24m = [4mmodifier[24m[[1m:[22m...] 825 826 [1m${[4m[22mvariable[24m[1m:${[4m[22mmodifier_variable[24m[1m}[22m[[1m:[22m...][1m}[0m 827 828 In this case, the first modifier in the [4mmodifier_variable[24m does not start 829 with a colon, since that colon already occurs in the referencing vari- 830 able. If any of the modifiers in the [4mmodifier_variable[24m contains a dollar 831 sign (`$'), these must be doubled to avoid early expansion. 832 833 Some modifiers interpret the expression value as a single string, others 834 treat the expression value as a whitespace-separated list of words. When 835 splitting a string into words, whitespace can be escaped using double 836 quotes, single quotes and backslashes, like in the shell. The quotes and 837 backslashes are retained in the words. 838 839 The supported modifiers are: 840 841 [1m:E [22mReplaces each word in the variable with its suffix. 842 843 [1m:H [22mReplaces each word in the variable with its dirname. 844 845 [1m:M[4m[22mpattern[0m 846 Selects only those words that match [4mpattern[24m. The standard shell 847 wildcard characters (`*', `?', and `[]') may be used. The wildcard 848 characters may be escaped with a backslash (`\'). As a consequence 849 of the way values are split into words, matched, and then joined, 850 the construct 851 ${VAR:M*} 852 removes all leading and trailing whitespace and normalizes the in- 853 ter-word spacing to a single space. 854 855 [1m:N[4m[22mpattern[0m 856 This is the opposite of `[1m:M[22m', selecting all words which do [4mnot[24m match 857 [4mpattern[24m. 858 859 [1m:O [22mOrders the words alphabetically. 860 861 [1m:On [22mOrders the words numerically. A number followed by one of `k', `M' 862 or `G' is multiplied by the appropriate factor, which is 1024 for 863 `k', 1048576 for `M', or 1073741824 for `G'. Both upper- and lower- 864 case letters are accepted. 865 866 [1m:Or [22mOrders the words in reverse alphabetical order. 867 868 [1m:Orn[0m 869 Orders the words in reverse numerical order. 870 871 [1m:Ox [22mShuffles the words. The results are different each time you are re- 872 ferring to the modified variable; use the assignment with expansion 873 `[1m:=[22m' to prevent such behavior. For example, 874 875 LIST= uno due tre quattro 876 RANDOM_LIST= ${LIST:Ox} 877 STATIC_RANDOM_LIST:= ${LIST:Ox} 878 879 all: 880 @echo "${RANDOM_LIST}" 881 @echo "${RANDOM_LIST}" 882 @echo "${STATIC_RANDOM_LIST}" 883 @echo "${STATIC_RANDOM_LIST}" 884 may produce output similar to: 885 886 quattro due tre uno 887 tre due quattro uno 888 due uno quattro tre 889 due uno quattro tre 890 891 [1m:Q [22mQuotes every shell meta-character in the value, so that it can be 892 passed safely to the shell. 893 894 [1m:q [22mQuotes every shell meta-character in the value, and also doubles `$' 895 characters so that it can be passed safely through recursive invoca- 896 tions of [1mbmake[22m. This is equivalent to `[1m:S/\$/&&/g:Q[22m'. 897 898 [1m:R [22mReplaces each word in the variable with everything but its suffix. 899 900 [1m:range[22m[[1m=[4m[22mcount[24m] 901 The value is an integer sequence representing the words of the orig- 902 inal value, or the supplied [4mcount[24m. 903 904 [1m:gmtime[22m[[1m=[4m[22mtimestamp[24m] 905 The value is interpreted as a format string for strftime(3), using 906 gmtime(3), producing the formatted timestamp. If a [4mtimestamp[24m value 907 is not provided or is 0, the current time is used. 908 909 [1m:hash[0m 910 Computes a 32-bit hash of the value and encodes it as 8 hex digits. 911 912 [1m:localtime[22m[[1m=[4m[22mtimestamp[24m] 913 The value is interpreted as a format string for strftime(3), using 914 localtime(3), producing the formatted timestamp. If a [4mtimestamp[0m 915 value is not provided or is 0, the current time is used. 916 917 [1m:tA [22mAttempts to convert the value to an absolute path using realpath(3). 918 If that fails, the value is unchanged. 919 920 [1m:tl [22mConverts the value to lower-case letters. 921 922 [1m:ts[4m[22mc[0m 923 When joining the words after a modifier that treats the value as 924 words, the words are normally separated by a space. This modifier 925 changes the separator to the character [4mc[24m. If [4mc[24m is omitted, no sepa- 926 rator is used. The common escapes (including octal numeric codes) 927 work as expected. 928 929 [1m:tu [22mConverts the value to upper-case letters. 930 931 [1m:tW [22mCauses subsequent modifiers to treat the value as a single word 932 (possibly containing embedded whitespace). See also `[1m:[*][22m'. 933 934 [1m:tw [22mCauses the value to be treated as a list of words. See also `[1m:[@][22m'. 935 936 [1m:S[22m/[4mold_string[24m/[4mnew_string[24m/[[1m1gW[22m] 937 Modifies the first occurrence of [4mold_string[24m in each word of the 938 value, replacing it with [4mnew_string[24m. If a `g' is appended to the 939 last delimiter of the pattern, all occurrences in each word are re- 940 placed. If a `1' is appended to the last delimiter of the pattern, 941 only the first occurrence is affected. If a `W' is appended to the 942 last delimiter of the pattern, the value is treated as a single 943 word. If [4mold_string[24m begins with a caret (`^'), [4mold_string[24m is an- 944 chored at the beginning of each word. If [4mold_string[24m ends with a 945 dollar sign (`$'), it is anchored at the end of each word. Inside 946 [4mnew_string[24m, an ampersand (`&') is replaced by [4mold_string[24m (without 947 the anchoring `^' or `$'). Any character may be used as the delim- 948 iter for the parts of the modifier string. The anchoring, ampersand 949 and delimiter characters can be escaped with a backslash (`\'). 950 951 Variable expansion occurs in the normal fashion inside both 952 [4mold_string[24m and [4mnew_string[24m with the single exception that a backslash 953 is used to prevent the expansion of a dollar sign (`$'), not a pre- 954 ceding dollar sign as is usual. 955 956 [1m:C[22m/[4mpattern[24m/[4mreplacement[24m/[[1m1gW[22m] 957 The [1m:C [22mmodifier works like the [1m:S [22mmodifier except that the old and 958 new strings, instead of being simple strings, are an extended regu- 959 lar expression [4mpattern[24m (see regex(3)) and an ed(1)-style 960 [4mreplacement[24m. Normally, the first occurrence of the pattern [4mpattern[0m 961 in each word of the value is substituted with [4mreplacement[24m. The `1' 962 modifier causes the substitution to apply to at most one word; the 963 `g' modifier causes the substitution to apply to as many instances 964 of the search pattern [4mpattern[24m as occur in the word or words it is 965 found in; the `W' modifier causes the value to be treated as a sin- 966 gle word (possibly containing embedded whitespace). 967 968 As for the [1m:S [22mmodifier, the [4mpattern[24m and [4mreplacement[24m are subjected to 969 variable expansion before being parsed as regular expressions. 970 971 [1m:T [22mReplaces each word in the variable with its last path component 972 (basename). 973 974 [1m:u [22mRemoves adjacent duplicate words (like uniq(1)). 975 976 [1m:?[4m[22mtrue_string[24m[1m:[4m[22mfalse_string[0m 977 If the variable name (not its value), when parsed as a [1m.if [22mcondi- 978 tional expression, evaluates to true, return as its value the 979 [4mtrue_string[24m, otherwise return the [4mfalse_string[24m. Since the variable 980 name is used as the expression, :? must be the first modifier after 981 the variable name itself--which, of course, usually contains vari- 982 able expansions. A common error is trying to use expressions like 983 ${NUMBERS:M42:?match:no} 984 which actually tests defined(NUMBERS). To determine if any words 985 match "42", you need to use something like: 986 ${"${NUMBERS:M42}" != "":?match:no}. 987 988 [1m:[4m[22mold_string[24m[1m=[4m[22mnew_string[0m 989 This is the AT&T System V UNIX style variable substitution. It must 990 be the last modifier specified. If [4mold_string[24m or [4mnew_string[24m do not 991 contain the pattern matching character `%', it is assumed that they 992 are anchored at the end of each word, so only suffixes or entire 993 words may be replaced. Otherwise `%' is the substring of [4mold_string[0m 994 to be replaced in [4mnew_string[24m. If only [4mold_string[24m contains the pat- 995 tern matching character `%', and [4mold_string[24m matches, the result is 996 the [4mnew_string[24m. If only the [4mnew_string[24m contains the pattern match- 997 ing character `%', it is not treated specially and it is printed as 998 a literal `%' on match. If there is more than one pattern matching 999 character `%' in either the [4mnew_string[24m or [4mold_string[24m, only the first 1000 instance is treated specially (as the pattern character); all subse- 1001 quent instances are treated as regular characters. 1002 1003 Variable expansion occurs in the normal fashion inside both 1004 [4mold_string[24m and [4mnew_string[24m with the single exception that a backslash 1005 is used to prevent the expansion of a dollar sign (`$'), not a pre- 1006 ceding dollar sign as is usual. 1007 1008 [1m:@[4m[22mvarname[24m[1m@[4m[22mstring[24m[1m@[0m 1009 This is the loop expansion mechanism from the OSF Development Envi- 1010 ronment (ODE) make. Unlike [1m.for [22mloops, expansion occurs at the time 1011 of reference. For each word in the value, assign the word to the 1012 variable named [4mvarname[24m and evaluate [4mstring[24m. The ODE convention is 1013 that [4mvarname[24m should start and end with a period, for example: 1014 ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@} 1015 1016 However, a single-letter variable is often more readable: 1017 ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@} 1018 1019 [1m:_[22m[[1m=[4m[22mvar[24m] 1020 Saves the current variable value in `$_' or the named [4mvar[24m for later 1021 reference. Example usage: 1022 1023 M_cmpv.units = 1 1000 1000000 1024 M_cmpv = S,., ,g:_:range:@i@+ $${_:[-$$i]} \ 1025 \* $${M_cmpv.units:[$$i]}@:S,^,expr 0 ,1:sh 1026 1027 .if ${VERSION:${M_cmpv}} < ${3.1.12:L:${M_cmpv}} 1028 1029 Here `$_' is used to save the result of the `:S' modifier which is 1030 later referenced using the index values from `:range'. 1031 1032 [1m:U[4m[22mnewval[0m 1033 If the variable is undefined, [4mnewval[24m is the value. If the variable 1034 is defined, the existing value is returned. This is another ODE 1035 make feature. It is handy for setting per-target CFLAGS for in- 1036 stance: 1037 ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}} 1038 If a value is only required if the variable is undefined, use: 1039 ${VAR:D:Unewval} 1040 1041 [1m:D[4m[22mnewval[0m 1042 If the variable is defined, [4mnewval[24m is the value. 1043 1044 [1m:L [22mThe name of the variable is the value. 1045 1046 [1m:P [22mThe path of the node which has the same name as the variable is the 1047 value. If no such node exists or its path is null, the name of the 1048 variable is used. In order for this modifier to work, the name 1049 (node) must at least have appeared on the right-hand side of a de- 1050 pendency. 1051 1052 [1m:![4m[22mcmd[24m[1m![0m 1053 The output of running [4mcmd[24m is the value. 1054 1055 [1m:sh [22mThe value is run as a command, and the output becomes the new value. 1056 1057 [1m::=[4m[22mstr[0m 1058 The variable is assigned the value [4mstr[24m after substitution. This 1059 modifier and its variations are useful in obscure situations such as 1060 wanting to set a variable at a point where a target's shell commands 1061 are being parsed. These assignment modifiers always expand to noth- 1062 ing. 1063 1064 The `[1m::[22m' helps avoid false matches with the AT&T System V UNIX style 1065 [1m:= [22mmodifier and since substitution always occurs, the [1m::= [22mform is 1066 vaguely appropriate. 1067 1068 [1m::?=[4m[22mstr[0m 1069 As for [1m::= [22mbut only if the variable does not already have a value. 1070 1071 [1m::+=[4m[22mstr[0m 1072 Append [4mstr[24m to the variable. 1073 1074 [1m::!=[4m[22mcmd[0m 1075 Assign the output of [4mcmd[24m to the variable. 1076 1077 [1m:[[4m[22mrange[24m[1m][0m 1078 Selects one or more words from the value, or performs other opera- 1079 tions related to the way in which the value is split into words. 1080 1081 An empty value, or a value that consists entirely of white-space, is 1082 treated as a single word. For the purposes of the `[1m:[][22m' modifier, 1083 the words are indexed both forwards using positive integers (where 1084 index 1 represents the first word), and backwards using negative in- 1085 tegers (where index -1 represents the last word). 1086 1087 The [4mrange[24m is subjected to variable expansion, and the expanded re- 1088 sult is then interpreted as follows: 1089 1090 [4mindex[24m Selects a single word from the value. 1091 1092 [4mstart[24m[1m..[4m[22mend[0m 1093 Selects all words from [4mstart[24m to [4mend[24m, inclusive. For example, 1094 `[1m:[2..-1][22m' selects all words from the second word to the last 1095 word. If [4mstart[24m is greater than [4mend[24m, the words are output in 1096 reverse order. For example, `[1m:[-1..1][22m' selects all the words 1097 from last to first. If the list is already ordered, this ef- 1098 fectively reverses the list, but it is more efficient to use 1099 `[1m:Or[22m' instead of `[1m:O:[-1..1][22m'. 1100 1101 [1m* [22mCauses subsequent modifiers to treat the value as a single 1102 word (possibly containing embedded whitespace). Analogous to 1103 the effect of $* in Bourne shell. 1104 1105 0 Means the same as `[1m:[*][22m'. 1106 1107 [1m@ [22mCauses subsequent modifiers to treat the value as a sequence 1108 of words delimited by whitespace. Analogous to the effect of 1109 $@ in Bourne shell. 1110 1111 [1m# [22mReturns the number of words in the value. 1112 1113[1mDIRECTIVES[0m 1114 Makefile inclusion, conditional structures and for loops are provided in 1115 [1mbmake[22m. All such structures are identified by a line beginning with a 1116 single dot (`.') character, followed by the keyword of the directive, 1117 such as [1minclude [22mor [1mif[22m. 1118 1119 [1mFile inclusion[0m 1120 Files are included with either [1m.include <[4m[22mfile[24m[1m> [22mor [1m.include "[4m[22mfile[24m[1m"[22m. Vari- 1121 ables between the angle brackets or double quotes are expanded to form 1122 the file name. If angle brackets are used, the included makefile is ex- 1123 pected to be in the system makefile directory. If double quotes are 1124 used, the including makefile's directory and any directories specified 1125 using the [1m-I [22moption are searched before the system makefile directory. 1126 1127 For compatibility with other make variants, `[1minclude [4m[22mfile[24m ...' (without 1128 leading dot) is also accepted. 1129 1130 If the include statement is written as [1m.-include [22mor as [1m.sinclude[22m, errors 1131 locating and/or opening include files are ignored. 1132 1133 If the include statement is written as [1m.dinclude[22m, not only are errors lo- 1134 cating and/or opening include files ignored, but stale dependencies 1135 within the included file are ignored just like in [4m.MAKE.DEPENDFILE[24m. 1136 1137 [1mExporting variables[0m 1138 The directives for exporting and unexporting variables are: 1139 1140 [1m.export [4m[22mvariable[24m ... 1141 Export the specified global variable. If no variable list is 1142 provided, all globals are exported except for internal variables 1143 (those that start with `.'). This is not affected by the [1m-X[0m 1144 flag, so should be used with caution. For compatibility with 1145 other make programs, [1mexport [4m[22mvariable[24m[1m=[4m[22mvalue[24m (without leading dot) 1146 is also accepted. 1147 1148 Appending a variable name to [4m.MAKE.EXPORTED[24m is equivalent to ex- 1149 porting a variable. 1150 1151 [1m.export-env [4m[22mvariable[24m ... 1152 The same as `.export', except that the variable is not appended 1153 to [4m.MAKE.EXPORTED[24m. This allows exporting a value to the environ- 1154 ment which is different from that used by [1mbmake [22minternally. 1155 1156 [1m.export-literal [4m[22mvariable[24m ... 1157 The same as `.export-env', except that variables in the value are 1158 not expanded. 1159 1160 [1m.unexport [4m[22mvariable[24m ... 1161 The opposite of `.export'. The specified global [4mvariable[24m is re- 1162 moved from [4m.MAKE.EXPORTED[24m. If no variable list is provided, all 1163 globals are unexported, and [4m.MAKE.EXPORTED[24m deleted. 1164 1165 [1m.unexport-env[0m 1166 Unexport all globals previously exported and clear the environ- 1167 ment inherited from the parent. This operation causes a memory 1168 leak of the original environment, so should be used sparingly. 1169 Testing for [4m.MAKE.LEVEL[24m being 0 would make sense. Also note that 1170 any variables which originated in the parent environment should 1171 be explicitly preserved if desired. For example: 1172 1173 .if ${.MAKE.LEVEL} == 0 1174 PATH := ${PATH} 1175 .unexport-env 1176 .export PATH 1177 .endif 1178 1179 Would result in an environment containing only `PATH', which is 1180 the minimal useful environment. Actually `[4m.MAKE.LEVEL[24m' is also 1181 pushed into the new environment. 1182 1183 [1mMessages[0m 1184 The directives for printing messages to the output are: 1185 1186 [1m.info [4m[22mmessage[0m 1187 The message is printed along with the name of the makefile and 1188 line number. 1189 1190 [1m.warning [4m[22mmessage[0m 1191 The message prefixed by `warning:' is printed along with the name 1192 of the makefile and line number. 1193 1194 [1m.error [4m[22mmessage[0m 1195 The message is printed along with the name of the makefile and 1196 line number, [1mbmake [22mexits immediately. 1197 1198 [1mConditionals[0m 1199 The directives for conditionals are: 1200 1201 [1m.if [22m[[1m![22m][4mexpression[24m [[4moperator[24m [4mexpression[24m ...] 1202 Test the value of an expression. 1203 1204 [1m.ifdef [22m[[1m![22m][4mvariable[24m [[4moperator[24m [4mvariable[24m ...] 1205 Test the value of a variable. 1206 1207 [1m.ifndef [22m[[1m![22m][4mvariable[24m [[4moperator[24m [4mvariable[24m ...] 1208 Test the value of a variable. 1209 1210 [1m.ifmake [22m[[1m![22m][4mtarget[24m [[4moperator[24m [4mtarget[24m ...] 1211 Test the target being requested. 1212 1213 [1m.ifnmake [22m[[1m![22m][4mtarget[24m [[4moperator[24m [4mtarget[24m ...] 1214 Test the target being requested. 1215 1216 [1m.else [22mReverse the sense of the last conditional. 1217 1218 [1m.elif [22m[[1m![22m][4mexpression[24m [[4moperator[24m [4mexpression[24m ...] 1219 A combination of `[1m.else[22m' followed by `[1m.if[22m'. 1220 1221 [1m.elifdef [22m[[1m![22m][4mvariable[24m [[4moperator[24m [4mvariable[24m ...] 1222 A combination of `[1m.else[22m' followed by `[1m.ifdef[22m'. 1223 1224 [1m.elifndef [22m[[1m![22m][4mvariable[24m [[4moperator[24m [4mvariable[24m ...] 1225 A combination of `[1m.else[22m' followed by `[1m.ifndef[22m'. 1226 1227 [1m.elifmake [22m[[1m![22m][4mtarget[24m [[4moperator[24m [4mtarget[24m ...] 1228 A combination of `[1m.else[22m' followed by `[1m.ifmake[22m'. 1229 1230 [1m.elifnmake [22m[[1m![22m][4mtarget[24m [[4moperator[24m [4mtarget[24m ...] 1231 A combination of `[1m.else[22m' followed by `[1m.ifnmake[22m'. 1232 1233 [1m.endif [22mEnd the body of the conditional. 1234 1235 The [4moperator[24m may be any one of the following: 1236 1237 [1m|| [22mLogical OR. 1238 1239 [1m&& [22mLogical AND; of higher precedence than `[1m||[22m'. 1240 1241 [1mbmake [22monly evaluates a conditional as far as is necessary to determine 1242 its value. Parentheses can be used to override the operator precedence. 1243 The boolean operator `[1m![22m' may be used to logically negate an entire condi- 1244 tional. It is of higher precedence than `[1m&&[22m'. 1245 1246 The value of [4mexpression[24m may be any of the following: 1247 1248 [1mdefined [22mTakes a variable name as an argument and evaluates to true if 1249 the variable has been defined. 1250 1251 [1mmake [22mTakes a target name as an argument and evaluates to true if the 1252 target was specified as part of [1mbmake[22m's command line or was de- 1253 clared the default target (either implicitly or explicitly, see 1254 [4m.MAIN[24m) before the line containing the conditional. 1255 1256 [1mempty [22mTakes a variable name, with possible modifiers, and evaluates to 1257 true if the expansion of the variable results in an empty 1258 string. 1259 1260 [1mexists [22mTakes a file name as an argument and evaluates to true if the 1261 file exists. The file is searched for on the system search path 1262 (see [4m.PATH[24m). 1263 1264 [1mtarget [22mTakes a target name as an argument and evaluates to true if the 1265 target has been defined. 1266 1267 [1mcommands[0m 1268 Takes a target name as an argument and evaluates to true if the 1269 target has been defined and has commands associated with it. 1270 1271 [4mExpression[24m may also be an arithmetic or string comparison. Variable ex- 1272 pansion is performed on both sides of the comparison. If both sides are 1273 numeric and neither is enclosed in quotes, the comparison is done numeri- 1274 cally, otherwise lexicographically. A string is interpreted as hexadeci- 1275 mal integer if it is preceded by 0x, otherwise it is a decimal floating- 1276 point number; octal numbers are not supported. 1277 1278 All comparisons may use the operators `[1m==[22m' and `[1m!=[22m'. Numeric comparisons 1279 may also use the operators `[1m<[22m', `[1m<=[22m', `[1m>[22m' and `[1m>=[22m'. 1280 1281 If the comparison has neither a comparison operator nor a right side, the 1282 expression evaluates to true if it is nonempty and its numeric value (if 1283 any) is not zero. 1284 1285 When [1mbmake [22mis evaluating one of these conditional expressions, and it en- 1286 counters a (whitespace separated) word it doesn't recognize, either the 1287 "make" or "defined" function is applied to it, depending on the form of 1288 the conditional. If the form is `[1m.ifdef[22m', `[1m.ifndef[22m' or `[1m.if[22m', the 1289 "defined" function is applied. Similarly, if the form is `[1m.ifmake[22m' or 1290 `[1m.ifnmake[22m', the "make" function is applied. 1291 1292 If the conditional evaluates to true, parsing of the makefile continues 1293 as before. If it evaluates to false, the following lines are skipped. 1294 In both cases, this continues until the corresponding `[1m.else[22m' or `[1m.endif[22m' 1295 is found. 1296 1297 [1mFor loops[0m 1298 For loops are typically used to apply a set of rules to a list of files. 1299 The syntax of a for loop is: 1300 1301 [1m.for [4m[22mvariable[24m [[4mvariable[24m ...] [1min [4m[22mexpression[0m 1302 <make-lines> 1303 [1m.endfor[0m 1304 1305 The [1mexpression [22mis expanded and then split into words. On each iteration 1306 of the loop, one word is taken and assigned to each [1mvariable[22m, in order, 1307 and these [1mvariables [22mare substituted into the [1mmake-lines [22minside the body 1308 of the for loop. The number of words must come out even; that is, if 1309 there are three iteration variables, the number of words provided must be 1310 a multiple of three. 1311 1312 If `[1m.break[22m' is encountered within a [1m.for [22mloop, it causes early termina- 1313 tion of the loop, otherwise a parse error. 1314 1315 [1mOther directives[0m 1316 [1m.undef [4m[22mvariable[24m ... 1317 Un-define the specified global variables. Only global variables 1318 can be un-defined. 1319 1320[1mCOMMENTS[0m 1321 Comments begin with a hash (`#') character, anywhere but in a shell com- 1322 mand line, and continue to the end of an unescaped new line. 1323 1324[1mSPECIAL SOURCES (ATTRIBUTES)[0m 1325 [1m.EXEC [22mTarget is never out of date, but always execute commands any- 1326 way. 1327 1328 [1m.IGNORE [22mIgnore any errors from the commands associated with this tar- 1329 get, exactly as if they all were preceded by a dash (`-'). 1330 1331 [1m.MADE [22mMark all sources of this target as being up to date. 1332 1333 [1m.MAKE [22mExecute the commands associated with this target even if the [1m-n[0m 1334 or [1m-t [22moptions were specified. Normally used to mark recursive 1335 [1mbmake[22ms. 1336 1337 [1m.META [22mCreate a meta file for the target, even if it is flagged as 1338 [1m.PHONY[22m, [1m.MAKE[22m, or [1m.SPECIAL[22m. Usage in conjunction with [1m.MAKE [22mis 1339 the most likely case. In "meta" mode, the target is out-of- 1340 date if the meta file is missing. 1341 1342 [1m.NOMETA [22mDo not create a meta file for the target. Meta files are also 1343 not created for [1m.PHONY[22m, [1m.MAKE[22m, or [1m.SPECIAL [22mtargets. 1344 1345 [1m.NOMETA_CMP[0m 1346 Ignore differences in commands when deciding if target is out 1347 of date. This is useful if the command contains a value which 1348 always changes. If the number of commands change, though, the 1349 target is still considered out of date. The same effect ap- 1350 plies to any command line that uses the variable [4m.OODATE[24m, which 1351 can be used for that purpose even when not otherwise needed or 1352 desired: 1353 1354 1355 skip-compare-for-some: 1356 @echo this is compared 1357 @echo this is not ${.OODATE:M.NOMETA_CMP} 1358 @echo this is also compared 1359 1360 The [1m:M [22mpattern suppresses any expansion of the unwanted vari- 1361 able. 1362 1363 [1m.NOPATH [22mDo not search for the target in the directories specified by 1364 [4m.PATH[24m. 1365 1366 [1m.NOTMAIN [22mNormally [1mbmake [22mselects the first target it encounters as the 1367 default target to be built if no target was specified. This 1368 source prevents this target from being selected. 1369 1370 [1m.OPTIONAL[0m 1371 If a target is marked with this attribute and [1mbmake [22mcan't fig- 1372 ure out how to create it, it ignores this fact and assumes the 1373 file isn't needed or already exists. 1374 1375 [1m.PHONY [22mThe target does not correspond to an actual file; it is always 1376 considered to be out of date, and is not created with the [1m-t[0m 1377 option. Suffix-transformation rules are not applied to [1m.PHONY[0m 1378 targets. 1379 1380 [1m.PRECIOUS[0m 1381 When [1mbmake [22mis interrupted, it normally removes any partially 1382 made targets. This source prevents the target from being re- 1383 moved. 1384 1385 [1m.RECURSIVE[0m 1386 Synonym for [1m.MAKE[22m. 1387 1388 [1m.SILENT [22mDo not echo any of the commands associated with this target, 1389 exactly as if they all were preceded by an at sign (`@'). 1390 1391 [1m.USE [22mTurn the target into [1mbmake[22m's version of a macro. When the tar- 1392 get is used as a source for another target, the other target 1393 acquires the commands, sources, and attributes (except for 1394 [1m.USE[22m) of the source. If the target already has commands, the 1395 [1m.USE [22mtarget's commands are appended to them. 1396 1397 [1m.USEBEFORE[0m 1398 Like [1m.USE[22m, but instead of appending, prepend the [1m.USEBEFORE[0m 1399 target commands to the target. 1400 1401 [1m.WAIT [22mIf [1m.WAIT [22mappears in a dependency line, the sources that precede 1402 it are made before the sources that succeed it in the line. 1403 Since the dependents of files are not made until the file it- 1404 self could be made, this also stops the dependents being built 1405 unless they are needed for another branch of the dependency 1406 tree. So given: 1407 1408 x: a .WAIT b 1409 echo x 1410 a: 1411 echo a 1412 b: b1 1413 echo b 1414 b1: 1415 echo b1 1416 1417 the output is always `a', `b1', `b', `x'. 1418 1419 The ordering imposed by [1m.WAIT [22mis only relevant for parallel 1420 makes. 1421 1422[1mSPECIAL TARGETS[0m 1423 Special targets may not be included with other targets, i.e. they must be 1424 the only target specified. 1425 1426 [1m.BEGIN [22mAny command lines attached to this target are executed before 1427 anything else is done. 1428 1429 [1m.DEFAULT[0m 1430 This is sort of a [1m.USE [22mrule for any target (that was used only 1431 as a source) that [1mbmake [22mcan't figure out any other way to cre- 1432 ate. Only the shell script is used. The [4m.IMPSRC[24m variable of a 1433 target that inherits [1m.DEFAULT[22m's commands is set to the target's 1434 own name. 1435 1436 [1m.DELETE_ON_ERROR[0m 1437 If this target is present in the makefile, it globally causes 1438 make to delete targets whose commands fail. (By default, only 1439 targets whose commands are interrupted during execution are 1440 deleted. This is the historical behavior.) This setting can be 1441 used to help prevent half-finished or malformed targets from be- 1442 ing left around and corrupting future rebuilds. 1443 1444 [1m.END [22mAny command lines attached to this target are executed after ev- 1445 erything else is done successfully. 1446 1447 [1m.ERROR [22mAny command lines attached to this target are executed when an- 1448 other target fails. The [4m.ERROR_TARGET[24m variable is set to the 1449 target that failed. See also [4mMAKE_PRINT_VAR_ON_ERROR[24m. 1450 1451 [1m.IGNORE [22mMark each of the sources with the [1m.IGNORE [22mattribute. If no 1452 sources are specified, this is the equivalent of specifying the 1453 [1m-i [22moption. 1454 1455 [1m.INTERRUPT[0m 1456 If [1mbmake [22mis interrupted, the commands for this target are exe- 1457 cuted. 1458 1459 [1m.MAIN [22mIf no target is specified when [1mbmake [22mis invoked, this target is 1460 built. 1461 1462 [1m.MAKEFLAGS[0m 1463 This target provides a way to specify flags for [1mbmake [22mat the 1464 time when the makefiles are read. The flags are as if typed to 1465 the shell, though the [1m-f [22moption has no effect. 1466 1467 [1m.NOPATH [22mApply the [1m.NOPATH [22mattribute to any specified sources. 1468 1469 [1m.NOTPARALLEL[0m 1470 Disable parallel mode. 1471 1472 [1m.NO_PARALLEL[0m 1473 Synonym for [1m.NOTPARALLEL[22m, for compatibility with other pmake 1474 variants. 1475 1476 [1m.OBJDIR [22mThe source is a new value for `[4m.OBJDIR[24m'. If it exists, [1mbmake[0m 1477 changes the current working directory to it and updates the 1478 value of `[4m.OBJDIR[24m'. 1479 1480 [1m.ORDER [22mIn parallel mode, the named targets are made in sequence. This 1481 ordering does not add targets to the list of targets to be made. 1482 1483 Since the dependents of a target do not get built until the tar- 1484 get itself could be built, unless `a' is built by another part 1485 of the dependency graph, the following is a dependency loop: 1486 1487 .ORDER: b a 1488 b: a 1489 1490 [1m.PATH [22mThe sources are directories which are to be searched for files 1491 not found in the current directory. If no sources are speci- 1492 fied, any previously specified directories are removed from the 1493 search path. If the source is the special [1m.DOTLAST [22mtarget, the 1494 current working directory is searched last. 1495 1496 [1m.PATH.[4m[22msuffix[0m 1497 Like [1m.PATH [22mbut applies only to files with a particular suffix. 1498 The suffix must have been previously declared with [1m.SUFFIXES[22m. 1499 1500 [1m.PHONY [22mApply the [1m.PHONY [22mattribute to any specified sources. 1501 1502 [1m.POSIX [22mIf this is the first non-comment line in the main makefile, the 1503 variable [4m%POSIX[24m is set to the value `1003.2' and the makefile 1504 `<posix.mk>' is included if it exists, to provide POSIX-compati- 1505 ble default rules. If [1mbmake [22mis run with the [1m-r [22mflag, only 1506 `posix.mk' contributes to the default rules. 1507 1508 [1m.PRECIOUS[0m 1509 Apply the [1m.PRECIOUS [22mattribute to any specified sources. If no 1510 sources are specified, the [1m.PRECIOUS [22mattribute is applied to ev- 1511 ery target in the file. 1512 1513 [1m.SHELL [22mSets the shell that [1mbmake [22muses to execute commands. The sources 1514 are a set of [4mfield[24m[1m=[4m[22mvalue[24m pairs. 1515 1516 name This is the minimal specification, used to select 1517 one of the built-in shell specs; sh, ksh, and csh. 1518 1519 path Specifies the absolute path to the shell. 1520 1521 hasErrCtl Indicates whether the shell supports exit on error. 1522 1523 check The command to turn on error checking. 1524 1525 ignore The command to disable error checking. 1526 1527 echo The command to turn on echoing of commands executed. 1528 1529 quiet The command to turn off echoing of commands exe- 1530 cuted. 1531 1532 filter The output to filter after issuing the quiet com- 1533 mand. It is typically identical to quiet. 1534 1535 errFlag The flag to pass the shell to enable error checking. 1536 1537 echoFlag The flag to pass the shell to enable command echo- 1538 ing. 1539 1540 newline The string literal to pass the shell that results in 1541 a single newline character when used outside of any 1542 quoting characters. 1543 Example: 1544 1545 .SHELL: name=ksh path=/bin/ksh hasErrCtl=true \ 1546 check="set -e" ignore="set +e" \ 1547 echo="set -v" quiet="set +v" filter="set +v" \ 1548 echoFlag=v errFlag=e newline="'\n'" 1549 1550 [1m.SILENT [22mApply the [1m.SILENT [22mattribute to any specified sources. If no 1551 sources are specified, the [1m.SILENT [22mattribute is applied to every 1552 command in the file. 1553 1554 [1m.STALE [22mThis target gets run when a dependency file contains stale en- 1555 tries, having [4m.ALLSRC[24m set to the name of that dependency file. 1556 1557 [1m.SUFFIXES[0m 1558 Each source specifies a suffix to [1mbmake[22m. If no sources are 1559 specified, any previously specified suffixes are deleted. It 1560 allows the creation of suffix-transformation rules. 1561 1562 Example: 1563 1564 .SUFFIXES: .o 1565 .c.o: 1566 cc -o ${.TARGET} -c ${.IMPSRC} 1567 1568[1mENVIRONMENT[0m 1569 [1mbmake [22muses the following environment variables, if they exist: MACHINE, 1570 MACHINE_ARCH, MAKE, MAKEFLAGS, MAKEOBJDIR, MAKEOBJDIRPREFIX, MAKESYSPATH, 1571 PWD, and TMPDIR. 1572 1573 MAKEOBJDIRPREFIX and MAKEOBJDIR may only be set in the environment or on 1574 the command line to [1mbmake [22mand not as makefile variables; see the descrip- 1575 tion of `[4m.OBJDIR[24m' for more details. 1576 1577[1mFILES[0m 1578 .depend list of dependencies 1579 Makefile list of dependencies 1580 makefile list of dependencies 1581 sys.mk system makefile 1582 /usr/share/mk system makefile directory 1583 1584[1mCOMPATIBILITY[0m 1585 The basic make syntax is compatible between different make variants; how- 1586 ever the special variables, variable modifiers and conditionals are not. 1587 1588 [1mOlder versions[0m 1589 An incomplete list of changes in older versions of [1mbmake[22m: 1590 1591 The way that .for loop variables are substituted changed after NetBSD 5.0 1592 so that they still appear to be variable expansions. In particular this 1593 stops them being treated as syntax, and removes some obscure problems us- 1594 ing them in .if statements. 1595 1596 The way that parallel makes are scheduled changed in NetBSD 4.0 so that 1597 .ORDER and .WAIT apply recursively to the dependent nodes. The algo- 1598 rithms used may change again in the future. 1599 1600 [1mOther make dialects[0m 1601 Other make dialects (GNU make, SVR4 make, POSIX make, etc.) do not sup- 1602 port most of the features of [1mbmake [22mas described in this manual. Most no- 1603 tably: 1604 1605 [1m+o [22mThe [1m.WAIT [22mand [1m.ORDER [22mdeclarations and most functionality per- 1606 taining to parallelization. (GNU make supports parallelization 1607 but lacks these features needed to control it effectively.) 1608 1609 [1m+o [22mDirectives, including for loops and conditionals and most of 1610 the forms of include files. (GNU make has its own incompatible 1611 and less powerful syntax for conditionals.) 1612 1613 [1m+o [22mAll built-in variables that begin with a dot. 1614 1615 [1m+o [22mMost of the special sources and targets that begin with a dot, 1616 with the notable exception of [1m.PHONY[22m, [1m.PRECIOUS[22m, and [1m.SUFFIXES[22m. 1617 1618 [1m+o [22mVariable modifiers, except for the 1619 :old=new 1620 string substitution, which does not portably support globbing 1621 with `%' and historically only works on declared suffixes. 1622 1623 [1m+o [22mThe [1m$> [22mvariable even in its short form; most makes support this 1624 functionality but its name varies. 1625 1626 Some features are somewhat more portable, such as assignment with [1m+=[22m, [1m?=[22m, 1627 and [1m!=[22m. The [4m.PATH[24m functionality is based on an older feature [1mVPATH [22mfound 1628 in GNU make and many versions of SVR4 make; however, historically its be- 1629 havior is too ill-defined (and too buggy) to rely upon. 1630 1631 The [1m$@ [22mand [1m$< [22mvariables are more or less universally portable, as is the 1632 [1m$(MAKE) [22mvariable. Basic use of suffix rules (for files only in the cur- 1633 rent directory, not trying to chain transformations together, etc.) is 1634 also reasonably portable. 1635 1636[1mSEE ALSO[0m 1637 mkdep(1) 1638 1639[1mHISTORY[0m 1640 [1mbmake [22mis derived from NetBSD make(1). It uses autoconf to facilitate 1641 portability to other platforms. 1642 1643 A make command appeared in Version 7 AT&T UNIX. This make implementation 1644 is based on Adam de Boor's pmake program, which was written for Sprite at 1645 Berkeley. It was designed to be a parallel distributed make running jobs 1646 on different machines using a daemon called "customs". 1647 1648 Historically the target/dependency [1mFRC [22mhas been used to FoRCe rebuilding 1649 (since the target/dependency does not exist... unless someone creates an 1650 [4mFRC[24m file). 1651 1652[1mBUGS[0m 1653 The make syntax is difficult to parse without actually acting on the 1654 data. For instance, finding the end of a variable's use should involve 1655 scanning each of the modifiers, using the correct terminator for each 1656 field. In many places make just counts {} and () in order to find the 1657 end of a variable expansion. 1658 1659 There is no way of escaping a space character in a filename. 1660 1661FreeBSD 13.0 September 12, 2022 FreeBSD 13.0 1662