--- /dev/null
+2012-10-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20121010
+ o protect syntax that only bmake parses correctly.
+ o remove auto setting of FORCE_MACHINE, use configure's
+ --with-force-machine=whatever if that is desired.
+
+2012-10-08 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in: do not lose history from make.1 when generating bmake.1
+
+2012-10-07 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20121007
+ Merge with NetBSD make, pick up
+ o compat.c: ignore empty commands - same as jobs mode.
+ o make.1: document meta chars that cause use of shell
+
+2012-09-11 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120911
+ * bsd.after-import.mk: include Makefile.inc early and allow it to
+ override PROG
+
+2012-08-31 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120831
+ Merge with NetBSD make, pick up
+ o cast sizeof() to int for comparison
+ o minor make.1 tweak
+
+2012-08-30 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120830
+ Merge with NetBSD make, pick up
+ o .MAKE.EXPAND_VARIABLES knob can control default behavior of -V
+ o debug flag -dV causes -V to show raw value regardless.
+
+2012-07-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * bsd.after-import.mk (after-import): ensure unit-tests/Makefile
+ gets SRCTOP set.
+
+2012-07-04 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120704
+ Merge with NetBSD make, pick up
+ o Job_ParseShell should call Shell_Init if it has been
+ previously called.
+ * Makefile.in: set USE_META based on configure result.
+ also .PARSEDIR is safer indicator of bmake.
+
+2012-06-26 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in: bump version to 20120626
+ ensure CPPFLAGS is in CFLAGS
+ * meta.c: avoid nested externs
+ * bsd.after-import.mk: avoid ${.CURDIR}/Makefile as target
+
+2012-06-20 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120620
+ Merge with NetBSD make, pick up
+ o make_malloc.c: avoid including make_malloc.h again
+
+ * Makefile.in: avoid bmake only syntax or protect with
+ .if defined(.MAKE.LEVEL)
+ * bsd.after-import.mk: replace .-include with .sinclude
+ ensure? SRCTOP gets a value
+ * configure.in: look for filemon.h in /usr/include/dev/filemon first.
+
+2012-06-19 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120612
+ Merge with NetBSD make, pick up
+ o use MAKE_ATTR_* rather than those defined by cdefs.h or compiler
+ for greater portability.
+ o unit-tests/forloop: check that .for works as expected wrt
+ number of times and with "quoted strings".
+
+2012-06-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120606
+ Merge with NetBSD make, pick up
+ o compat.c: use kill(2) rather than raise(3).
+ * configure.in: look for sys/dev/filemon
+ * bsd.after-import.mk: add a .-include "Makefile.inc" to Makefile
+ and pass BOOTSTRAP_XTRAS to boot-strap.
+
+2012-06-04 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120604
+ Merge with NetBSD make, pick up
+ o util.c and var.c share same var for tracking if environ
+ has been reallocated.
+ o util.c provide getenv with setenv.
+ * Add MAKE_LEVEL_SAFE as an alternate means of passing MAKE_LEVEL
+ when the shell actively strips .MAKE.* from the environment.
+ We still refer to the variable always as .MAKE.LEVEL
+ * util.c fix bug in findenv() was finding prefix of name.
+ * compat.c: re-raising SIGINT etc after running .INTERRUPT
+ results in more reliable termination of all activity on many
+ platforms.
+
+2012-06-02 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120602
+ Merge with NetBSD make, pick up
+ o for.c: handle quoted items in .for list
+
+2012-05-30 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120530
+ Merge with NetBSD make, pick up
+ o compat.c: ignore empty command.
+
+2012-05-24 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120524
+ * FILES: add bsd.after-import.mk:
+ A simple means of integrating bmake into a BSD build system.
+
+2012-05-20 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120520
+ Merge with NetBSD make, pick up
+ o increased limit for nested conditionals.
+
+2012-05-18 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120518
+ Merge with NetBSD make, pick up
+ o use _exit(2) in signal hanlder
+ o Don't use the [dir] cache when building nodes that might have
+ changed since the last exec.
+ o Avoid nested extern declaration warnings.
+
+2012-04-27 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * meta.c (fgetLine): avoid %z - not portable.
+ * parse.c: Since we moved include of sys/mman.h
+ and def's of MAP_COPY etc. we got dups from a merge.
+
+2012-04-24 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120420
+ Merge with NetBSD make, pick up
+ o restore duplicate supression in .MAKE.MAKEFILES
+ runtime saving can be significant.
+ o Var_Subst() uses Buf_DestroyCompact() to reduce memory
+ consumption up to 20%.
+
+2012-04-20 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120420
+ Merge with NetBSD make, pick up
+ o remove duplicate supression in .MAKE.MAKEFILES
+ o improved dir cache behavior
+ o gmake'ish export command
+
+2012-03-25 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20120325
+ Merge with NetBSD make, pick up
+ o fix parsing of :[#] in conditionals.
+
+2012-02-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in: replace use of .Nx in bmake.1 with NetBSD
+ since some systems cannot cope with .Nx <version>
+
+2011-11-14 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20111111
+ Merge with NetBSD make, pick up
+ o debug output for .PARSEDIR and .PARSEFILE
+
+2011-10-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20111010
+
+2011-10-09 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * boot-strap: check for an expected file in the dirs we look for.
+ * make-bootstrap.sh: pass on LDSTATIC
+
+2011-10-01 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20111001
+ Merge with NetBSD make, pick up
+ o ensure .PREFIX is set for .PHONY
+ and .TARGET set for .PHONY run via .END
+ o __dead used consistently
+
+2011-09-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): 20110909 is a better number ;-)
+
+2011-09-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110905
+ Merge with NetBSD make, pick up
+ o meta_oodate: ignore makeDependfile
+
+2011-08-28 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110828
+ Merge with NetBSD make, pick up
+ o silent=yes in .MAKE.MODE causes meta mode to mark targets
+ as SILENT if a .meta file is created
+
+2011-08-18 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110818
+ Merge with NetBSD make, pick up
+ o in meta mode, if target flagged .META a missing .meta file
+ means target is out-of-date
+ o fixes for gcc 4.5 warnings
+ o simplify job printing code
+
+2011-08-09 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110808
+ Merge with NetBSD make, pick up
+ o do not touch OP_SPECIAL targets when doing make -t
+
+2011-06-22 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110622
+ Merge with NetBSD make, pick up
+ o meta_oodate detect corrupted .meta file and declare oodate.
+ * configure.in: add check for setsid
+
+2011-06-07 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Merge with NetBSD make, pick up
+ o unit-tests/modts now works on MirBSD
+
+2011-06-04 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110606
+ Merge with NetBSD make, pick up
+ o ApplyModifiers: when we parse a variable which is not
+ the entire modifier string, or not followed by ':', do not
+ consider it as containing modifiers.
+ o loadfile: ensure newline at end of mapped file.
+
+2011-05-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110505
+ Merge with NetBSD make, pick up
+ o .MAKE.META.BAILIWICK - list of prefixes which define the scope
+ of make's control. In meta mode, any generated file within
+ said bailiwick, which is found to be missing, causes current
+ target to be out-of-date.
+
+2011-04-11 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110411
+ Merge with NetBSD make, pick up
+ o when long modifiers fail to match, check sysV style.
+ - add a test case
+
+2011-04-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110410
+ Merge with NetBSD make, pick up
+ o :hash - cheap 32bit hash of value
+ o :localtime, :gmtime - use value as format string for strftime.
+
+2011-03-30 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110330
+ mostly because its a cooler version.
+ Merge with NetBSD make, pick up
+ o NetBSD tags for meta.[ch]
+ o job.c call meta_job_finish() after meta_job_error().
+ o meta_job_error() should call meta_job_finish() to ensure
+ .meta file is closed, and safe to copy - if .ERROR target wants.
+ meta_job_finish() is safe to call repeatedly.
+
+2011-03-29 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * unit-tests/modts: use printf if it is a builtin,
+ to save us from MirBSD
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110329
+ Merge with NetBSD make, pick up
+ o fix for use after free() in CondDoExists().
+ o meta_oodate() report extra commands and return earlier.
+
+2011-03-27 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110327
+ Merge with NetBSD make, pick up
+ o meta.c, if .MAKE.MODE contains curdirOk=yes
+ allow creating .meta files in .CURDIR
+ * boot-strap (TOOL_DIFF): aparently at least on linux distro
+ formats the output of 'type' differently - so eat any "()"
+
+2011-03-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110306
+ Merge with NetBSD make, pick up
+ o meta.c, only do getcwd() once
+
+2011-03-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110305
+ Merge with NetBSD make, pick up
+ o correct sysV substitution handling of empty lhs and variable
+ o correct exists() check for dir with trailing /
+ o correct handling of modifiers for non-existant variables
+ during evaluation of conditionals.
+ o ensure MAP_FILE is defined.
+ o meta.c use curdir[] now exported by main.c
+
+2011-02-25 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110225
+ Merge with NetBSD make, pick up
+ o fix for incorrect .PARSEDIR when .OBJDIR is re-computed after
+ makefiles have been read.
+ o fix example of :? modifier in man page.
+
+2011-02-13 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110214
+ Merge with NetBSD make, pick up
+ o meta.c handle realpath() failing when generating meta file
+ name.
+
+ * sigcompat.c: convert to ansi so we can use higher warning levels.
+
+
+2011-02-07 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110207
+ Merge with NetBSD make, pick up
+ o fix for bug in meta mode.
+
+2011-01-03 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * parse.c: SunOS 5.8 at least does not have MAP_FILE
+
+2011-01-01 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20110101
+ Merge with NetBSD make, pick up
+ o use mmap(2) if available, for reading makefiles
+
+2010-12-15 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20101215
+ Merge with NetBSD make, pick up
+ o ensure meta_job_error() does not report a previous .meta file
+ as being culprit.
+
+2010-12-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20101210
+ Merge with NetBSD make, pick up
+ o meta_oodate: track cwd per process, and only consider target
+ out-of-date if missing file is outside make's CWD.
+ Ignore files in /tmp/ etc.
+ o to ensure unit-tests results match, need to control LC_ALL
+ as well as LANG.
+ o fix for parsing bug in var.c
+
+2010-11-26 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20101126
+ Merge with NetBSD make, pick up
+ o if stale dependency is an IMPSRC, search via .PATH
+ o meta_oodate: if a referenced file is missing, target is
+ out-of-date.
+ o meta_oodate: if a target uses .OODATE in its commands,
+ it (.OODATE) needs to be recomputed.
+ o keep a pointer to youngest child node, rather than just its
+ mtime.
+
+2010-11-02 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20101101
+
+2010-10-16 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * machine.sh: like os.sh,
+ allow for uname -p producing useless drivel
+
+2010-09-13 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * boot-strap: document configure knobs for meta and filemon.
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100911
+ Merge with NetBSD make, pick up
+ o meta.c - meta mode
+
+ * make-bootstrap.sh.in: handle meta.c
+ * configure.in: add knobs for use_meta and filemon_h
+ also, look for dirname, str[e]sep and strlcpy
+ * util.c: add simple err[x] and warn[x]
+
+2010-08-08 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * boot-strap (TOOL_DIFF): set this to ensure tests use
+ the same version of diff that configure tested
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100808
+ Merge with NetBSD make, pick up
+ o in jobs mode, when we discover we cannot make something,
+ call PrintOnError before exit.
+
+2010-08-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100806
+ Merge with NetBSD make, pick up
+ o formatting fixes for ignored errors
+ o ensure jobs are cleaned up regardless of where wait() was called.
+
+2010-06-28 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100618
+ * os.sh (MACHINE_ARCH): watch out for drivel from uname -p
+
+2010-06-16 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100616
+ Merge with NetBSD make, pick up
+ o man page update
+ o call PrintOnError from JobFinish when we detect an error we
+ are not ignoring.
+
+2010-06-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100606
+ Merge with NetBSD make, pick up
+ o man page update
+
+2010-06-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100605
+ Merge with NetBSD make, pick up
+ o use bmake_signal() which is a wrapper around sigaction()
+ in place of signal()
+ o add .export-env to allow exporting variables to environment
+ without tracking (so no re-export when the internal value is
+ changed).
+
+2010-05-24 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100524
+ Merge with NetBSD make, pick up
+ o fix for .info et al being greedy.
+
+2010-05-23 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100520
+ Merge with NetBSD make, pick up
+ o back to using realpath on argv[0]
+ but only if contains '/' and does not start with '/'.
+
+2010-05-10 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * boot-strap: use absolute path for bmake when running tests.
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100510
+ Merge with NetBSD make, pick up
+ o revert use of realpath on argv[0]
+ too many corner cases.
+ o print MAKE_PRINT_VAR_ON_ERROR before running .ERROR target.
+
+2010-05-05 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100505
+ Merge with NetBSD make, pick up
+ o fix for missed SIGCHLD when compiled with SunPRO
+ actually for bmake, defining FORCE_POSIX_SIGNALS would have
+ done the job.
+
+2010-04-30 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100430
+ Merge with NetBSD make, pick up
+ o fflush stdout before writing to stdout
+
+2010-04-23 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100423
+ Merge with NetBSD make, pick up
+ o updated unit tests for Haiku (this time for sure).
+ * boot-strap: based on patch from joerg
+ honor --with-default-sys-path better.
+ * boot-strap: remove mention of --with-prefix-sys-path
+
+2010-04-22 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100422
+ * Merge with NetBSD make, pick up
+ o fix for vfork() on Darwin.
+ o fix for bogus $TMPDIR.
+ o set .MAKE.MODE=compat for -B
+ o set .MAKE.JOBS=max_jobs for -j max_jobs
+ o allow unit-tests to run without any *.mk
+ o unit-tests/modmisc be more conservative in dirs presumed to exist.
+ * boot-strap: ignore /usr/share/mk except on NetBSD.
+ * unit-tests/Makefile.in: set LANG=C when running unit-tests to
+ ensure sort(1) behaves as expected.
+
+2010-04-21 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * boot-strap: add FindHereOrAbove so we can use -m .../mk
+
+2010-04-20 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100420
+ * Merge with NetBSD make, pick up
+ o fix for variable realpath() behavior.
+ we have to stat(2) the result to be sure.
+ o fix for .export (all) when nested vars use :sh
+
+2010-04-14 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100414
+ * Merge with NetBSD make, pick up
+ o use realpath to resolve argv[0] (for .MAKE) if needed.
+ o add realpath from libc.
+ o add :tA to resolve variable via realpath(3) if possible.
+
+2010-04-08 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100408
+ * Merge with NetBSD make, pick up
+ o unit tests for .ERROR, .error
+ o fix for .ERROR to ensure it cannot be default target.
+
+2010-04-06 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100406
+ * Merge with NetBSD make, pick up
+ o fix for compat mode "Error code" going to debug_file.
+ o fix for .ALLSRC being populated twice.
+ o support for .info, .warning and .error directives
+ o .MAKE.MODE to control make's operational mode
+ o .MAKE.MAKEFILE_PREFERENCE to control the preferred makefile
+ name(s).
+ o .MAKE.DEPENDFILE to control the name of the depend file
+ o .ERROR target - run on failure.
+
+2010-03-18 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * make-bootstrap.sh.in: extract MAKE_VERSION from Makefile
+
+ * os.sh,arch.c: patch for Haiku from joerg at netbsd
+
+2010-03-17 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100222
+ * Merge with NetBSD make, pick up
+ o better error msg for .for with mutiple inter vars
+
+ * boot-strap:
+ o use make-bootstrap.sh from joerg at netbsd
+ to avoid the need for a native make when bootstrapping.
+ o add "" everywhere ;-)
+ o if /usr/share/tmac/andoc.tmac exists install nroff bmake.1
+ otherwise the pre-formated version.
+
+2010-01-04 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20100102
+ * Merge with NetBSD make, pick up:
+ o fix for -m .../
+
+2009-11-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20091118
+ * Merge with NetBSD make, pick up:
+ o .unexport
+ o report lines that start with '.' and should have ':'
+ (catch typo's of .el*if).
+
+2009-10-30 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * configure.in: Ensure that srcdir and mksrc are absolute paths.
+
+2009-10-09 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): fix version to 20091007
+
+2009-10-07 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 200910007
+ * Merge with NetBSD make, pick up:
+ o fix for parsing of :S;...;...; applied to .for loop iterator
+ appearing in a dependency line.
+
+2009-09-09 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20090909
+ * Merge with NetBSD make, pick up:
+ o fix for -C, .CURDIR and .OBJDIR
+ * boot-strap:
+ o allow share_dir to be set independent of prefix.
+ o select default share_dir better when prefix ends in $HOST_TARGET
+ o if FORCE_BSD_MK etc were set, include them in the suggested
+ install-mk command.
+
+2009-09-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20090908
+ * Merge with NetBSD make, pick up:
+ o .MAKE.LEVEL for recursion tracking
+ o fix for :M scanning \:
+
+2009-09-03 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * configure.in: Don't -D__EXTENSIONS__ if
+ AC_USE_SYSTEM_EXTENSIONS says "no".
+
+2009-08-26 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (MAKE_VERSION): bump version to 20090826
+ Simplify MAKE_VERSION to just the bare date.
+ * Merge with NetBSD make, pick up:
+ o -C directory support.
+ o support for SIGINFO
+ o use $TMPDIR for temp files.
+ o child of vfork should be careful about modifying parent's state.
+
+
+2009-03-26 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Appy some patches for MiNT from David Brownlee
+
+2009-02-26 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20090222
+ * Merge with NetBSD make, pick up:
+ o Possible null pointer de-ref in Var_Set.
+
+2009-02-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20090204
+ * Merge with NetBSD make, pick up:
+ o bmake_malloc et al moved to their own .c
+ o Count both () and {} when looking for the end of a :M pattern
+ o Change 'Buffer' so that it is the actual struct, not a pointer to it.
+ o strlist.c - functions for processing extendable arrays of pointers to strings.
+ o ClientData replaced with void *, so const void * can be used.
+ o New debug flag C for DEBUG_CWD
+
+2008-11-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20081111
+ Apply patch from Joerg Sonnenberge to
+ configure.in:
+ o remove some redundant checks
+ o check for emlloc etc only in libutil and require the whole family.
+ util.c:
+ o remove [v]asprintf which is no longer used.
+
+2008-11-04 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20081101
+ * Merge with NetBSD make, pick up:
+ o util.c: avoid use of putenv() - christos
+
+2008-10-30 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20081030
+ pick up man page tweaks.
+
+2008-10-29 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in: move processing of LIBOBJS to after is definition!
+ thus we'll have getenv.c in SRCS only if needed.
+
+ * make.1: add examples of how to use :?
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20081029
+ * Merge with NetBSD make, pick up:
+ o fix for .END processing with -j
+ o segfault from Parse_Error when no makefile is open
+ o handle numeric expressions in any variable expansion
+ o debug output now defaults to stderr, -dF to change it - apb
+ o make now uses bmake_malloc etc so that it can build natively
+ on A/UX - wasn't an issue for bmake, but we want to keep in sync.
+
+2008-09-27 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080808
+ * Merge with NetBSD make, pick up:
+ o fix for PR/38840: Pierre Pronchery: make crashes while parsing
+ long lines in Makefiles
+ o optimizations for VarQuote by joerg
+ o fix for PR/38756: dominik: make dumps core on invalid makefile
+
+2008-05-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080515
+ * Merge with NetBSD make, pick up:
+ o fix skip setting vars in VAR_GLOBAL context, to handle
+ cases where VAR_CMD is used for other than command line vars.
+
+2008-05-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap (make_version): we may need to look in
+ $prefix/share/mk for sys.mk
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080514
+ * Merge with NetBSD make, pick up:
+ o skip setting vars in VAR_GLOBAL context, when already set in
+ VAR_CMD which takes precedence.
+
+2008-03-30 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080330
+ * Merge with NetBSD make, pick up:
+ o fix for ?= when LHS contains variable reference.
+
+2008-02-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * merge some patches from NetBSD pkgsrc.
+
+ * makefile.boot.in (BOOTSTRAP_SYS_PATH): Allow better control of
+ the MAKSYSPATH used during bootstrap.
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080215
+ * Merge with NetBSD make, pick up:
+ o warn if non-space chars follow 'empty' in a conditional.
+
+2008-01-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080118
+ * Merge with NetBSD make, pick up:
+ o consider dependencies read from .depend as optional - dsl
+ o remember when buffer for reading makefile grows - dsl
+ o add -dl (aka LOUD) - David O'Brien
+
+2007-10-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071022
+ * Merge with NetBSD make, pick up:
+ o Allow .PATH<suffix> to be used for .include ""
+
+ * boot-strap: source default settings from .bmake-boot-strap.rc
+
+2007-10-16 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in: fix maninstall on various systems
+ provided that our man.mk is used.
+ For non-BSD systems we install the preformatted page
+ into $MANDIR/cat1
+
+2007-10-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap: make bmake.1 too, so maninstall works.
+
+2007-10-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071014
+ * Merge with NetBSD make, pick up:
+ o revamped handling of defshell - configure no longer needs to
+ know the content of the shells array - apb
+ o stop Var_Subst modifying its input - apb
+ o avoid calling ParseTrackInput too often - dsl
+
+2007-10-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071011
+ * Merge with NetBSD make, pick up:
+ o fix Shell_Init for case that _BASENAME_DEFSHELL is absolute path.
+
+ * sigcompat.c: some tweaks for HP-UX 11.x based on
+ patch from Tobias Nygren
+
+ * configure.in: update handling of --with-defshell to match
+ new make behavior. --with-defshell=/usr/xpg4/bin/sh
+ will now do what one might hope - provided the chosen shell
+ behaves enough like sh.
+
+2007-10-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20071008
+ * Merge with NetBSD make, pick up:
+ o .MAKE.JOB.PREFIX - control the token output before jobs - sjg
+ o .export/.MAKE.EXPORTED - export of variables - sjg
+ o .MAKE.MAKEFILES - track all makefiles read - sjg
+ o performance improvements - dsl
+ o revamp parallel job scheduling - dsl
+
+2006-07-28 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060728
+ * Merge with NetBSD make, pick up:
+ o extra debug info during variable and cond processing - sjg
+ o shell definition now covers newline - rillig
+ o minor mem leak in PrintOnError - sjg
+
+2006-05-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060511
+ * Merge with NetBSD make, pick up:
+ o more memory leaks - coverity
+ o possible overflow in ArchFindMember - coverity
+ o extract variable modifier code out of Var_Parse()
+ so it can be called recursively - sjg
+ o unit-tests/moderrs - sjg
+
+2006-04-12 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060412
+ * Merge with NetBSD make, pick up:
+ o fixes for some memory leaks - coverity
+ o only read first sys.mk etc when searching sysIncPath - sjg
+
+ * main.c (ReadMakefile): remove hack for __INTERIX that prevented
+ setting ${MAKEFILE} - OBATA Akio
+
+2006-03-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060318
+ * Merge with NetBSD make, pick up:
+ o cleanup of job.c to remove remote handling, distcc is more
+ useful and this code was likely bit-rotting - dsl
+ o fix for :P modifier - sjg
+ * boot-strap: set default prefix to something reasonable
+ (for me anyway).
+
+2006-03-01 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060301
+ * Merge with NetBSD make, pick up:
+ o make .WAIT apply recursively, document and test case - apb
+ o allow variable modifiers in a variable appear anywhere in
+ modifier list, document and test case - sjg
+
+2006-02-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060222
+ * Merge with NetBSD make, pick up:
+ o improved job token handling - dsl
+ o SIG_DFL the correct signal before exec - dsl
+ o more debug info during parsing - dsl
+ o allow variable modifiers to be specified via variable - sjg
+ * boot-strap: explain why we died if no mksrc
+
+2005-11-05 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20051105
+ * configure.in: always set default_sys_path
+ default is ${prefix}/share/mk
+ - remove prefix_sys_path, anyone wanting more than above
+ needs to set it manually.
+
+2005-11-04 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap: make this a bit easier for pkgsrc folk.
+ bootstrap still fails on IRIX64 since MACHINE_ARCH gets set to
+ 'mips' while pkgsrc wants 'mipseb' or 'mipsel'
+
+2005-11-02 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20051102
+ * job.c (JobFinish): fix likely ancient merge lossage
+ fix from Todd Vierling.
+ * boot-strap (srcdir): allow setting mksrc=none
+
+2005-10-31 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20051031
+ * ranlib.h: skip on OSF too.
+ (NetBSD PR 31864)
+
+2005-10-10 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20051002
+ fix a silly typo
+
+2005-10-09 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20051001
+ support for UnixWare and some other systems,
+ based on patches from pkgsrc/bootstrap
+
+2005-09-03 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20050901
+ * Merge with NetBSD make, pick up:
+ o possible parse error causing us to wander off.
+
+2005-06-06 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20050606
+ * Merge with NetBSD make, pick up:
+ o :0x modifier for randomizing a list
+ o fixes for a number of -Wuninitialized issues.
+
+2005-05-30 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20050530
+ * Merge with NetBSD make, pick up:
+ o Handle dependencies for .BEGIN, .END and .INTERRUPT
+
+ * README: was seriously out of date.
+
+2005-03-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Important to use .MAKE rather than MAKE.
+
+2005-03-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20050315
+ * Merge with NetBSD make, pick up:
+ o don't mistake .elsefoo for .else
+ o use suffix-specific search path correctly
+ o bunch of style nits
+
+2004-05-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap:
+ o ensure that args to --src and --with-mksrc
+ are resolved before giving them to configure.
+ o add -o "objdir" so that builder can control it,
+ default is $OS as determined by os.sh
+ o add -q to suppress all the install instructions.
+
+2004-05-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Remove __IDSTRING()
+
+ * Makefile.in (BMAKE_VERSION): bump to 20040508
+ * Merge with NetBSD make, pick up:
+ o posix fixes
+ - remove '-e' from compat mode
+ - add support for '+' command-line prefix.
+ o fix for handling '--' on command-line.
+ o fix include in lst.lib/lstInt.h to simplify '-I's
+ o we also picked up replacement of MAKE_BOOTSTRAP
+ with !MAKE_NATIVE which is a noop, but possibly confusing.
+
+2004-04-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20040414
+ * Merge with NetBSD make, pick up:
+ o allow quoted strings on lhs of conditionals
+ o issue warning when extra .else is seen
+ o print line numer when errors encountered during parsing from
+ string.
+
+2004-02-20 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20040220
+ * Merge with NetBSD make, pick up:
+ o fix for old :M parsing bug.
+ o re-jigged unit-tests
+
+2004-02-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (accept test): use ${.MAKE:S,^./,${.CURDIR}/,}
+ so that './bmake -f Makefile test' works.
+
+2004-02-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in: (BMAKE_VERSION): bump to 20040214
+ * Merge with NetBSD make, pick up:
+ o search upwards for *.mk
+ o fix for double free of var substitution buffers
+ o use of getopt replaced with custom code, since the usage
+ (re-scanning) isn't posix compatible.
+
+2004-02-12 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * arch.c: don't include ranlib.h on ELF systems
+ (thanks to Chuck Cranor <chuck@ece.cmu.edu>).
+
+2004-01-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20040118
+
+ * boot-strap (while): export vars we assign to on cmdline
+ * unit-test/Makefile.in: ternary is .PHONY
+
+2004-01-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20040108
+ * Merge with NetBSD make, pick up:
+ o fix for ternary modifier
+
+2004-01-06 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20040105
+ * Merge with NetBSD make, pick up:
+ o fix for cond.c to handle compound expressions better
+ o variable expansion within sysV style replacements
+
+2003-12-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Make portable snprintf safer - output to /dev/null first to
+ check space needed.
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20031222
+ * Merge with NetBSD make, pick up:
+ o -dg3 to show input graph when things go wrong.
+ o explicitly look for makefiles in objdir if not found in curdir so
+ that errors in .depend etc will be reported accurarely.
+ o avoid use of -e in shell scripts in jobs mode, use '|| exit $?'
+ instead as it more accurately reflects the expected behavior and
+ is more consistently implemented.
+ o avoid use of asprintf.
+
+2003-09-28 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * util.c: Add asprintf and vasprintf.
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20030928
+ * Merge with NetBSD make, pick up:
+ :[] modifier - allows picking words from a variable.
+ :tW modifier - allows treating value as one big word.
+ W flag for :C and :S - allows treating value as one big word.
+
+2003-09-12 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make
+ pick up -de flag to enable printing failed command.
+ don't skip 1st two dir entries (normally . and ..) since
+ coda does not have them.
+
+2003-09-09 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20030909
+ * Merge with NetBSD make, pick up:
+ - changes for -V '${VAR}' to print fully expanded value
+ cf. -V VAR
+ - CompatRunCommand now prints the command that failed.
+ - several files got updated 3 clause Berkeley license.
+
+2003-08-02 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap: Allow setting configure args on command line.
+
+2003-07-31 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * configure.in: add --with-defshell to allow sh or ksh
+ to be selected as default shell.
+
+ * Makefile.in: bump version to 20030731
+
+ * Merge with NetBSD make
+ Pick up .SHELL spec for ksh and associate man page changes.
+ Also compat mode now uses the same shell specs.
+
+2003-07-29 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * var.c (Var_Parse): ensure delim is initialized.
+
+ * unit-tests/Makefile.in: use single quotes to avoid problems from
+ some shells.
+
+ * makefile.boot.in:
+ Run the unit-tests as part of the bootstrap procedure.
+
+2003-07-28 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * unit-tests/Makefile.in: always force complaints from
+ ${TEST_MAKE} to be from 'make'.
+
+ * configure.in: add check for 'diff -u'
+ also fix some old autoconf'isms
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20030728.
+ if using GCC add -Wno-cast-qual to CFLAGS for var.o
+
+ * Merge with NetBSD make
+ Pick up fix for :ts parsing error in some cases.
+ Pick unit-tests.
+
+2003-07-23 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20030723.
+
+ * var.c (Var_Parse): fix bug in :ts modifier, after const
+ correctness fixes, must pass nstr to VarModify.
+
+2003-07-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in: BMAKE_VERSION switch to a date based version.
+ We'll generally use the date of last import from NetBSD.
+
+ * Merge with NetBSD make
+ Pick up fixes for const-correctness, now passes WARNS=3 on
+ NetBSD.
+ Pick up :ts modifier, allows controlling the separator used
+ between words in variable expansion.
+
+2003-07-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * FILES: include boot-strap and os.sh
+
+ * Makefile.in: only set WARNS if we are NetBSD, the effect on
+ FreeBSD is known to be bad.
+
+ * makefile.boot.in (bootstrap): make this the default target.
+
+ * Makefile.in: bump version to 3.1.19
+
+ * machine.sh: avoid A-Z with tr as it is bound to lose.
+
+2003-07-10 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make
+ Pick up fix for PR/19781 - unhelpful error msg on unclosed ${var:foo
+ Plus some doc fixes.
+
+2003-04-27 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make
+ Pick up fix for PR/1523 - don't count a library as built, if there
+ is no way to build it
+
+ * Bump version to 3.1.18
+
+2003-03-23 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make
+ Pick up fix for ParseDoSpecialSrc - we only use it if .WAIT
+ appears in src list.
+
+2003-03-21 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make (mmm 10th anniversary!)
+ pick up fix for .WAIT in srcs that refer to $@ or $* (PR#20828)
+ pick up -X which tells us to not export VAR=val via setenv if
+ we are already doing so via MAKEFLAGS. This saves valuable env
+ space on systems like Darwin.
+ set MAKE_VERSION to 3.1.17
+
+ * parse.c: pix up fix for suffix rules
+
+2003-03-06 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make.
+ pick up fix for propagating -B via MAKEFLAGS.
+ set MAKE_VERSION to 3.1.16
+
+ * Apply some patches from pkgsrc-bootstrap/bmake
+ Originally by Grant Beattie <grant@netbsd.org>
+ I may have missed some - since they are based on bmake-3.1.12
+
+2002-12-03 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * makefile.boot.in (bmake): update install targets for those that
+ use them, also clear MAKEFLAGS when invoking bmake.boot to avoid
+ havoc from gmake -w. Thanks to Harlan Stenn <hstenn@cisco.com>.
+
+ * bmake.cat1: update the pre-formatted man page!
+
+2002-11-30 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make.
+ pick up fix for premature free of pointer used in call
+ to Dir_InitCur().
+ set MAKE_VERSION to 3.1.15
+
+2002-11-26 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * configure.in: determine suitable value for MKSRC.
+ override using --with-mksrc=PATH.
+
+ * machine.sh: use `uname -p` for MACHINE_ARCH on modern SunOS systems.
+ configs(8) will use 'sun4' as an alias for 'sparc'.
+
+2002-11-25 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Merge with NetBSD make.
+ pick up ${.PATH}
+ pick up fix for finding ../cat.c via .PATH when .CURDIR=..
+ set MAKE_VERSION to 3.1.14
+ add configure checks for killpg and sys/socket.h
+
+2002-09-16 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * tag bmake-3-1-13
+
+ * makefile.boot.in (bmake): use install-mk
+ Also setup ./mk before trying to invoke bmake.boot incase we
+ needed install-mk to create a sys.mk for us.
+
+ * configure.in: If we need to add -I${srcdir}/missing, make it an
+ absolute path so that it works for lst.lib too.
+
+ * make.h: always include sys/cdefs.h since we provide one if the
+ host does not.
+
+ * Makefile.in (install-mk):
+ use MKSRC/install-mk which will do the right thing.
+ use uname -p for ARCH if possible.
+ since install-mk will setup links bsd.prog.mk -> prog.mk if
+ needed, just .include bsd.prog.mk
+
+ * Merge with NetBSD make (NetBSD-1.6)
+ Code is ansi-C only now.
+ Bug in handling of dotLast is fixed.
+ Can now assign .OBJDIR and make will reset its notions of life.
+ New modifiers :tu :tl for toUpper and toLower.
+
+Tue Oct 16 12:18:42 2001 Simon J. Gerraty <sjg@zen.crufty.net>
+
+ * Merge with NetBSD make
+ pick up fix for .END failure in compat mode.
+ pick up fix for extra va_end() in ParseVErrorInternal.
+
+Thu Oct 11 13:20:06 2001 Simon J. Gerraty <sjg@zen.crufty.net>
+
+ * configure.in: for systems that have sys/cdefs.h check if it is
+ compatible. If not, include the one under missing, but tell it to
+ include the native one too - necessary on Linux.
+
+ * missing/sys/cdefs.h: if NEED_HOST_CDEFS_H is defined, use
+ include_next (for gcc) to get the native sys/cdefs.h
+
+Tue Aug 21 02:29:34 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * job.c (JobFinish): Fix an earlier merge bug that resulted in
+ leaking descriptors when using -jN.
+
+ * job.c (JobPrintCommand): See if "curdir" exists before
+ attempting to chdir(). Doing the chdir directly in make (when in
+ compat mode) fails silently, so let the -jN version do the same.
+ This can happen when building kernels in an object tree and
+ playing clever games to reset .CURDIR.
+
+ * Merged with NetBSD make
+ pick up .USEBEFORE
+
+Tue Jun 26 23:45:11 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * makefile.boot.in: Give bmake.boot a MAKESYSPATH that might work.
+
+Tue Jun 12 16:48:57 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * var.c (Var_Set): Add 4th (flags) arg so VarLoopExpand can tell
+ us not to export the iterator variable when using VAR_CMD context.
+
+Sun Jun 10 21:55:21 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * job.c (Job_CatchChildren): don't call Job_CatchOutput() here,
+ its the wrong "fix".
+
+Sat Jun 9 00:11:24 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Redesigned export of VAR_CMD's via MAKEFLAGS.
+ We now simply append the variable names to .MAKEOVERRIDES, and
+ handle duplicate suppression and quoting in ExportMAKEFLAGS using:
+ ${.MAKEOVERRIDES:O:u:@v@$v=${$v:Q}@}
+ Apart from fixing quoting bugs in previous version, this allows us
+ to export vars to the environment by simply doing:
+ .MAKEOVERRIDES+= PATH
+ Merged again with NetBSD make, but the above is the only change.
+
+ * configure.in: added
+ --disable-pwd-override disable $PWD overriding getcwd()
+ --disable-check-make-chdir disable make trying to guess
+ when it should automatically cd ${.CURDIR}
+
+ * Merge with NetBSD make, changes include:
+ parse.c (ParseDoDependency): Spot that the syntax error is
+ caused by an unresolved cvs/rcs conflict and say so.
+ var.c: most of Var* functions now take a ctxt as 1st arg.
+ now does variable substituion on rhs of sysv style modifiers.
+
+ * var.c (Var_Set): exporting of command line variables (VAR_CMD)
+ is now done here. We append the name='value' to .MAKEOVERRIDES
+ rather than directly into MAKEFLAGS as this allows a Makefile to
+ use .MAKEOVERRIDES= to disable this behaviour. GNU make uses a
+ very similar mechanism. Note that in adding name='value' to
+ .MAKEOVERRIDES we do the moral equivalent of:
+ .MAKEOVERRIDES:= ${.MAKEOVERRIDES:Nname=*} name='val'
+
+Fri Jun 1 14:08:02 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * make-conf.h (USE_IOVEC): make it conditional on HAVE_SYS_UIO_H
+
+ * Merged with NetBSD make
+ make -dx can now be used to run commands via sh -x
+ better error messages on exec failures.
+
+Thu May 31 01:44:54 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Makefile.in (main.o): depends on ${SRCS} ${MAKEFILE} so that
+ MAKE_VERSION gets updated. Also don't use ?= for MAKE_VERSION,
+ MACHINE etc otherwise they propagate from the previous bmake.
+
+ * configure.in (machine): allow --with-machine=generic to make
+ configure use machine.sh to set MACHINE.
+
+ * job.c (JobInterrupt): convert to using WAIT_T and friends.
+
+ * Makefile.in: mention in bmake.1 that we use autoconf.
+
+ * make.1: mention MAKE_PRINT_VAR_ON_ERROR.
+
+Wed May 30 23:17:18 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * main.c (ReadMakefile): don't set MAKEFILE if reading ".depend"
+ as that rather defeats the usefulness of ${MAKEFILE}.
+
+ * main.c (MainParseArgs): append command line variable assignments
+ to MAKEFLAGS so that they get propagated to child make's.
+ Apparently this is required POSIX behaviour? Its useful anyway.
+
+Tue May 29 02:20:07 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * compat.c (CompatRunCommand): don't use perror() since stdio may
+ cause problems in child of vfork().
+
+ * compat.c, main.c: Call PrintOnError() when we are going to bail.
+ This routine prints out the .curdir where we stopped and will also
+ display any vars listed in ${MAKE_PRINT_VAR_ON_ERROR}.
+
+ * main.c: add ${.newline} to hold a "\n" - sometimes handy in
+ :@ expansion.
+
+ * var.c: VarLoopExpand: ignore addSpace if a \n is present.
+
+ * Added RCSid's for the files we've touched.
+
+Thu May 24 15:41:37 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * configure.in: Thanks to some clues from mdb@juniper.net,
+ added autoconf magic to control setting of MACHINE, MACHINE_ARCH
+ as well as what ends up in _PATH_DEFSYSPATH. We now have:
+
+ --with-machine=MACHINE explicitly set MACHINE
+ --with-force-machine=MACHINE set FORCE_MACHINE
+ --with-machine_arch=MACHINE_ARCH explicitly set MACHINE_ARCH
+ --with-default-sys-path=PATH:DIR:LIST use an explicit _PATH_DEFSYSPATH
+ --with-prefix-sys-path=PATH:DIR:LIST prefix _PATH_PREFIX_SYSPATH
+ --with-path-objdirprefix=PATH override _PATH_OBJDIRPREFIX
+
+ If _PATH_OBJDIRPREFIX is set to "no" we won't define it.
+
+ * makefile: added a pathetically simple makefile to drive
+ bootstrapping. Running configure by hand is more useful.
+
+ * Makefile.in: added MAKE_VERSION, and reworked things to be less
+ dependent on NetBSD bsd.*.mk
+
+ * pathnames.h: allow NO_PATH_OBJDIRPREFIX to stop us defining
+ _PATH_OBJDIRPREFIX for those that don't want a default.
+ construct _PATH_DEFSYSPATH from the info we get from configure.
+
+ * main.c: allow for no _PATH_OBJDIRPREFIX, set ${MAKE_VERSION}
+ if MAKE_VERSION is defined.
+
+ * compat.c: when we bail, print out the .CURDIR we were in.
+
+Sat May 12 00:34:12 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+ * var.c: fixed a bug in the handling of the modifier :P
+ if the node as found but the path was null, we segfault trying to
+ duplicate it.
+
+Mon Mar 5 16:20:33 2001 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+ * make.c: Make_OODate's test for a library out of date was using
+ cmtime where it should have used mtime (my bug).
+
+ * compat.c: Use perror() to tell us what really went wrong when we
+ cannot exec a command.
+
+Fri Dec 15 10:11:08 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+Sat Jun 10 10:11:08 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+Thu Jun 1 10:11:08 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+Tue May 30 10:11:08 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Merged with NetBSD make
+
+Thu Apr 27 00:07:47 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * util.c: don't provide signal() since we use sigcompat.c
+
+ * Makefile.in: added a build target.
+
+ * var.c (Var_Parse): added ODE modifiers :U, :D, :L, :P, :@ and :!
+ These allow some quite clever magic.
+
+ * main.c (main): added support for getenv(MAKESYSPATH).
+
+Mon Apr 2 16:25:13 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Disable $PWD overriding getcwd() if MAKEOBJDIRPREFIX is set.
+ This avoids objdir having a different value depending on how a
+ directory was reached (via command line, or subdir.mk).
+
+ * If FORCE_MACHINE is defined, ignore getenv("MACHINE").
+
+Mon Apr 2 23:15:31 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Do a chdir(${.CURDIR}) before invoking ${.MAKE} or ${.MAKE:T} if
+ MAKEOBJDIRPREFIX is set and NOCHECKMAKECHDIR is not.
+ I've been testing this in NetBSD's make for some weeks.
+
+ * Turn Makefile into Makefile.in and make it useful.
+
+Tue Feb 29 22:08:00 2000 Simon J. Gerraty <sjg@zen.quick.com.au>
+
+ * Imported NetBSD's -current make(1) and resolve conflicts.
+
+ * Applied autoconf patches from bmake v2
+
+ * Imported clean code base from NetBSD-1.0
--- /dev/null
+FILES
+ChangeLog
+bmake.cat1
+boot-strap
+bsd.after-import.mk
+os.sh
+Makefile.in
+PSD.doc/Makefile
+PSD.doc/tutorial.ms
+README
+arch.c
+buf.c
+buf.h
+compat.c
+cond.c
+make-conf.h
+make_malloc.c
+make_malloc.h
+config.h.in
+configure
+aclocal.m4
+configure.in
+dir.c
+dir.h
+find_lib.sh
+for.c
+getopt.c
+hash.c
+hash.h
+install-sh
+job.c
+job.h
+meta.c
+meta.h
+dirname.c
+realpath.c
+strlcpy.c
+strlist.c
+strlist.h
+stresep.c
+trace.c
+trace.h
+lst.h
+lst.lib/Makefile
+lst.lib/lstAppend.c
+lst.lib/lstAtEnd.c
+lst.lib/lstAtFront.c
+lst.lib/lstClose.c
+lst.lib/lstConcat.c
+lst.lib/lstDatum.c
+lst.lib/lstDeQueue.c
+lst.lib/lstDestroy.c
+lst.lib/lstDupl.c
+lst.lib/lstEnQueue.c
+lst.lib/lstFind.c
+lst.lib/lstFindFrom.c
+lst.lib/lstFirst.c
+lst.lib/lstForEach.c
+lst.lib/lstForEachFrom.c
+lst.lib/lstInit.c
+lst.lib/lstInsert.c
+lst.lib/lstInt.h
+lst.lib/lstIsAtEnd.c
+lst.lib/lstIsEmpty.c
+lst.lib/lstLast.c
+lst.lib/lstMember.c
+lst.lib/lstNext.c
+lst.lib/lstOpen.c
+lst.lib/lstPrev.c
+lst.lib/lstRemove.c
+lst.lib/lstReplace.c
+lst.lib/lstSucc.c
+machine.sh
+main.c
+make.1
+bmake.1
+make.c
+make.h
+make-bootstrap.sh.in
+missing/sys/cdefs.h
+mkdeps.sh
+nonints.h
+parse.c
+pathnames.h
+ranlib.h
+setenv.c
+sigcompat.c
+sprite.h
+str.c
+suff.c
+targ.c
+util.c
+var.c
+wait.h
+unit-tests/Makefile.in
+unit-tests/comment
+unit-tests/cond1
+unit-tests/doterror
+unit-tests/dotwait
+unit-tests/error
+unit-tests/export
+unit-tests/export-all
+unit-tests/forloop
+unit-tests/forsubst
+unit-tests/hash
+unit-tests/misc
+unit-tests/moderrs
+unit-tests/modmatch
+unit-tests/modmisc
+unit-tests/modorder
+unit-tests/modts
+unit-tests/modword
+unit-tests/phony-end
+unit-tests/posix
+unit-tests/qequals
+unit-tests/sysv
+unit-tests/ternary
+unit-tests/test.exp
+unit-tests/unexport
+unit-tests/unexport-env
+unit-tests/varcmd
--- /dev/null
+# $NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
+# @(#)Makefile 5.2 (Berkeley) 12/28/90
+
+# $Id: Makefile.in,v 1.174 2012/10/10 18:46:24 sjg Exp $
+
+PROG= bmake
+SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
+ make.c parse.c str.c suff.c targ.c trace.c var.c util.c
+SRCS+= strlist.c
+SRCS+= make_malloc.c
+SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
+ lstDatum.c lstDeQueue.c lstDestroy.c lstDupl.c lstEnQueue.c \
+ lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
+ lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
+ lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
+SRCS += lstPrev.c
+
+# you can use this Makefile if you have an earlier version of bmake.
+prefix= @prefix@
+srcdir= @srcdir@
+CC?= @CC@
+
+# Base version on src date
+MAKE_VERSION= 20121010
+MACHINE=@machine@
+MACHINE_ARCH=@machine_arch@
+DEFAULT_SYS_PATH = @default_sys_path@
+
+CPPFLAGS+= @CPPFLAGS@
+CFLAGS+= ${CPPFLAGS}
+CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS+= -I. -I${srcdir} @DEFS@ ${XDEFS} -DMAKE_NATIVE
+CFLAGS+= ${CFLAGS_${.TARGET:T}}
+CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}}
+COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
+LDFLAGS= @LDFLAGS@
+LIBOBJS= @LIBOBJS@
+LDADD= @LIBS@
+
+.if !empty(LIBOBJS)
+SRCS+= ${LIBOBJS:T:.o=.c}
+.endif
+
+USE_META = @use_meta@
+.if ${USE_META} != "no"
+SRCS+= meta.c
+CPPFLAGS+= -DUSE_META
+FILEMON_H ?= @filemon_h@
+.if exists(${FILEMON_H}) && ${FILEMON_H:T} == "filemon.h"
+COPTS.meta.c += -DHAVE_FILEMON_H -I${FILEMON_H:H}
+.endif
+.endif
+
+.PATH: ${srcdir}
+.PATH: ${srcdir}/lst.lib
+
+OS!= uname -s
+ARCH!= uname -p 2>/dev/null || uname -m
+
+# list of OS's which are derrived from BSD4.4
+isBSD44= NetBSD FreeBSD OpenBSD DragonFly
+
+.if ${OS} == "NetBSD"
+# Don't set these for anyone else since we don't know what the effect may be.
+# On FreeBSD WARNS=2 sets a bunch of -W flags that make does not handle.
+WFORMAT= 1
+WARNS=4
+.NOPATH: bmake.cat1
+.if make(install) && exists(${DESTDIR}/usr/share/doc)
+SUBDIR= PSD.doc
+.endif
+.endif
+
+.if defined(.PARSEDIR)
+# we cannot rely on anything but bmake to parse this correctly.
+.if empty(isBSD44:M${OS})
+MANTARGET=cat
+INSTALL?=${srcdir}/install-sh
+.if (${MACHINE} == "sun386")
+# even I don't have one of these anymore :-)
+CFLAGS+= -DPORTAR
+.elif (${MACHINE} != "sunos")
+SRCS+= sigcompat.c
+CFLAGS+= -DSIGNAL_FLAGS=SA_RESTART
+.endif
+.endif
+
+.if make(obj) || make(clean)
+SUBDIR+= unit-tests
+.endif
+.endif
+
+# many systems use gcc these days
+CC_IS_GCC=@GCC@
+.if ${CC_IS_GCC} == "yes"
+# problem with gcc3
+CFLAGS_var.o+= -Wno-cast-qual
+.endif
+
+CFLAGS_main.o+= "-D@force_machine@MACHINE=\"${MACHINE}\"" "-DMACHINE_ARCH=\"${MACHINE_ARCH}\""
+
+EXTRACT_MAN=no
+
+MAN=${PROG}.1
+.if (${PROG} != "make")
+my.history: ${MAKEFILE}
+ @(echo ".Nm"; \
+ echo "is derived from NetBSD"; \
+ echo ".Xr make 1 ."; \
+ echo "It uses autoconf to facilitate portability to other platforms."; \
+ echo ".Pp") > $@
+
+${MAN}: make.1 my.history
+ @echo making ${PROG}.1
+ @sed -e 's/^.Nx/NetBSD/' -e '/^.Nm/s/make/${PROG}/' \
+ -e '/^.Sh HISTORY/rmy.history' \
+ -e '/^.Sh HISTORY/,$$s,^.Nm,make,' ${.CURDIR}/make.1 > $@
+
+.endif
+
+.if !empty(isBSD44:M${OS})
+.if "${OS}" != "NetBSD"
+MAN1=${MAN}
+.endif
+MANTARGET?=man
+.endif
+
+MANTARGET?= cat
+MANDEST?= ${MANDIR}/${MANTARGET}1
+
+.if ${MANTARGET} == "cat"
+_mfromdir=${srcdir}
+.endif
+
+.if exists(${srcdir}/../Makefile.inc)
+.include "${srcdir}/../Makefile.inc"
+.endif
+.-include <bsd.prog.mk>
+# sigh, FreeBSD at least includes bsd.subdir.mk via bsd.obj.mk
+# so the inclusion below, results in complaints about re-defined
+# targets. For NetBSD though we need to explicitly include it.
+.if defined(.PARSEDIR)
+.if defined(SUBDIR) && !target(${SUBDIR:[1]})
+.-include <bsd.subdir.mk>
+.endif
+.endif
+
+CPPFLAGS+= -DMAKE_NATIVE
+COPTS.var.c += -Wno-cast-qual
+COPTS.job.c += -Wno-format-nonliteral
+COPTS.parse.c += -Wno-format-nonliteral
+COPTS.var.c += -Wno-format-nonliteral
+
+# Force these
+BINDIR= ${prefix}/bin
+MANDIR= ${prefix}/man
+
+arch.o: config.h
+# make sure that MAKE_VERSION gets updated.
+main.o: ${SRCS} ${MAKEFILE}
+
+MK?=${prefix}/share/mk
+MKSRC?=@mksrc@
+INSTALL?=${srcdir}/install-sh
+
+beforeinstall:
+ test -d ${DESTDIR}${BINDIR} || ${INSTALL} -m 775 -d ${DESTDIR}${BINDIR}
+ test -d ${DESTDIR}${MANDEST} || ${INSTALL} -m 775 -d ${DESTDIR}${MANDEST}
+
+# latest version of *.mk includes an installer.
+# you should not need to set USE_OS
+install-mk:
+.if exists(${MKSRC}/install-mk)
+ test -d ${DESTDIR}${MK} || ${INSTALL} -m 775 -d ${DESTDIR}${MK}
+ ${MKSRC}/install-mk -v -m 644 ${DESTDIR}${MK} ${USE_OS}
+.else
+ @echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
+.endif
+
+.ifdef TOOLDIR
+# this is a native netbsd build,
+# use libutil rather than the local emalloc etc.
+CPPFLAGS+= -DUSE_EMALLOC
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
+.endif
+
+# A simple unit-test driver to help catch regressions
+accept test:
+ cd ${.CURDIR}/unit-tests && MAKEFLAGS= ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
--- /dev/null
+ bmake
+
+This directory contains a port of the BSD make tool (from NetBSD)
+I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux.
+
+Version 3 was re-worked from scratch to better facilitate
+importing newer make(1) versions from NetBSD. The original code base
+was NetBSD-1.0, so version 3 was built by doing a fresh import of the
+NetBSD-1.0 usr.bin/make, adding the autoconf and other portability
+patches to sync it with bmake v2, and then NetBSD's make
+of Feb 20, 2000 was imported and conflicts dealt with.
+NetBSD's make was again imported on June 6 and December 15, 2000.
+
+In 2003 bmake switched to a date based version (first was 20030714)
+which generally represents the date it was last merged with NetBSD's
+make. Since then, NetBSD's make is imported within a week of any
+interesting changes, so that bmake tracks it very closely.
+
+Building:
+
+The prefered way to bootstrap bmake is:
+
+./bmake/boot-strap
+
+there are a number of args - most of which get passed to configure,
+eg.
+
+./bmake/boot-strap --prefix=/opt
+
+see the boot-strap script for details.
+
+To make much use of bmake you will need the bsd.*.mk macros or my
+portable *.mk macros. See
+http://www.crufty.net/ftp/pub/sjg/mk.tar.gz
+which will be links to the latest versions.
+
+On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in
+the same directory as bmake (so ./mk and ./bmake exist), and
+./bmake/boot-strap will do the rest.
+
+If you want to do it all by hand then read boot-strap first to get the
+idea.
+
+Even if you have an earlier version of bmake installed, use boot-strap
+to ensure that all goes well.
+
+--sjg
--- /dev/null
+dnl RCSid:
+dnl $Id: aclocal.m4,v 1.5 2003/03/06 21:21:30 sjg Exp $
+dnl
+
+dnl
+dnl AC_CHECK_HEADER_HAS(HEADER, PATTERN, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]))
+
+AC_DEFUN(AC_CHECK_HEADER_HAS,
+[dnl first check if header exists and if so, see if it contains PATTERN
+ac_has_hdr=`echo "ac_cv_header_$1" | sed 'y%./+-%__p_%'`
+ac_has_it=`echo "ac_cv_header_$1"_$2 | sed 'y%./+-%__p_%'`
+if eval "test \"`echo x'$'$ac_has_hdr`\" = x"; then
+ AC_CHECK_HEADER($1)
+fi
+if eval "test \"`echo '$'$ac_has_hdr`\" = yes"; then
+ ac_x=HAVE_`echo "$1" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_DEFINE_UNQUOTED($ac_x)
+ AC_MSG_CHECKING([if $1 has $2])
+ AC_CACHE_VAL($ac_has_it,
+ [eval $ac_has_it=no
+ AC_EGREP_HEADER($2, $1, eval "$ac_has_it=yes")])
+
+ if eval "test \"`echo '$'$ac_has_it`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ac_x=HAVE_`echo "$1"_$2 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_DEFINE_UNQUOTED($ac_x)
+ ifelse([$3], , :, [$3])
+ else
+ AC_MSG_RESULT(no)
+ ifelse([$4], , , [$4
+])dnl
+ fi
+fi
+])
+
+dnl AC_EGREP(PATTERN, FILE, ACTION-IF-FOUND [,
+dnl ACTION-IF-NOT-FOUND])
+AC_DEFUN(AC_EGREP,
+[
+dnl Prevent m4 from eating character classes:
+changequote(, )dnl
+if egrep "$1" $2 >/dev/null 2>&1; then
+changequote([, ])dnl
+ ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+ $4
+])dnl
+fi
+])
+
+dnl
+dnl Test for __attribute__
+dnl
+
+AC_DEFUN(AC_C___ATTRIBUTE__, [
+AC_MSG_CHECKING(for __attribute__)
+AC_CACHE_VAL(ac_cv___attribute__, [
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+ exit(1);
+}
+],
+ac_cv___attribute__=yes,
+ac_cv___attribute__=no)])
+if test "$ac_cv___attribute__" = "yes"; then
+ AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+fi
+AC_MSG_RESULT($ac_cv___attribute__)
+])
+
--- /dev/null
+/* $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $ */
+
+/*
+ * Copyright (c) 1988, 1989, 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Adam de Boor.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1989 by Berkeley Softworks
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Adam de Boor.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef MAKE_NATIVE
+static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $";
+#else
+#include <sys/cdefs.h>
+#ifndef lint
+#if 0
+static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
+#else
+__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $");
+#endif
+#endif /* not lint */
+#endif
+
+/*-
+ * arch.c --
+ * Functions to manipulate libraries, archives and their members.
+ *
+ * Once again, cacheing/hashing comes into play in the manipulation
+ * of archives. The first time an archive is referenced, all of its members'
+ * headers are read and hashed and the archive closed again. All hashed
+ * archives are kept on a list which is searched each time an archive member
+ * is referenced.
+ *
+ * The interface to this module is:
+ * Arch_ParseArchive Given an archive specification, return a list
+ * of GNode's, one for each member in the spec.
+ * FAILURE is returned if the specification is
+ * invalid for some reason.
+ *
+ * Arch_Touch Alter the modification time of the archive
+ * member described by the given node to be
+ * the current time.
+ *
+ * Arch_TouchLib Update the modification time of the library
+ * described by the given node. This is special
+ * because it also updates the modification time
+ * of the library's table of contents.
+ *
+ * Arch_MTime Find the modification time of a member of
+ * an archive *in the archive*. The time is also
+ * placed in the member's GNode. Returns the
+ * modification time.
+ *
+ * Arch_MemTime Find the modification time of a member of
+ * an archive. Called when the member doesn't
+ * already exist. Looks in the archive for the
+ * modification time. Returns the modification
+ * time.
+ *
+ * Arch_FindLib Search for a library along a path. The
+ * library name in the GNode should be in
+ * -l<name> format.
+ *
+ * Arch_LibOODate Special function to decide if a library node
+ * is out-of-date.
+ *
+ * Arch_Init Initialize this module.
+ *
+ * Arch_End Cleanup this module.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/param.h>
+#include <ctype.h>
+#ifdef HAVE_AR_H
+#include <ar.h>
+#else
+struct ar_hdr {
+ char ar_name[16]; /* name */
+ char ar_date[12]; /* modification time */
+ char ar_uid[6]; /* user id */
+ char ar_gid[6]; /* group id */
+ char ar_mode[8]; /* octal file permissions */
+ char ar_size[10]; /* size in bytes */
+#ifndef ARFMAG
+#define ARFMAG "`\n"
+#endif
+ char ar_fmag[2]; /* consistency check */
+};
+#endif
+#if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB))
+#include <ranlib.h>
+#endif
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif
+
+#include "make.h"
+#include "hash.h"
+#include "dir.h"
+
+#ifdef TARGET_MACHINE
+#undef MAKE_MACHINE
+#define MAKE_MACHINE TARGET_MACHINE
+#endif
+#ifdef TARGET_MACHINE_ARCH
+#undef MAKE_MACHINE_ARCH
+#define MAKE_MACHINE_ARCH TARGET_MACHINE_ARCH
+#endif
+
+static Lst archives; /* Lst of archives we've already examined */
+
+typedef struct Arch {
+ char *name; /* Name of archive */
+ Hash_Table members; /* All the members of the archive described
+ * by <name, struct ar_hdr *> key/value pairs */
+ char *fnametab; /* Extended name table strings */
+ size_t fnamesize; /* Size of the string table */
+} Arch;
+
+static int ArchFindArchive(const void *, const void *);
+#ifdef CLEANUP
+static void ArchFree(void *);
+#endif
+static struct ar_hdr *ArchStatMember(char *, char *, Boolean);
+static FILE *ArchFindMember(char *, char *, struct ar_hdr *, const char *);
+#if defined(__svr4__) || defined(__SVR4) || defined(__ELF__)
+#define SVR4ARCHIVES
+static int ArchSVR4Entry(Arch *, char *, size_t, FILE *);
+#endif
+
+
+#if defined(_AIX)
+# define AR_NAME _ar_name.ar_name
+# define AR_FMAG _ar_name.ar_fmag
+# define SARMAG SAIAMAG
+# define ARMAG AIAMAG
+# define ARFMAG AIAFMAG
+#endif
+#ifndef AR_NAME
+# define AR_NAME ar_name
+#endif
+#ifndef AR_DATE
+# define AR_DATE ar_date
+#endif
+#ifndef AR_SIZE
+# define AR_SIZE ar_size
+#endif
+#ifndef AR_FMAG
+# define AR_FMAG ar_fmag
+#endif
+#ifndef ARMAG
+# define ARMAG "!<arch>\n"
+#endif
+#ifndef SARMAG
+# define SARMAG 8
+#endif
+
+#define AR_MAX_NAME_LEN (sizeof(arh.AR_NAME)-1)
+
+#ifdef CLEANUP
+/*-
+ *-----------------------------------------------------------------------
+ * ArchFree --
+ * Free memory used by an archive
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------
+ */
+static void
+ArchFree(void *ap)
+{
+ Arch *a = (Arch *)ap;
+ Hash_Search search;
+ Hash_Entry *entry;
+
+ /* Free memory from hash entries */
+ for (entry = Hash_EnumFirst(&a->members, &search);
+ entry != NULL;
+ entry = Hash_EnumNext(&search))
+ free(Hash_GetValue(entry));
+
+ free(a->name);
+ if (a->fnametab)
+ free(a->fnametab);
+ Hash_DeleteTable(&a->members);
+ free(a);
+}
+#endif
+
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_ParseArchive --
+ * Parse the archive specification in the given line and find/create
+ * the nodes for the specified archive members, placing their nodes
+ * on the given list.
+ *
+ * Input:
+ * linePtr Pointer to start of specification
+ * nodeLst Lst on which to place the nodes
+ * ctxt Context in which to expand variables
+ *
+ * Results:
+ * SUCCESS if it was a valid specification. The linePtr is updated
+ * to point to the first non-space after the archive spec. The
+ * nodes for the members are placed on the given list.
+ *
+ * Side Effects:
+ * Some nodes may be created. The given list is extended.
+ *
+ *-----------------------------------------------------------------------
+ */
+ReturnStatus
+Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
+{
+ char *cp; /* Pointer into line */
+ GNode *gn; /* New node */
+ char *libName; /* Library-part of specification */
+ char *memName; /* Member-part of specification */
+ char *nameBuf; /* temporary place for node name */
+ char saveChar; /* Ending delimiter of member-name */
+ Boolean subLibName; /* TRUE if libName should have/had
+ * variable substitution performed on it */
+
+ libName = *linePtr;
+
+ subLibName = FALSE;
+
+ for (cp = libName; *cp != '(' && *cp != '\0'; cp++) {
+ if (*cp == '$') {
+ /*
+ * Variable spec, so call the Var module to parse the puppy
+ * so we can safely advance beyond it...
+ */
+ int length;
+ void *freeIt;
+ char *result;
+
+ result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt);
+ if (freeIt)
+ free(freeIt);
+ if (result == var_Error) {
+ return(FAILURE);
+ } else {
+ subLibName = TRUE;
+ }
+
+ cp += length-1;
+ }
+ }
+
+ *cp++ = '\0';
+ if (subLibName) {
+ libName = Var_Subst(NULL, libName, ctxt, TRUE);
+ }
+
+
+ for (;;) {
+ /*
+ * First skip to the start of the member's name, mark that
+ * place and skip to the end of it (either white-space or
+ * a close paren).
+ */
+ Boolean doSubst = FALSE; /* TRUE if need to substitute in memName */
+
+ while (*cp != '\0' && *cp != ')' && isspace ((unsigned char)*cp)) {
+ cp++;
+ }
+ memName = cp;
+ while (*cp != '\0' && *cp != ')' && !isspace ((unsigned char)*cp)) {
+ if (*cp == '$') {
+ /*
+ * Variable spec, so call the Var module to parse the puppy
+ * so we can safely advance beyond it...
+ */
+ int length;
+ void *freeIt;
+ char *result;
+
+ result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt);
+ if (freeIt)
+ free(freeIt);
+ if (result == var_Error) {
+ return(FAILURE);
+ } else {
+ doSubst = TRUE;
+ }
+
+ cp += length;
+ } else {
+ cp++;
+ }
+ }
+
+ /*
+ * If the specification ends without a closing parenthesis,
+ * chances are there's something wrong (like a missing backslash),
+ * so it's better to return failure than allow such things to happen
+ */
+ if (*cp == '\0') {
+ printf("No closing parenthesis in archive specification\n");
+ return (FAILURE);
+ }
+
+ /*
+ * If we didn't move anywhere, we must be done
+ */
+ if (cp == memName) {
+ break;
+ }
+
+ saveChar = *cp;
+ *cp = '\0';
+
+ /*
+ * XXX: This should be taken care of intelligently by
+ * SuffExpandChildren, both for the archive and the member portions.
+ */
+ /*
+ * If member contains variables, try and substitute for them.
+ * This will slow down archive specs with dynamic sources, of course,
+ * since we'll be (non-)substituting them three times, but them's
+ * the breaks -- we need to do this since SuffExpandChildren calls
+ * us, otherwise we could assume the thing would be taken care of
+ * later.
+ */
+ if (doSubst) {
+ char *buf;
+ char *sacrifice;
+ char *oldMemName = memName;
+ size_t sz;
+
+ memName = Var_Subst(NULL, memName, ctxt, TRUE);
+
+ /*
+ * Now form an archive spec and recurse to deal with nested
+ * variables and multi-word variable values.... The results
+ * are just placed at the end of the nodeLst we're returning.
+ */
+ sz = strlen(memName)+strlen(libName)+3;
+ buf = sacrifice = bmake_malloc(sz);
+
+ snprintf(buf, sz, "%s(%s)", libName, memName);
+
+ if (strchr(memName, '$') && strcmp(memName, oldMemName) == 0) {
+ /*
+ * Must contain dynamic sources, so we can't deal with it now.
+ * Just create an ARCHV node for the thing and let
+ * SuffExpandChildren handle it...
+ */
+ gn = Targ_FindNode(buf, TARG_CREATE);
+
+ if (gn == NULL) {
+ free(buf);
+ return(FAILURE);
+ } else {
+ gn->type |= OP_ARCHV;
+ (void)Lst_AtEnd(nodeLst, gn);
+ }
+ } else if (Arch_ParseArchive(&sacrifice, nodeLst, ctxt)!=SUCCESS) {
+ /*
+ * Error in nested call -- free buffer and return FAILURE
+ * ourselves.
+ */
+ free(buf);
+ return(FAILURE);
+ }
+ /*
+ * Free buffer and continue with our work.
+ */
+ free(buf);
+ } else if (Dir_HasWildcards(memName)) {
+ Lst members = Lst_Init(FALSE);
+ char *member;
+ size_t sz = MAXPATHLEN, nsz;
+ nameBuf = bmake_malloc(sz);
+
+ Dir_Expand(memName, dirSearchPath, members);
+ while (!Lst_IsEmpty(members)) {
+ member = (char *)Lst_DeQueue(members);
+ nsz = strlen(libName) + strlen(member) + 3;
+ if (sz > nsz)
+ nameBuf = bmake_realloc(nameBuf, sz = nsz * 2);
+
+ snprintf(nameBuf, sz, "%s(%s)", libName, member);
+ free(member);
+ gn = Targ_FindNode(nameBuf, TARG_CREATE);
+ if (gn == NULL) {
+ free(nameBuf);
+ return (FAILURE);
+ } else {
+ /*
+ * We've found the node, but have to make sure the rest of
+ * the world knows it's an archive member, without having
+ * to constantly check for parentheses, so we type the
+ * thing with the OP_ARCHV bit before we place it on the
+ * end of the provided list.
+ */
+ gn->type |= OP_ARCHV;
+ (void)Lst_AtEnd(nodeLst, gn);
+ }
+ }
+ Lst_Destroy(members, NULL);
+ free(nameBuf);
+ } else {
+ size_t sz = strlen(libName) + strlen(memName) + 3;
+ nameBuf = bmake_malloc(sz);
+ snprintf(nameBuf, sz, "%s(%s)", libName, memName);
+ gn = Targ_FindNode(nameBuf, TARG_CREATE);
+ free(nameBuf);
+ if (gn == NULL) {
+ return (FAILURE);
+ } else {
+ /*
+ * We've found the node, but have to make sure the rest of the
+ * world knows it's an archive member, without having to
+ * constantly check for parentheses, so we type the thing with
+ * the OP_ARCHV bit before we place it on the end of the
+ * provided list.
+ */
+ gn->type |= OP_ARCHV;
+ (void)Lst_AtEnd(nodeLst, gn);
+ }
+ }
+ if (doSubst) {
+ free(memName);
+ }
+
+ *cp = saveChar;
+ }
+
+ /*
+ * If substituted libName, free it now, since we need it no longer.
+ */
+ if (subLibName) {
+ free(libName);
+ }
+
+ /*
+ * We promised the pointer would be set up at the next non-space, so
+ * we must advance cp there before setting *linePtr... (note that on
+ * entrance to the loop, cp is guaranteed to point at a ')')
+ */
+ do {
+ cp++;
+ } while (*cp != '\0' && isspace ((unsigned char)*cp));
+
+ *linePtr = cp;
+ return (SUCCESS);
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * ArchFindArchive --
+ * See if the given archive is the one we are looking for. Called
+ * From ArchStatMember and ArchFindMember via Lst_Find.
+ *
+ * Input:
+ * ar Current list element
+ * archName Name we want
+ *
+ * Results:
+ * 0 if it is, non-zero if it isn't.
+ *
+ * Side Effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------
+ */
+static int
+ArchFindArchive(const void *ar, const void *archName)
+{
+ return (strcmp(archName, ((const Arch *)ar)->name));
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * ArchStatMember --
+ * Locate a member of an archive, given the path of the archive and
+ * the path of the desired member.
+ *
+ * Input:
+ * archive Path to the archive
+ * member Name of member. If it is a path, only the last
+ * component is used.
+ * hash TRUE if archive should be hashed if not already so.
+ *
+ * Results:
+ * A pointer to the current struct ar_hdr structure for the member. Note
+ * That no position is returned, so this is not useful for touching
+ * archive members. This is mostly because we have no assurances that
+ * The archive will remain constant after we read all the headers, so
+ * there's not much point in remembering the position...
+ *
+ * Side Effects:
+ *
+ *-----------------------------------------------------------------------
+ */
+static struct ar_hdr *
+ArchStatMember(char *archive, char *member, Boolean hash)
+{
+ FILE * arch; /* Stream to archive */
+ int size; /* Size of archive member */
+ char *cp; /* Useful character pointer */
+ char magic[SARMAG];
+ LstNode ln; /* Lst member containing archive descriptor */
+ Arch *ar; /* Archive descriptor */
+ Hash_Entry *he; /* Entry containing member's description */
+ struct ar_hdr arh; /* archive-member header for reading archive */
+ char memName[MAXPATHLEN+1];
+ /* Current member name while hashing. */
+
+ /*
+ * Because of space constraints and similar things, files are archived
+ * using their final path components, not the entire thing, so we need
+ * to point 'member' to the final component, if there is one, to make
+ * the comparisons easier...
+ */
+ cp = strrchr(member, '/');
+ if (cp != NULL) {
+ member = cp + 1;
+ }
+
+ ln = Lst_Find(archives, archive, ArchFindArchive);
+ if (ln != NULL) {
+ ar = (Arch *)Lst_Datum(ln);
+
+ he = Hash_FindEntry(&ar->members, member);
+
+ if (he != NULL) {
+ return ((struct ar_hdr *)Hash_GetValue(he));
+ } else {
+ /* Try truncated name */
+ char copy[AR_MAX_NAME_LEN+1];
+ size_t len = strlen(member);
+
+ if (len > AR_MAX_NAME_LEN) {
+ len = AR_MAX_NAME_LEN;
+ strncpy(copy, member, AR_MAX_NAME_LEN);
+ copy[AR_MAX_NAME_LEN] = '\0';
+ }
+ if ((he = Hash_FindEntry(&ar->members, copy)) != NULL)
+ return ((struct ar_hdr *)Hash_GetValue(he));
+ return NULL;
+ }
+ }
+
+ if (!hash) {
+ /*
+ * Caller doesn't want the thing hashed, just use ArchFindMember
+ * to read the header for the member out and close down the stream
+ * again. Since the archive is not to be hashed, we assume there's
+ * no need to allocate extra room for the header we're returning,
+ * so just declare it static.
+ */
+ static struct ar_hdr sarh;
+
+ arch = ArchFindMember(archive, member, &sarh, "r");
+
+ if (arch == NULL) {
+ return NULL;
+ } else {
+ fclose(arch);
+ return (&sarh);
+ }
+ }
+
+ /*
+ * We don't have this archive on the list yet, so we want to find out
+ * everything that's in it and cache it so we can get at it quickly.
+ */
+ arch = fopen(archive, "r");
+ if (arch == NULL) {
+ return NULL;
+ }
+
+ /*
+ * We use the ARMAG string to make sure this is an archive we
+ * can handle...
+ */
+ if ((fread(magic, SARMAG, 1, arch) != 1) ||
+ (strncmp(magic, ARMAG, SARMAG) != 0)) {
+ fclose(arch);
+ return NULL;
+ }
+
+ ar = bmake_malloc(sizeof(Arch));
+ ar->name = bmake_strdup(archive);
+ ar->fnametab = NULL;
+ ar->fnamesize = 0;
+ Hash_InitTable(&ar->members, -1);
+ memName[AR_MAX_NAME_LEN] = '\0';
+
+ while (fread((char *)&arh, sizeof(struct ar_hdr), 1, arch) == 1) {
+ if (strncmp( arh.AR_FMAG, ARFMAG, sizeof(arh.AR_FMAG)) != 0) {
+ /*
+ * The header is bogus, so the archive is bad
+ * and there's no way we can recover...
+ */
+ goto badarch;
+ } else {
+ /*
+ * We need to advance the stream's pointer to the start of the
+ * next header. Files are padded with newlines to an even-byte
+ * boundary, so we need to extract the size of the file from the
+ * 'size' field of the header and round it up during the seek.
+ */
+ arh.AR_SIZE[sizeof(arh.AR_SIZE)-1] = '\0';
+ size = (int)strtol(arh.AR_SIZE, NULL, 10);
+
+ (void)strncpy(memName, arh.AR_NAME, sizeof(arh.AR_NAME));
+ for (cp = &memName[AR_MAX_NAME_LEN]; *cp == ' '; cp--) {
+ continue;
+ }
+ cp[1] = '\0';
+
+#ifdef SVR4ARCHIVES
+ /*
+ * svr4 names are slash terminated. Also svr4 extended AR format.
+ */
+ if (memName[0] == '/') {
+ /*
+ * svr4 magic mode; handle it
+ */
+ switch (ArchSVR4Entry(ar, memName, size, arch)) {
+ case -1: /* Invalid data */
+ goto badarch;
+ case 0: /* List of files entry */
+ continue;
+ default: /* Got the entry */
+ break;
+ }
+ }
+ else {
+ if (cp[0] == '/')
+ cp[0] = '\0';
+ }
+#endif
+
+#ifdef AR_EFMT1
+ /*
+ * BSD 4.4 extended AR format: #1/<namelen>, with name as the
+ * first <namelen> bytes of the file
+ */
+ if (strncmp(memName, AR_EFMT1, sizeof(AR_EFMT1) - 1) == 0 &&
+ isdigit((unsigned char)memName[sizeof(AR_EFMT1) - 1])) {
+
+ unsigned int elen = atoi(&memName[sizeof(AR_EFMT1)-1]);
+
+ if (elen > MAXPATHLEN)
+ goto badarch;
+ if (fread(memName, elen, 1, arch) != 1)
+ goto badarch;
+ memName[elen] = '\0';
+ fseek(arch, -elen, SEEK_CUR);
+ if (DEBUG(ARCH) || DEBUG(MAKE)) {
+ fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName);
+ }
+ }
+#endif
+
+ he = Hash_CreateEntry(&ar->members, memName, NULL);
+ Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr)));
+ memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr));
+ }
+ fseek(arch, (size + 1) & ~1, SEEK_CUR);
+ }
+
+ fclose(arch);
+
+ (void)Lst_AtEnd(archives, ar);
+
+ /*
+ * Now that the archive has been read and cached, we can look into
+ * the hash table to find the desired member's header.
+ */
+ he = Hash_FindEntry(&ar->members, member);
+
+ if (he != NULL) {
+ return ((struct ar_hdr *)Hash_GetValue(he));
+ } else {
+ return NULL;
+ }
+
+badarch:
+ fclose(arch);
+ Hash_DeleteTable(&ar->members);
+ if (ar->fnametab)
+ free(ar->fnametab);
+ free(ar);
+ return NULL;
+}
+
+#ifdef SVR4ARCHIVES
+/*-
+ *-----------------------------------------------------------------------
+ * ArchSVR4Entry --
+ * Parse an SVR4 style entry that begins with a slash.
+ * If it is "//", then load the table of filenames
+ * If it is "/<offset>", then try to substitute the long file name
+ * from offset of a table previously read.
+ *
+ * Results:
+ * -1: Bad data in archive
+ * 0: A table was loaded from the file
+ * 1: Name was successfully substituted from table
+ * 2: Name was not successfully substituted from table
+ *
+ * Side Effects:
+ * If a table is read, the file pointer is moved to the next archive
+ * member
+ *
+ *-----------------------------------------------------------------------
+ */
+static int
+ArchSVR4Entry(Arch *ar, char *name, size_t size, FILE *arch)
+{
+#define ARLONGNAMES1 "//"
+#define ARLONGNAMES2 "/ARFILENAMES"
+ size_t entry;
+ char *ptr, *eptr;
+
+ if (strncmp(name, ARLONGNAMES1, sizeof(ARLONGNAMES1) - 1) == 0 ||
+ strncmp(name, ARLONGNAMES2, sizeof(ARLONGNAMES2) - 1) == 0) {
+
+ if (ar->fnametab != NULL) {
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "Attempted to redefine an SVR4 name table\n");
+ }
+ return -1;
+ }
+
+ /*
+ * This is a table of archive names, so we build one for
+ * ourselves
+ */
+ ar->fnametab = bmake_malloc(size);
+ ar->fnamesize = size;
+
+ if (fread(ar->fnametab, size, 1, arch) != 1) {
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "Reading an SVR4 name table failed\n");
+ }
+ return -1;
+ }
+ eptr = ar->fnametab + size;
+ for (entry = 0, ptr = ar->fnametab; ptr < eptr; ptr++)
+ switch (*ptr) {
+ case '/':
+ entry++;
+ *ptr = '\0';
+ break;
+
+ case '\n':
+ break;
+
+ default:
+ break;
+ }
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "Found svr4 archive name table with %lu entries\n",
+ (u_long)entry);
+ }
+ return 0;
+ }
+
+ if (name[1] == ' ' || name[1] == '\0')
+ return 2;
+
+ entry = (size_t)strtol(&name[1], &eptr, 0);
+ if ((*eptr != ' ' && *eptr != '\0') || eptr == &name[1]) {
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "Could not parse SVR4 name %s\n", name);
+ }
+ return 2;
+ }
+ if (entry >= ar->fnamesize) {
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "SVR4 entry offset %s is greater than %lu\n",
+ name, (u_long)ar->fnamesize);
+ }
+ return 2;
+ }
+
+ if (DEBUG(ARCH)) {
+ fprintf(debug_file, "Replaced %s with %s\n", name, &ar->fnametab[entry]);
+ }
+
+ (void)strncpy(name, &ar->fnametab[entry], MAXPATHLEN);
+ name[MAXPATHLEN] = '\0';
+ return 1;
+}
+#endif
+
+
+/*-
+ *-----------------------------------------------------------------------
+ * ArchFindMember --
+ * Locate a member of an archive, given the path of the archive and
+ * the path of the desired member. If the archive is to be modified,
+ * the mode should be "r+", if not, it should be "r".
+ *
+ * Input:
+ * archive Path to the archive
+ * member Name of member. If it is a path, only the last
+ * component is used.
+ * arhPtr Pointer to header structure to be filled in
+ * mode The mode for opening the stream
+ *
+ * Results:
+ * An FILE *, opened for reading and writing, positioned at the
+ * start of the member's struct ar_hdr, or NULL if the member was
+ * nonexistent. The current struct ar_hdr for member.
+ *
+ * Side Effects:
+ * The passed struct ar_hdr structure is filled in.
+ *
+ *-----------------------------------------------------------------------
+ */
+static FILE *
+ArchFindMember(char *archive, char *member, struct ar_hdr *arhPtr,
+ const char *mode)
+{
+ FILE * arch; /* Stream to archive */
+ int size; /* Size of archive member */
+ char *cp; /* Useful character pointer */
+ char magic[SARMAG];
+ size_t len, tlen;
+
+ arch = fopen(archive, mode);
+ if (arch == NULL) {
+ return NULL;
+ }
+
+ /*
+ * We use the ARMAG string to make sure this is an archive we
+ * can handle...
+ */
+ if ((fread(magic, SARMAG, 1, arch) != 1) ||
+ (strncmp(magic, ARMAG, SARMAG) != 0)) {
+ fclose(arch);
+ return NULL;
+ }
+
+ /*
+ * Because of space constraints and similar things, files are archived
+ * using their final path components, not the entire thing, so we need
+ * to point 'member' to the final component, if there is one, to make
+ * the comparisons easier...
+ */
+ cp = strrchr(member, '/');
+ if (cp != NULL) {
+ member = cp + 1;
+ }
+ len = tlen = strlen(member);
+ if (len > sizeof(arhPtr->AR_NAME)) {
+ tlen = sizeof(arhPtr->AR_NAME);
+ }
+
+ while (fread((char *)arhPtr, sizeof(struct ar_hdr), 1, arch) == 1) {
+ if (strncmp(arhPtr->AR_FMAG, ARFMAG, sizeof(arhPtr->AR_FMAG) ) != 0) {
+ /*
+ * The header is bogus, so the archive is bad
+ * and there's no way we can recover...
+ */
+ fclose(arch);
+ return NULL;
+ } else if (strncmp(member, arhPtr->AR_NAME, tlen) == 0) {
+ /*
+ * If the member's name doesn't take up the entire 'name' field,
+ * we have to be careful of matching prefixes. Names are space-
+ * padded to the right, so if the character in 'name' at the end
+ * of the matched string is anything but a space, this isn't the
+ * member we sought.
+ */
+ if (tlen != sizeof(arhPtr->AR_NAME) && arhPtr->AR_NAME[tlen] != ' '){
+ goto skip;
+ } else {
+ /*
+ * To make life easier, we reposition the file at the start
+ * of the header we just read before we return the stream.
+ * In a more general situation, it might be better to leave
+ * the file at the actual member, rather than its header, but
+ * not here...
+ */
+ fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR);
+ return (arch);
+ }
+ } else
+#ifdef AR_EFMT1
+ /*
+ * BSD 4.4 extended AR format: #1/<namelen>, with name as the
+ * first <namelen> bytes of the file
+ */
+ if (strncmp(arhPtr->AR_NAME, AR_EFMT1,
+ sizeof(AR_EFMT1) - 1) == 0 &&
+ isdigit((unsigned char)arhPtr->AR_NAME[sizeof(AR_EFMT1) - 1])) {
+
+ unsigned int elen = atoi(&arhPtr->AR_NAME[sizeof(AR_EFMT1)-1]);
+ char ename[MAXPATHLEN + 1];
+
+ if (elen > MAXPATHLEN) {
+ fclose(arch);
+ return NULL;
+ }
+ if (fread(ename, elen, 1, arch) != 1) {
+ fclose(arch);
+ return NULL;
+ }
+ ename[elen] = '\0';
+ if (DEBUG(ARCH) || DEBUG(MAKE)) {
+ fprintf(debug_file, "ArchFind: Extended format entry for %s\n", ename);
+ }
+ if (strncmp(ename, member, len) == 0) {
+ /* Found as extended name */
+ fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR);
+ return (arch);
+ }
+ fseek(arch, -elen, SEEK_CUR);
+ goto skip;
+ } else
+#endif
+ {
+skip:
+ /*
+ * This isn't the member we're after, so we need to advance the
+ * stream's pointer to the start of the next header. Files are
+ * padded with newlines to an even-byte boundary, so we need to
+ * extract the size of the file from the 'size' field of the
+ * header and round it up during the seek.
+ */
+ arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0';
+ size = (int)strtol(arhPtr->AR_SIZE, NULL, 10);
+ fseek(arch, (size + 1) & ~1, SEEK_CUR);
+ }
+ }
+
+ /*
+ * We've looked everywhere, but the member is not to be found. Close the
+ * archive and return NULL -- an error.
+ */
+ fclose(arch);
+ return NULL;
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_Touch --
+ * Touch a member of an archive.
+ *
+ * Input:
+ * gn Node of member to touch
+ *
+ * Results:
+ * The 'time' field of the member's header is updated.
+ *
+ * Side Effects:
+ * The modification time of the entire archive is also changed.
+ * For a library, this could necessitate the re-ranlib'ing of the
+ * whole thing.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+Arch_Touch(GNode *gn)
+{
+ FILE * arch; /* Stream open to archive, positioned properly */
+ struct ar_hdr arh; /* Current header describing member */
+ char *p1, *p2;
+
+ arch = ArchFindMember(Var_Value(ARCHIVE, gn, &p1),
+ Var_Value(MEMBER, gn, &p2),
+ &arh, "r+");
+ if (p1)
+ free(p1);
+ if (p2)
+ free(p2);
+ snprintf(arh.AR_DATE, sizeof(arh.AR_DATE), "%-12ld", (long) now);
+
+ if (arch != NULL) {
+ (void)fwrite((char *)&arh, sizeof(struct ar_hdr), 1, arch);
+ fclose(arch);
+ }
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_TouchLib --
+ * Given a node which represents a library, touch the thing, making
+ * sure that the table of contents also is touched.
+ *
+ * Input:
+ * gn The node of the library to touch
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * Both the modification time of the library and of the RANLIBMAG
+ * member are set to 'now'.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+#if !defined(RANLIBMAG)
+Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED)
+#else
+Arch_TouchLib(GNode *gn)
+#endif
+{
+#ifdef RANLIBMAG
+ FILE * arch; /* Stream open to archive */
+ struct ar_hdr arh; /* Header describing table of contents */
+ struct utimbuf times; /* Times for utime() call */
+
+ arch = ArchFindMember(gn->path, UNCONST(RANLIBMAG), &arh, "r+");
+ snprintf(arh.AR_DATE, sizeof(arh.AR_DATE), "%-12ld", (long) now);
+
+ if (arch != NULL) {
+ (void)fwrite((char *)&arh, sizeof(struct ar_hdr), 1, arch);
+ fclose(arch);
+
+ times.actime = times.modtime = now;
+ utime(gn->path, ×);
+ }
+#endif
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_MTime --
+ * Return the modification time of a member of an archive.
+ *
+ * Input:
+ * gn Node describing archive member
+ *
+ * Results:
+ * The modification time(seconds).
+ *
+ * Side Effects:
+ * The mtime field of the given node is filled in with the value
+ * returned by the function.
+ *
+ *-----------------------------------------------------------------------
+ */
+time_t
+Arch_MTime(GNode *gn)
+{
+ struct ar_hdr *arhPtr; /* Header of desired member */
+ time_t modTime; /* Modification time as an integer */
+ char *p1, *p2;
+
+ arhPtr = ArchStatMember(Var_Value(ARCHIVE, gn, &p1),
+ Var_Value(MEMBER, gn, &p2),
+ TRUE);
+ if (p1)
+ free(p1);
+ if (p2)
+ free(p2);
+
+ if (arhPtr != NULL) {
+ modTime = (time_t)strtol(arhPtr->AR_DATE, NULL, 10);
+ } else {
+ modTime = 0;
+ }
+
+ gn->mtime = modTime;
+ return (modTime);
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_MemMTime --
+ * Given a non-existent archive member's node, get its modification
+ * time from its archived form, if it exists.
+ *
+ * Results:
+ * The modification time.
+ *
+ * Side Effects:
+ * The mtime field is filled in.
+ *
+ *-----------------------------------------------------------------------
+ */
+time_t
+Arch_MemMTime(GNode *gn)
+{
+ LstNode ln;
+ GNode *pgn;
+ char *nameStart,
+ *nameEnd;
+
+ if (Lst_Open(gn->parents) != SUCCESS) {
+ gn->mtime = 0;
+ return (0);
+ }
+ while ((ln = Lst_Next(gn->parents)) != NULL) {
+ pgn = (GNode *)Lst_Datum(ln);
+
+ if (pgn->type & OP_ARCHV) {
+ /*
+ * If the parent is an archive specification and is being made
+ * and its member's name matches the name of the node we were
+ * given, record the modification time of the parent in the
+ * child. We keep searching its parents in case some other
+ * parent requires this child to exist...
+ */
+ nameStart = strchr(pgn->name, '(') + 1;
+ nameEnd = strchr(nameStart, ')');
+
+ if ((pgn->flags & REMAKE) &&
+ strncmp(nameStart, gn->name, nameEnd - nameStart) == 0) {
+ gn->mtime = Arch_MTime(pgn);
+ }
+ } else if (pgn->flags & REMAKE) {
+ /*
+ * Something which isn't a library depends on the existence of
+ * this target, so it needs to exist.
+ */
+ gn->mtime = 0;
+ break;
+ }
+ }
+
+ Lst_Close(gn->parents);
+
+ return (gn->mtime);
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_FindLib --
+ * Search for a library along the given search path.
+ *
+ * Input:
+ * gn Node of library to find
+ * path Search path
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * The node's 'path' field is set to the found path (including the
+ * actual file name, not -l...). If the system can handle the -L
+ * flag when linking (or we cannot find the library), we assume that
+ * the user has placed the .LIBRARIES variable in the final linking
+ * command (or the linker will know where to find it) and set the
+ * TARGET variable for this node to be the node's name. Otherwise,
+ * we set the TARGET variable to be the full path of the library,
+ * as returned by Dir_FindFile.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+Arch_FindLib(GNode *gn, Lst path)
+{
+ char *libName; /* file name for archive */
+ size_t sz = strlen(gn->name) + 6 - 2;
+
+ libName = bmake_malloc(sz);
+ snprintf(libName, sz, "lib%s.a", &gn->name[2]);
+
+ gn->path = Dir_FindFile(libName, path);
+
+ free(libName);
+
+#ifdef LIBRARIES
+ Var_Set(TARGET, gn->name, gn, 0);
+#else
+ Var_Set(TARGET, gn->path == NULL ? gn->name : gn->path, gn, 0);
+#endif /* LIBRARIES */
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_LibOODate --
+ * Decide if a node with the OP_LIB attribute is out-of-date. Called
+ * from Make_OODate to make its life easier.
+ *
+ * There are several ways for a library to be out-of-date that are
+ * not available to ordinary files. In addition, there are ways
+ * that are open to regular files that are not available to
+ * libraries. A library that is only used as a source is never
+ * considered out-of-date by itself. This does not preclude the
+ * library's modification time from making its parent be out-of-date.
+ * A library will be considered out-of-date for any of these reasons,
+ * given that it is a target on a dependency line somewhere:
+ * Its modification time is less than that of one of its
+ * sources (gn->mtime < gn->cmgn->mtime).
+ * Its modification time is greater than the time at which the
+ * make began (i.e. it's been modified in the course
+ * of the make, probably by archiving).
+ * The modification time of one of its sources is greater than
+ * the one of its RANLIBMAG member (i.e. its table of contents
+ * is out-of-date). We don't compare of the archive time
+ * vs. TOC time because they can be too close. In my
+ * opinion we should not bother with the TOC at all since
+ * this is used by 'ar' rules that affect the data contents
+ * of the archive, not by ranlib rules, which affect the
+ * TOC.
+ *
+ * Input:
+ * gn The library's graph node
+ *
+ * Results:
+ * TRUE if the library is out-of-date. FALSE otherwise.
+ *
+ * Side Effects:
+ * The library will be hashed if it hasn't been already.
+ *
+ *-----------------------------------------------------------------------
+ */
+Boolean
+Arch_LibOODate(GNode *gn)
+{
+ Boolean oodate;
+
+ if (gn->type & OP_PHONY) {
+ oodate = TRUE;
+ } else if (OP_NOP(gn->type) && Lst_IsEmpty(gn->children)) {
+ oodate = FALSE;
+ } else if ((!Lst_IsEmpty(gn->children) && gn->cmgn == NULL) ||
+ (gn->mtime > now) ||
+ (gn->cmgn != NULL && gn->mtime < gn->cmgn->mtime)) {
+ oodate = TRUE;
+ } else {
+#ifdef RANLIBMAG
+ struct ar_hdr *arhPtr; /* Header for __.SYMDEF */
+ int modTimeTOC; /* The table-of-contents's mod time */
+
+ arhPtr = ArchStatMember(gn->path, UNCONST(RANLIBMAG), FALSE);
+
+ if (arhPtr != NULL) {
+ modTimeTOC = (int)strtol(arhPtr->AR_DATE, NULL, 10);
+
+ if (DEBUG(ARCH) || DEBUG(MAKE)) {
+ fprintf(debug_file, "%s modified %s...", RANLIBMAG, Targ_FmtTime(modTimeTOC));
+ }
+ oodate = (gn->cmgn == NULL || gn->cmgn->mtime > modTimeTOC);
+ } else {
+ /*
+ * A library w/o a table of contents is out-of-date
+ */
+ if (DEBUG(ARCH) || DEBUG(MAKE)) {
+ fprintf(debug_file, "No t.o.c....");
+ }
+ oodate = TRUE;
+ }
+#else
+ oodate = FALSE;
+#endif
+ }
+ return (oodate);
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_Init --
+ * Initialize things for this module.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * The 'archives' list is initialized.
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+Arch_Init(void)
+{
+ archives = Lst_Init(FALSE);
+}
+
+
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_End --
+ * Cleanup things for this module.
+ *
+ * Results:
+ * None.
+ *
+ * Side Effects:
+ * The 'archives' list is freed
+ *
+ *-----------------------------------------------------------------------
+ */
+void
+Arch_End(void)
+{
+#ifdef CLEANUP
+ Lst_Destroy(archives, ArchFree);
+#endif
+}
+
+/*-
+ *-----------------------------------------------------------------------
+ * Arch_IsLib --
+ * Check if the node is a library
+ *
+ * Results:
+ * True or False.
+ *
+ * Side Effects:
+ * None.
+ *
+ *-----------------------------------------------------------------------
+ */
+int
+Arch_IsLib(GNode *gn)
+{
+ static const char armag[] = "!<arch>\n";
+ char buf[sizeof(armag)-1];
+ int fd;
+
+ if ((fd = open(gn->path, O_RDONLY)) == -1)
+ return FALSE;
+
+ if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
+ (void)close(fd);
+ return FALSE;
+ }
+
+ (void)close(fd);
+
+ return memcmp(buf, armag, sizeof(buf)) == 0;
+}
--- /dev/null
+.\" $NetBSD: make.1,v 1.209 2012/10/08 15:09:48 christos Exp $
+.\"
+.\" Copyright (c) 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the University nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
+.\"
+.Dd October 8, 2012
+.Dt MAKE 1
+.Os
+.Sh NAME
+.Nm bmake
+.Nd maintain program dependencies
+.Sh SYNOPSIS
+.Nm
+.Op Fl BeikNnqrstWX
+.Op Fl C Ar directory
+.Op Fl D Ar variable
+.Op Fl d Ar flags
+.Op Fl f Ar makefile
+.Op Fl I Ar directory
+.Op Fl J Ar private
+.Op Fl j Ar max_jobs
+.Op Fl m Ar directory
+.Op Fl T Ar file
+.Op Fl V Ar variable
+.Op Ar variable=value
+.Op Ar target ...
+.Sh DESCRIPTION
+.Nm
+is a program designed to simplify the maintenance of other programs.
+Its input is a list of specifications as to the files upon which programs
+and other files depend.
+If no
+.Fl f Ar makefile
+makefile option is given,
+.Nm
+will try to open
+.Ql Pa makefile
+then
+.Ql Pa Makefile
+in order to find the specifications.
+If the file
+.Ql Pa .depend
+exists, it is read (see
+.Xr mkdep 1 ) .
+.Pp
+This manual page is intended as a reference document only.
+For a more thorough description of
+.Nm
+and makefiles, please refer to
+.%T "PMake \- A Tutorial" .
+.Pp
+.Nm
+will prepend the contents of the
+.Va MAKEFLAGS
+environment variable to the command line arguments before parsing them.
+.Pp
+The options are as follows:
+.Bl -tag -width Ds
+.It Fl B
+Try to be backwards compatible by executing a single shell per command and
+by executing the commands to make the sources of a dependency line in sequence.
+.It Fl C Ar directory
+Change to
+.Ar directory
+before reading the makefiles or doing anything else.
+If multiple
+.Fl C
+options are specified, each is interpreted relative to the previous one:
+.Fl C Pa / Fl C Pa etc
+is equivalent to
+.Fl C Pa /etc .
+.It Fl D Ar variable
+Define
+.Ar variable
+to be 1, in the global context.
+.It Fl d Ar [-]flags
+Turn on debugging, and specify which portions of
+.Nm
+are to print debugging information.
+Unless the flags are preceded by
+.Ql \-
+they are added to the
+.Va MAKEFLAGS
+environment variable and will be processed by any child make processes.
+By default, debugging information is printed to standard error,
+but this can be changed using the
+.Ar F
+debugging flag.
+The debugging output is always unbuffered; in addition, if debugging
+is enabled but debugging output is not directed to standard output,
+then the standard output is line buffered.
+.Ar Flags
+is one or more of the following:
+.Bl -tag -width Ds
+.It Ar A
+Print all possible debugging information;
+equivalent to specifying all of the debugging flags.
+.It Ar a
+Print debugging information about archive searching and caching.
+.It Ar C
+Print debugging information about current working directory.
+.It Ar c
+Print debugging information about conditional evaluation.
+.It Ar d
+Print debugging information about directory searching and caching.
+.It Ar e
+Print debugging information about failed commands and targets.
+.It Ar F Ns Oo Sy \&+ Oc Ns Ar filename
+Specify where debugging output is written.
+This must be the last flag, because it consumes the remainder of
+the argument.
+If the character immediately after the
+.Ql F
+flag is
+.Ql \&+ ,
+then the file will be opened in append mode;
+otherwise the file will be overwritten.
+If the file name is
+.Ql stdout
+or
+.Ql stderr
+then debugging output will be written to the
+standard output or standard error output file descriptors respectively
+(and the
+.Ql \&+
+option has no effect).
+Otherwise, the output will be written to the named file.
+If the file name ends
+.Ql .%d
+then the
+.Ql %d
+is replaced by the pid.
+.It Ar f
+Print debugging information about loop evaluation.
+.It Ar "g1"
+Print the input graph before making anything.
+.It Ar "g2"
+Print the input graph after making everything, or before exiting
+on error.
+.It Ar "g3"
+Print the input graph before exiting on error.
+.It Ar j
+Print debugging information about running multiple shells.
+.It Ar l
+Print commands in Makefiles regardless of whether or not they are prefixed by
+.Ql @
+or other "quiet" flags.
+Also known as "loud" behavior.
+.It Ar M
+Print debugging information about "meta" mode decisions about targets.
+.It Ar m
+Print debugging information about making targets, including modification
+dates.
+.It Ar n
+Don't delete the temporary command scripts created when running commands.
+These temporary scripts are created in the directory
+referred to by the
+.Ev TMPDIR
+environment variable, or in
+.Pa /tmp
+if
+.Ev TMPDIR
+is unset or set to the empty string.
+The temporary scripts are created by
+.Xr mkstemp 3 ,
+and have names of the form
+.Pa makeXXXXXX .
+.Em NOTE :
+This can create many files in
+.Ev TMPDIR
+or
+.Pa /tmp ,
+so use with care.
+.It Ar p
+Print debugging information about makefile parsing.
+.It Ar s
+Print debugging information about suffix-transformation rules.
+.It Ar t
+Print debugging information about target list maintenance.
+.It Ar V
+Force the
+.Fl V
+option to print raw values of variables.
+.It Ar v
+Print debugging information about variable assignment.
+.It Ar x
+Run shell commands with
+.Fl x
+so the actual commands are printed as they are executed.
+.El
+.It Fl e
+Specify that environment variables override macro assignments within
+makefiles.
+.It Fl f Ar makefile
+Specify a makefile to read instead of the default
+.Ql Pa makefile .
+If
+.Ar makefile
+is
+.Ql Fl ,
+standard input is read.
+Multiple makefiles may be specified, and are read in the order specified.
+.It Fl I Ar directory
+Specify a directory in which to search for makefiles and included makefiles.
+The system makefile directory (or directories, see the
+.Fl m
+option) is automatically included as part of this list.
+.It Fl i
+Ignore non-zero exit of shell commands in the makefile.
+Equivalent to specifying
+.Ql Fl
+before each command line in the makefile.
+.It Fl J Ar private
+This option should
+.Em not
+be specified by the user.
+.Pp
+When the
+.Ar j
+option is in use in a recursive build, this option is passed by a make
+to child makes to allow all the make processes in the build to
+cooperate to avoid overloading the system.
+.It Fl j Ar max_jobs
+Specify the maximum number of jobs that
+.Nm
+may have running at any one time.
+The value is saved in
+.Va .MAKE.JOBS .
+Turns compatibility mode off, unless the
+.Ar B
+flag is also specified.
+When compatibility mode is off, all commands associated with a
+target are executed in a single shell invocation as opposed to the
+traditional one shell invocation per line.
+This can break traditional scripts which change directories on each
+command invocation and then expect to start with a fresh environment
+on the next line.
+It is more efficient to correct the scripts rather than turn backwards
+compatibility on.
+.It Fl k
+Continue processing after errors are encountered, but only on those targets
+that do not depend on the target whose creation caused the error.
+.It Fl m Ar directory
+Specify a directory in which to search for sys.mk and makefiles included
+via the
+.Ao Ar file Ac Ns -style
+include statement.
+The
+.Fl m
+option can be used multiple times to form a search path.
+This path will override the default system include path: /usr/share/mk.
+Furthermore the system include path will be appended to the search path used
+for
+.Qo Ar file Qc Ns -style
+include statements (see the
+.Fl I
+option).
+.Pp
+If a file or directory name in the
+.Fl m
+argument (or the
+.Ev MAKESYSPATH
+environment variable) starts with the string
+.Qq \&.../
+then
+.Nm
+will search for the specified file or directory named in the remaining part
+of the argument string.
+The search starts with the current directory of
+the Makefile and then works upward towards the root of the filesystem.
+If the search is successful, then the resulting directory replaces the
+.Qq \&.../
+specification in the
+.Fl m
+argument.
+If used, this feature allows
+.Nm
+to easily search in the current source tree for customized sys.mk files
+(e.g., by using
+.Qq \&.../mk/sys.mk
+as an argument).
+.It Fl n
+Display the commands that would have been executed, but do not
+actually execute them unless the target depends on the .MAKE special
+source (see below).
+.It Fl N
+Display the commands which would have been executed, but do not
+actually execute any of them; useful for debugging top-level makefiles
+without descending into subdirectories.
+.It Fl q
+Do not execute any commands, but exit 0 if the specified targets are
+up-to-date and 1, otherwise.
+.It Fl r
+Do not use the built-in rules specified in the system makefile.
+.It Fl s
+Do not echo any commands as they are executed.
+Equivalent to specifying
+.Ql Ic @
+before each command line in the makefile.
+.It Fl T Ar tracefile
+When used with the
+.Fl j
+flag,
+append a trace record to
+.Ar tracefile
+for each job started and completed.
+.It Fl t
+Rather than re-building a target as specified in the makefile, create it
+or update its modification time to make it appear up-to-date.
+.It Fl V Ar variable
+Print
+.Nm Ns 's
+idea of the value of
+.Ar variable ,
+in the global context.
+Do not build any targets.
+Multiple instances of this option may be specified;
+the variables will be printed one per line,
+with a blank line for each null or undefined variable.
+If
+.Ar variable
+contains a
+.Ql \&$
+then the value will be expanded before printing.
+.It Fl W
+Treat any warnings during makefile parsing as errors.
+.It Fl X
+Don't export variables passed on the command line to the environment
+individually.
+Variables passed on the command line are still exported
+via the
+.Va MAKEFLAGS
+environment variable.
+This option may be useful on systems which have a small limit on the
+size of command arguments.
+.It Ar variable=value
+Set the value of the variable
+.Ar variable
+to
+.Ar value .
+Normally, all values passed on the command line are also exported to
+sub-makes in the environment.
+The
+.Fl X
+flag disables this behavior.
+Variable assignments should follow options for POSIX compatibility
+but no ordering is enforced.
+.El
+.Pp
+There are seven different types of lines in a makefile: file dependency
+specifications, shell commands, variable assignments, include statements,
+conditional directives, for loops, and comments.
+.Pp
+In general, lines may be continued from one line to the next by ending
+them with a backslash
+.Pq Ql \e .
+The trailing newline character and initial whitespace on the following
+line are compressed into a single space.
+.Sh FILE DEPENDENCY SPECIFICATIONS
+Dependency lines consist of one or more targets, an operator, and zero
+or more sources.
+This creates a relationship where the targets
+.Dq depend
+on the sources
+and are usually created from them.
+The exact relationship between the target and the source is determined
+by the operator that separates them.
+The three operators are as follows:
+.Bl -tag -width flag
+.It Ic \&:
+A target is considered out-of-date if its modification time is less than
+those of any of its sources.
+Sources for a target accumulate over dependency lines when this operator
+is used.
+The target is removed if
+.Nm
+is interrupted.
+.It Ic \&!
+Targets are always re-created, but not until all sources have been
+examined and re-created as necessary.
+Sources for a target accumulate over dependency lines when this operator
+is used.
+The target is removed if
+.Nm
+is interrupted.
+.It Ic \&::
+If no sources are specified, the target is always re-created.
+Otherwise, a target is considered out-of-date if any of its sources has
+been modified more recently than the target.
+Sources for a target do not accumulate over dependency lines when this
+operator is used.
+The target will not be removed if
+.Nm
+is interrupted.
+.El
+.Pp
+Targets and sources may contain the shell wildcard values
+.Ql \&? ,
+.Ql * ,
+.Ql [] ,
+and
+.Ql {} .
+The values
+.Ql \&? ,
+.Ql * ,
+and
+.Ql []
+may only be used as part of the final
+component of the target or source, and must be used to describe existing
+files.
+The value
+.Ql {}
+need not necessarily be used to describe existing files.
+Expansion is in directory order, not alphabetically as done in the shell.
+.Sh SHELL COMMANDS
+Each target may have associated with it a series of shell commands, normally
+used to create the target.
+Each of the commands in this script
+.Em must
+be preceded by a tab.
+While any target may appear on a dependency line, only one of these
+dependencies may be followed by a creation script, unless the
+.Ql Ic \&::
+operator is used.
+.Pp
+If the first characters of the command line are any combination of
+.Ql Ic @ ,
+.Ql Ic + ,
+or
+.Ql Ic \- ,
+the command is treated specially.
+A
+.Ql Ic @
+causes the command not to be echoed before it is executed.
+A
+.Ql Ic +
+causes the command to be executed even when
+.Fl n
+is given.
+This is similar to the effect of the .MAKE special source,
+except that the effect can be limited to a single line of a script.
+A
+.Ql Ic \-
+causes any non-zero exit status of the command line to be ignored.
+.Sh VARIABLE ASSIGNMENTS
+Variables in make are much like variables in the shell, and, by tradition,
+consist of all upper-case letters.
+.Ss Variable assignment modifiers
+The five operators that can be used to assign values to variables are as
+follows:
+.Bl -tag -width Ds
+.It Ic \&=
+Assign the value to the variable.
+Any previous value is overridden.
+.It Ic \&+=
+Append the value to the current value of the variable.
+.It Ic \&?=
+Assign the value to the variable if it is not already defined.
+.It Ic \&:=
+Assign with expansion, i.e. expand the value before assigning it
+to the variable.
+Normally, expansion is not done until the variable is referenced.
+.Em NOTE :
+References to undefined variables are
+.Em not
+expanded.
+This can cause problems when variable modifiers are used.
+.It Ic \&!=
+Expand the value and pass it to the shell for execution and assign
+the result to the variable.
+Any newlines in the result are replaced with spaces.
+.El
+.Pp
+Any white-space before the assigned
+.Ar value
+is removed; if the value is being appended, a single space is inserted
+between the previous contents of the variable and the appended value.
+.Pp
+Variables are expanded by surrounding the variable name with either
+curly braces
+.Pq Ql {}
+or parentheses
+.Pq Ql ()
+and preceding it with
+a dollar sign
+.Pq Ql \&$ .
+If the variable name contains only a single letter, the surrounding
+braces or parentheses are not required.
+This shorter form is not recommended.
+.Pp
+If the variable name contains a dollar, then the name itself is expanded first.
+This allows almost arbitrary variable names, however names containing dollar,
+braces, parenthesis, or whitespace are really best avoided!
+.Pp
+If the result of expanding a variable contains a dollar sign
+.Pq Ql \&$
+the string is expanded again.
+.Pp
+Variable substitution occurs at three distinct times, depending on where
+the variable is being used.
+.Bl -enum
+.It
+Variables in dependency lines are expanded as the line is read.
+.It
+Variables in shell commands are expanded when the shell command is
+executed.
+.It
+.Dq .for
+loop index variables are expanded on each loop iteration.
+Note that other variables are not expanded inside loops so
+the following example code:
+.Bd -literal -offset indent
+
+.Dv .for i in 1 2 3
+a+= ${i}
+j= ${i}
+b+= ${j}
+.Dv .endfor
+
+all:
+ @echo ${a}
+ @echo ${b}
+
+.Ed
+will print:
+.Bd -literal -offset indent
+1 2 3
+3 3 3
+
+.Ed
+Because while ${a} contains
+.Dq 1 2 3
+after the loop is executed, ${b}
+contains
+.Dq ${j} ${j} ${j}
+which expands to
+.Dq 3 3 3
+since after the loop completes ${j} contains
+.Dq 3 .
+.El
+.Ss Variable classes
+The four different classes of variables (in order of increasing precedence)
+are:
+.Bl -tag -width Ds
+.It Environment variables
+Variables defined as part of
+.Nm Ns 's
+environment.
+.It Global variables
+Variables defined in the makefile or in included makefiles.
+.It Command line variables
+Variables defined as part of the command line.
+.It Local variables
+Variables that are defined specific to a certain target.
+The seven local variables are as follows:
+.Bl -tag -width ".ARCHIVE"
+.It Va .ALLSRC
+The list of all sources for this target; also known as
+.Ql Va \&\*[Gt] .
+.It Va .ARCHIVE
+The name of the archive file.
+.It Va .IMPSRC
+In suffix-transformation rules, the name/path of the source from which the
+target is to be transformed (the
+.Dq implied
+source); also known as
+.Ql Va \&\*[Lt] .
+It is not defined in explicit rules.
+.It Va .MEMBER
+The name of the archive member.
+.It Va .OODATE
+The list of sources for this target that were deemed out-of-date; also
+known as
+.Ql Va \&? .
+.It Va .PREFIX
+The file prefix of the target, containing only the file portion, no suffix
+or preceding directory components; also known as
+.Ql Va * .
+.It Va .TARGET
+The name of the target; also known as
+.Ql Va @ .
+.El
+.Pp
+The shorter forms
+.Ql Va @ ,
+.Ql Va \&? ,
+.Ql Va \&\*[Lt] ,
+.Ql Va \&\*[Gt] ,
+and
+.Ql Va *
+are permitted for backward
+compatibility with historical makefiles and are not recommended.
+The six variables
+.Ql Va "@F" ,
+.Ql Va "@D" ,
+.Ql Va "\*[Lt]F" ,
+.Ql Va "\*[Lt]D" ,
+.Ql Va "*F" ,
+and
+.Ql Va "*D"
+are permitted for compatibility with
+.At V
+makefiles and are not recommended.
+.Pp
+Four of the local variables may be used in sources on dependency lines
+because they expand to the proper value for each target on the line.
+These variables are
+.Ql Va .TARGET ,
+.Ql Va .PREFIX ,
+.Ql Va .ARCHIVE ,
+and
+.Ql Va .MEMBER .
+.El
+.Ss Additional built-in variables
+In addition,
+.Nm
+sets or knows about the following variables:
+.Bl -tag -width .MAKEOVERRIDES
+.It Va \&$
+A single dollar sign
+.Ql \&$ ,
+i.e.
+.Ql \&$$
+expands to a single dollar
+sign.
+.It Va .ALLTARGETS
+The list of all targets encountered in the Makefile.
+If evaluated during
+Makefile parsing, lists only those targets encountered thus far.
+.It Va .CURDIR
+A path to the directory where
+.Nm
+was executed.
+Refer to the description of
+.Ql Ev PWD
+for more details.
+.It Ev MAKE
+The name that
+.Nm
+was executed with
+.Pq Va argv[0] .
+For compatibility
+.Nm
+also sets
+.Va .MAKE
+with the same value.
+The preferred variable to use is the environment variable
+.Ev MAKE
+because it is more compatible with other versions of
+.Nm
+and cannot be confused with the special target with the same name.
+.It Va .MAKE.DEPENDFILE
+Names the makefile (default
+.Ql Pa .depend )
+from which generated dependencies are read.
+.It Va .MAKE.EXPAND_VARIABLES
+A boolean that controls the default behavior of the
+.Fl V
+option.
+.It Va .MAKE.EXPORTED
+The list of variables exported by
+.Nm .
+.It Va .MAKE.JOBS
+The argument to the
+.Fl j
+option.
+.It Va .MAKE.JOB.PREFIX
+If
+.Nm
+is run with
+.Ar j
+then output for each target is prefixed with a token
+.Ql --- target ---
+the first part of which can be controlled via
+.Va .MAKE.JOB.PREFIX .
+.br
+For example:
+.Li .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
+would produce tokens like
+.Ql ---make[1234] target ---
+making it easier to track the degree of parallelism being achieved.
+.It Ev MAKEFLAGS
+The environment variable
+.Ql Ev MAKEFLAGS
+may contain anything that
+may be specified on
+.Nm Ns 's
+command line.
+Anything specified on
+.Nm Ns 's
+command line is appended to the
+.Ql Ev MAKEFLAGS
+variable which is then
+entered into the environment for all programs which
+.Nm
+executes.
+.It Va .MAKE.LEVEL
+The recursion depth of
+.Nm .
+The initial instance of
+.Nm
+will be 0, and an incremented value is put into the environment
+to be seen by the next generation.
+This allows tests like:
+.Li .if ${.MAKE.LEVEL} == 0
+to protect things which should only be evaluated in the initial instance of
+.Nm .
+.It Va .MAKE.MAKEFILE_PREFERENCE
+The ordered list of makefile names
+(default
+.Ql Pa makefile ,
+.Ql Pa Makefile )
+that
+.Nm
+will look for.
+.It Va .MAKE.MAKEFILES
+The list of makefiles read by
+.Nm ,
+which is useful for tracking dependencies.
+Each makefile is recorded only once, regardless of the number of times read.
+.It Va .MAKE.MODE
+Processed after reading all makefiles.
+Can affect the mode that
+.Nm
+runs in.
+It can contain a number of keywords:
+.Bl -hang -width ignore-cmd
+.It Pa compat
+Like
+.Fl B ,
+puts
+.Nm
+into "compat" mode.
+.It Pa meta
+Puts
+.Nm
+into "meta" mode, where meta files are created for each target
+to capture the command run, the output generated and if
+.Xr filemon 4
+is available, the system calls which are of interest to
+.Nm .
+The captured output can be very useful when diagnosing errors.
+.It Pa curdirOk= Ar bf
+Normally
+.Nm
+will not create .meta files in
+.Ql Va .CURDIR .
+This can be overridden by setting
+.Va bf
+to a value which represents True.
+.It Pa env
+For debugging, it can be useful to inlcude the environment
+in the .meta file.
+.It Pa verbose
+If in "meta" mode, print a clue about the target being built.
+This is useful if the build is otherwise running silently.
+The message printed the value of:
+.Va .MAKE.META.PREFIX .
+.It Pa ignore-cmd
+Some makefiles have commands which are simply not stable.
+This keyword causes them to be ignored for
+determining whether a target is out of date in "meta" mode.
+See also
+.Ic .NOMETA_CMP .
+.It Pa silent= Ar bf
+If
+.Va bf
+is True, when a .meta file is created, mark the target
+.Ic .SILENT .
+.El
+.It Va .MAKE.META.BAILIWICK
+In "meta" mode, provides a list of prefixes which
+match the directories controlled by
+.Nm .
+If a file that was generated outside of
+.Va .OBJDIR
+but within said bailiwick is missing,
+the current target is considered out-of-date.
+.It Va .MAKE.META.CREATED
+In "meta" mode, this variable contains a list of all the meta files
+updated.
+If not empty, it can be used to trigger processing of
+.Va .MAKE.META.FILES .
+.It Va .MAKE.META.FILES
+In "meta" mode, this variable contains a list of all the meta files
+used (updated or not).
+This list can be used to process the meta files to extract dependency
+information.
+.It Va .MAKE.META.PREFIX
+Defines the message printed for each meta file updated in "meta verbose" mode.
+The default value is:
+.Dl Building ${.TARGET:H:tA}/${.TARGET:T}
+.It Va .MAKEOVERRIDES
+This variable is used to record the names of variables assigned to
+on the command line, so that they may be exported as part of
+.Ql Ev MAKEFLAGS .
+This behaviour can be disabled by assigning an empty value to
+.Ql Va .MAKEOVERRIDES
+within a makefile.
+Extra variables can be exported from a makefile
+by appending their names to
+.Ql Va .MAKEOVERRIDES .
+.Ql Ev MAKEFLAGS
+is re-exported whenever
+.Ql Va .MAKEOVERRIDES
+is modified.
+.It Va .MAKE.PID
+The process-id of
+.Nm .
+.It Va .MAKE.PPID
+The parent process-id of
+.Nm .
+.It Va MAKE_PRINT_VAR_ON_ERROR
+When
+.Nm
+stops due to an error, it prints its name and the value of
+.Ql Va .CURDIR
+as well as the value of any variables named in
+.Ql Va MAKE_PRINT_VAR_ON_ERROR .
+.It Va .newline
+This variable is simply assigned a newline character as its value.
+This allows expansions using the
+.Cm \&:@
+modifier to put a newline between
+iterations of the loop rather than a space.
+For example, the printing of
+.Ql Va MAKE_PRINT_VAR_ON_ERROR
+could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
+.It Va .OBJDIR
+A path to the directory where the targets are built.
+Its value is determined by trying to
+.Xr chdir 2
+to the following directories in order and using the first match:
+.Bl -enum
+.It
+.Ev ${MAKEOBJDIRPREFIX}${.CURDIR}
+.Pp
+(Only if
+.Ql Ev MAKEOBJDIRPREFIX
+is set in the environment or on the command line.)
+.It
+.Ev ${MAKEOBJDIR}
+.Pp
+(Only if
+.Ql Ev MAKEOBJDIR
+is set in the environment or on the command line.)
+.It
+.Ev ${.CURDIR} Ns Pa /obj. Ns Ev ${MACHINE}
+.It
+.Ev ${.CURDIR} Ns Pa /obj
+.It
+.Pa /usr/obj/ Ns Ev ${.CURDIR}
+.It
+.Ev ${.CURDIR}
+.El
+.Pp
+Variable expansion is performed on the value before it's used,
+so expressions such as
+.Dl ${.CURDIR:S,^/usr/src,/var/obj,}
+may be used.
+This is especially useful with
+.Ql Ev MAKEOBJDIR .
+.Pp
+.Ql Va .OBJDIR
+may be modified in the makefile as a global variable.
+In all cases,
+.Nm
+will
+.Xr chdir 2
+to
+.Ql Va .OBJDIR
+and set
+.Ql Ev PWD
+to that directory before executing any targets.
+.
+.It Va .PARSEDIR
+A path to the directory of the current
+.Ql Pa Makefile
+being parsed.
+.It Va .PARSEFILE
+The basename of the current
+.Ql Pa Makefile
+being parsed.
+This variable and
+.Ql Va .PARSEDIR
+are both set only while the
+.Ql Pa Makefiles
+are being parsed.
+If you want to retain their current values, assign them to a variable
+using assignment with expansion:
+.Pq Ql Cm \&:= .
+.It Va .PATH
+A variable that represents the list of directories that
+.Nm
+will search for files.
+The search list should be updated using the target
+.Ql Va .PATH
+rather than the variable.
+.It Ev PWD
+Alternate path to the current directory.
+.Nm
+normally sets
+.Ql Va .CURDIR
+to the canonical path given by
+.Xr getcwd 3 .
+However, if the environment variable
+.Ql Ev PWD
+is set and gives a path to the current directory, then
+.Nm
+sets
+.Ql Va .CURDIR
+to the value of
+.Ql Ev PWD
+instead.
+This behaviour is disabled if
+.Ql Ev MAKEOBJDIRPREFIX
+is set or
+.Ql Ev MAKEOBJDIR
+contains a variable transform.
+.Ql Ev PWD
+is set to the value of
+.Ql Va .OBJDIR
+for all programs which
+.Nm
+executes.
+.It Ev .TARGETS
+The list of targets explicitly specified on the command line, if any.
+.It Ev VPATH
+Colon-separated
+.Pq Dq \&:
+lists of directories that
+.Nm
+will search for files.
+The variable is supported for compatibility with old make programs only,
+use
+.Ql Va .PATH
+instead.
+.El
+.Ss Variable modifiers
+Variable expansion may be modified to select or modify each word of the
+variable (where a
+.Dq word
+is white-space delimited sequence of characters).
+The general format of a variable expansion is as follows:
+.Pp
+.Dl ${variable[:modifier[:...]]}
+.Pp
+Each modifier begins with a colon,
+which may be escaped with a backslash
+.Pq Ql \e .
+.Pp
+A set of modifiers can be specified via a variable, as follows:
+.Pp
+.Dl modifier_variable=modifier[:...]
+.Dl ${variable:${modifier_variable}[:...]}
+.Pp
+In this case the first modifier in the modifier_variable does not
+start with a colon, since that must appear in the referencing
+variable.
+If any of the modifiers in the modifier_variable contain a dollar sign
+.Pq Ql $ ,
+these must be doubled to avoid early expansion.
+.Pp
+The supported modifiers are:
+.Bl -tag -width EEE
+.It Cm \&:E
+Replaces each word in the variable with its suffix.
+.It Cm \&:H
+Replaces each word in the variable with everything but the last component.
+.It Cm \&:M Ns Ar pattern
+Select only those words that match
+.Ar pattern .
+The standard shell wildcard characters
+.Pf ( Ql * ,
+.Ql \&? ,
+and
+.Ql Oo Oc )
+may
+be used.
+The wildcard characters may be escaped with a backslash
+.Pq Ql \e .
+.It Cm \&:N Ns Ar pattern
+This is identical to
+.Ql Cm \&:M ,
+but selects all words which do not match
+.Ar pattern .
+.It Cm \&:O
+Order every word in variable alphabetically.
+To sort words in
+reverse order use the
+.Ql Cm \&:O:[-1..1]
+combination of modifiers.
+.It Cm \&:Ox
+Randomize words in variable.
+The results will be different each time you are referring to the
+modified variable; use the assignment with expansion
+.Pq Ql Cm \&:=
+to prevent such behaviour.
+For example,
+.Bd -literal -offset indent
+LIST= uno due tre quattro
+RANDOM_LIST= ${LIST:Ox}
+STATIC_RANDOM_LIST:= ${LIST:Ox}
+
+all:
+ @echo "${RANDOM_LIST}"
+ @echo "${RANDOM_LIST}"
+ @echo "${STATIC_RANDOM_LIST}"
+ @echo "${STATIC_RANDOM_LIST}"
+.Ed
+may produce output similar to:
+.Bd -literal -offset indent
+quattro due tre uno
+tre due quattro uno
+due uno quattro tre
+due uno quattro tre
+.Ed
+.It Cm \&:Q
+Quotes every shell meta-character in the variable, so that it can be passed
+safely through recursive invocations of
+.Nm .
+.It Cm \&:R
+Replaces each word in the variable with everything but its suffix.
+.It Cm \&:gmtime
+The value is a format string for
+.Xr strftime 3 ,
+using the current
+.Xr gmtime 3 .
+.It Cm \&:hash
+Compute a 32bit hash of the value and encode it as hex digits.
+.It Cm \&:localtime
+The value is a format string for
+.Xr strftime 3 ,
+using the current
+.Xr localtime 3 .
+.It Cm \&:tA
+Attempt to convert variable to an absolute path using
+.Xr realpath 3 ,
+if that fails, the value is unchanged.
+.It Cm \&:tl
+Converts variable to lower-case letters.
+.It Cm \&:ts Ns Ar c
+Words in the variable are normally separated by a space on expansion.
+This modifier sets the separator to the character
+.Ar c .
+If
+.Ar c
+is omitted, then no separator is used.
+The common escapes (including octal numeric codes), work as expected.
+.It Cm \&:tu
+Converts variable to upper-case letters.
+.It Cm \&:tW
+Causes the value to be treated as a single word
+(possibly containing embedded white space).
+See also
+.Ql Cm \&:[*] .
+.It Cm \&:tw
+Causes the value to be treated as a sequence of
+words delimited by white space.
+See also
+.Ql Cm \&:[@] .
+.Sm off
+.It Cm \&:S No \&/ Ar old_string No \&/ Ar new_string No \&/ Op Cm 1gW
+.Sm on
+Modify the first occurrence of
+.Ar old_string
+in the variable's value, replacing it with
+.Ar new_string .
+If a
+.Ql g
+is appended to the last slash of the pattern, all occurrences
+in each word are replaced.
+If a
+.Ql 1
+is appended to the last slash of the pattern, only the first word
+is affected.
+If a
+.Ql W
+is appended to the last slash of the pattern,
+then the value is treated as a single word
+(possibly containing embedded white space).
+If
+.Ar old_string
+begins with a caret
+.Pq Ql ^ ,
+.Ar old_string
+is anchored at the beginning of each word.
+If
+.Ar old_string
+ends with a dollar sign
+.Pq Ql \&$ ,
+it is anchored at the end of each word.
+Inside
+.Ar new_string ,
+an ampersand
+.Pq Ql \*[Am]
+is replaced by
+.Ar old_string
+(without any
+.Ql ^
+or
+.Ql \&$ ) .
+Any character may be used as a delimiter for the parts of the modifier
+string.
+The anchoring, ampersand and delimiter characters may be escaped with a
+backslash
+.Pq Ql \e .
+.Pp
+Variable expansion occurs in the normal fashion inside both
+.Ar old_string
+and
+.Ar new_string
+with the single exception that a backslash is used to prevent the expansion
+of a dollar sign
+.Pq Ql \&$ ,
+not a preceding dollar sign as is usual.
+.Sm off
+.It Cm \&:C No \&/ Ar pattern No \&/ Ar replacement No \&/ Op Cm 1gW
+.Sm on
+The
+.Cm \&:C
+modifier is just like the
+.Cm \&:S
+modifier except that the old and new strings, instead of being
+simple strings, are a regular expression (see
+.Xr regex 3 )
+string
+.Ar pattern
+and an
+.Xr ed 1 Ns \-style
+string
+.Ar replacement .
+Normally, the first occurrence of the pattern
+.Ar pattern
+in each word of the value is substituted with
+.Ar replacement .
+The
+.Ql 1
+modifier causes the substitution to apply to at most one word; the
+.Ql g
+modifier causes the substitution to apply to as many instances of the
+search pattern
+.Ar pattern
+as occur in the word or words it is found in; the
+.Ql W
+modifier causes the value to be treated as a single word
+(possibly containing embedded white space).
+Note that
+.Ql 1
+and
+.Ql g
+are orthogonal; the former specifies whether multiple words are
+potentially affected, the latter whether multiple substitutions can
+potentially occur within each affected word.
+.It Cm \&:T
+Replaces each word in the variable with its last component.
+.It Cm \&:u
+Remove adjacent duplicate words (like
+.Xr uniq 1 ) .
+.Sm off
+.It Cm \&:\&? Ar true_string Cm \&: Ar false_string
+.Sm on
+If the variable name (not its value), when parsed as a .if conditional
+expression, evaluates to true, return as its value the
+.Ar true_string ,
+otherwise return the
+.Ar false_string .
+Since the variable name is used as the expression, \&:\&? must be the
+first modifier after the variable name itself - which will, of course,
+usually contain variable expansions.
+A common error is trying to use expressions like
+.Dl ${NUMBERS:M42:?match:no}
+which actually tests defined(NUMBERS),
+to determine is any words match "42" you need to use something like:
+.Dl ${"${NUMBERS:M42}" != \&"\&":?match:no} .
+.It Ar :old_string=new_string
+This is the
+.At V
+style variable substitution.
+It must be the last modifier specified.
+If
+.Ar old_string
+or
+.Ar new_string
+do not contain the pattern matching character
+.Ar %
+then it is assumed that they are
+anchored at the end of each word, so only suffixes or entire
+words may be replaced.
+Otherwise
+.Ar %
+is the substring of
+.Ar old_string
+to be replaced in
+.Ar new_string .
+.Pp
+Variable expansion occurs in the normal fashion inside both
+.Ar old_string
+and
+.Ar new_string
+with the single exception that a backslash is used to prevent the
+expansion of a dollar sign
+.Pq Ql \&$ ,
+not a preceding dollar sign as is usual.
+.Sm off
+.It Cm \&:@ Ar temp Cm @ Ar string Cm @
+.Sm on
+This is the loop expansion mechanism from the OSF Development
+Environment (ODE) make.
+Unlike
+.Cm \&.for
+loops expansion occurs at the time of
+reference.
+Assign
+.Ar temp
+to each word in the variable and evaluate
+.Ar string .
+The ODE convention is that
+.Ar temp
+should start and end with a period.
+For example.
+.Dl ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
+.Pp
+However a single character varaiable is often more readable:
+.Dl ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
+.It Cm \&:U Ns Ar newval
+If the variable is undefined
+.Ar newval
+is the value.
+If the variable is defined, the existing value is returned.
+This is another ODE make feature.
+It is handy for setting per-target CFLAGS for instance:
+.Dl ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}}
+If a value is only required if the variable is undefined, use:
+.Dl ${VAR:D:Unewval}
+.It Cm \&:D Ns Ar newval
+If the variable is defined
+.Ar newval
+is the value.
+.It Cm \&:L
+The name of the variable is the value.
+.It Cm \&:P
+The path of the node which has the same name as the variable
+is the value.
+If no such node exists or its path is null, then the
+name of the variable is used.
+In order for this modifier to work, the name (node) must at least have
+appeared on the rhs of a dependency.
+.Sm off
+.It Cm \&:\&! Ar cmd Cm \&!
+.Sm on
+The output of running
+.Ar cmd
+is the value.
+.It Cm \&:sh
+If the variable is non-empty it is run as a command and the output
+becomes the new value.
+.It Cm \&::= Ns Ar str
+The variable is assigned the value
+.Ar str
+after substitution.
+This modifier and its variations are useful in
+obscure situations such as wanting to set a variable when shell commands
+are being parsed.
+These assignment modifiers always expand to
+nothing, so if appearing in a rule line by themselves should be
+preceded with something to keep
+.Nm
+happy.
+.Pp
+The
+.Ql Cm \&::
+helps avoid false matches with the
+.At V
+style
+.Cm \&:=
+modifier and since substitution always occurs the
+.Cm \&::=
+form is vaguely appropriate.
+.It Cm \&::?= Ns Ar str
+As for
+.Cm \&::=
+but only if the variable does not already have a value.
+.It Cm \&::+= Ns Ar str
+Append
+.Ar str
+to the variable.
+.It Cm \&::!= Ns Ar cmd
+Assign the output of
+.Ar cmd
+to the variable.
+.It Cm \&:\&[ Ns Ar range Ns Cm \&]
+Selects one or more words from the value,
+or performs other operations related to the way in which the
+value is divided into words.
+.Pp
+Ordinarily, a value is treated as a sequence of words
+delimited by white space.
+Some modifiers suppress this behaviour,
+causing a value to be treated as a single word
+(possibly containing embedded white space).
+An empty value, or a value that consists entirely of white-space,
+is treated as a single word.
+For the purposes of the
+.Ql Cm \&:[]
+modifier, the words are indexed both forwards using positive integers
+(where index 1 represents the first word),
+and backwards using negative integers
+(where index \-1 represents the last word).
+.Pp
+The
+.Ar range
+is subjected to variable expansion, and the expanded result is
+then interpreted as follows:
+.Bl -tag -width index
+.\" :[n]
+.It Ar index
+Selects a single word from the value.
+.\" :[start..end]
+.It Ar start Ns Cm \&.. Ns Ar end
+Selects all words from
+.Ar start
+to
+.Ar end ,
+inclusive.
+For example,
+.Ql Cm \&:[2..-1]
+selects all words from the second word to the last word.
+If
+.Ar start
+is greater than
+.Ar end ,
+then the words are output in reverse order.
+For example,
+.Ql Cm \&:[-1..1]
+selects all the words from last to first.
+.\" :[*]
+.It Cm \&*
+Causes subsequent modifiers to treat the value as a single word
+(possibly containing embedded white space).
+Analogous to the effect of
+\&"$*\&"
+in Bourne shell.
+.\" :[0]
+.It 0
+Means the same as
+.Ql Cm \&:[*] .
+.\" :[*]
+.It Cm \&@
+Causes subsequent modifiers to treat the value as a sequence of words
+delimited by white space.
+Analogous to the effect of
+\&"$@\&"
+in Bourne shell.
+.\" :[#]
+.It Cm \&#
+Returns the number of words in the value.
+.El \" :[range]
+.El
+.Sh INCLUDE STATEMENTS, CONDITIONALS AND FOR LOOPS
+Makefile inclusion, conditional structures and for loops reminiscent
+of the C programming language are provided in
+.Nm .
+All such structures are identified by a line beginning with a single
+dot
+.Pq Ql \&.
+character.
+Files are included with either
+.Cm \&.include Aq Ar file
+or
+.Cm \&.include Pf \*q Ar file Ns \*q .
+Variables between the angle brackets or double quotes are expanded
+to form the file name.
+If angle brackets are used, the included makefile is expected to be in
+the system makefile directory.
+If double quotes are used, the including makefile's directory and any
+directories specified using the
+.Fl I
+option are searched before the system
+makefile directory.
+For compatibility with other versions of
+.Nm
+.Ql include file ...
+is also accepted.
+If the include statement is written as
+.Cm .-include
+or as
+.Cm .sinclude
+then errors locating and/or opening include files are ignored.
+.Pp
+Conditional expressions are also preceded by a single dot as the first
+character of a line.
+The possible conditionals are as follows:
+.Bl -tag -width Ds
+.It Ic .error Ar message
+The message is printed along with the name of the makefile and line number,
+then
+.Nm
+will exit.
+.It Ic .export Ar variable ...
+Export the specified global variable.
+If no variable list is provided, all globals are exported
+except for internal variables (those that start with
+.Ql \&. ) .
+This is not affected by the
+.Fl X
+flag, so should be used with caution.
+For compatibility with other
+.Nm
+programs
+.Ql export variable=value
+is also accepted.
+.Pp
+Appending a variable name to
+.Va .MAKE.EXPORTED
+is equivalent to exporting a variable.
+.It Ic .export-env Ar variable ...
+The same as
+.Ql .export ,
+except that the variable is not appended to
+.Va .MAKE.EXPORTED .
+This allows exporting a value to the environment which is different from that
+used by
+.Nm
+internally.
+.It Ic .info Ar message
+The message is printed along with the name of the makefile and line number.
+.It Ic .undef Ar variable
+Un-define the specified global variable.
+Only global variables may be un-defined.
+.It Ic .unexport Ar variable ...
+The opposite of
+.Ql .export .
+The specified global
+.Va variable
+will be removed from
+.Va .MAKE.EXPORTED .
+If no variable list is provided, all globals are unexported,
+and
+.Va .MAKE.EXPORTED
+deleted.
+.It Ic .unexport-env
+Unexport all globals previously exported and
+clear the environment inherited from the parent.
+This operation will cause a memory leak of the original environment,
+so should be used sparingly.
+Testing for
+.Va .MAKE.LEVEL
+being 0, would make sense.
+Also note that any variables which originated in the parent environment
+should be explicitly preserved if desired.
+For example:
+.Bd -literal -offset indent
+.Li .if ${.MAKE.LEVEL} == 0
+PATH := ${PATH}
+.Li .unexport-env
+.Li .export PATH
+.Li .endif
+.Pp
+.Ed
+Would result in an environment containing only
+.Ql Ev PATH ,
+which is the minimal useful environment.
+Actually
+.Ql Ev .MAKE.LEVEL
+will also be pushed into the new environment.
+.It Ic .warning Ar message
+The message prefixed by
+.Ql Pa warning:
+is printed along with the name of the makefile and line number.
+.It Ic \&.if Oo \&! Oc Ns Ar expression Op Ar operator expression ...
+Test the value of an expression.
+.It Ic .ifdef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+Test the value of a variable.
+.It Ic .ifndef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+Test the value of a variable.
+.It Ic .ifmake Oo \&! Oc Ns Ar target Op Ar operator target ...
+Test the target being built.
+.It Ic .ifnmake Oo \&! Ns Oc Ar target Op Ar operator target ...
+Test the target being built.
+.It Ic .else
+Reverse the sense of the last conditional.
+.It Ic .elif Oo \&! Ns Oc Ar expression Op Ar operator expression ...
+A combination of
+.Ql Ic .else
+followed by
+.Ql Ic .if .
+.It Ic .elifdef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+A combination of
+.Ql Ic .else
+followed by
+.Ql Ic .ifdef .
+.It Ic .elifndef Oo \&! Oc Ns Ar variable Op Ar operator variable ...
+A combination of
+.Ql Ic .else
+followed by
+.Ql Ic .ifndef .
+.It Ic .elifmake Oo \&! Oc Ns Ar target Op Ar operator target ...
+A combination of
+.Ql Ic .else
+followed by
+.Ql Ic .ifmake .
+.It Ic .elifnmake Oo \&! Oc Ns Ar target Op Ar operator target ...
+A combination of
+.Ql Ic .else
+followed by
+.Ql Ic .ifnmake .
+.It Ic .endif
+End the body of the conditional.
+.El
+.Pp
+The
+.Ar operator
+may be any one of the following:
+.Bl -tag -width "Cm XX"
+.It Cm \&|\&|
+Logical OR.
+.It Cm \&\*[Am]\*[Am]
+Logical
+.Tn AND ;
+of higher precedence than
+.Dq \&|\&| .
+.El
+.Pp
+As in C,
+.Nm
+will only evaluate a conditional as far as is necessary to determine
+its value.
+Parentheses may be used to change the order of evaluation.
+The boolean operator
+.Ql Ic \&!
+may be used to logically negate an entire
+conditional.
+It is of higher precedence than
+.Ql Ic \&\*[Am]\*[Am] .
+.Pp
+The value of
+.Ar expression
+may be any of the following:
+.Bl -tag -width defined
+.It Ic defined
+Takes a variable name as an argument and evaluates to true if the variable
+has been defined.
+.It Ic make
+Takes a target name as an argument and evaluates to true if the target
+was specified as part of
+.Nm Ns 's
+command line or was declared the default target (either implicitly or
+explicitly, see
+.Va .MAIN )
+before the line containing the conditional.
+.It Ic empty
+Takes a variable, with possible modifiers, and evaluates to true if
+the expansion of the variable would result in an empty string.
+.It Ic exists
+Takes a file name as an argument and evaluates to true if the file exists.
+The file is searched for on the system search path (see
+.Va .PATH ) .
+.It Ic target
+Takes a target name as an argument and evaluates to true if the target
+has been defined.
+.It Ic commands
+Takes a target name as an argument and evaluates to true if the target
+has been defined and has commands associated with it.
+.El
+.Pp
+.Ar Expression
+may also be an arithmetic or string comparison.
+Variable expansion is
+performed on both sides of the comparison, after which the integral
+values are compared.
+A value is interpreted as hexadecimal if it is
+preceded by 0x, otherwise it is decimal; octal numbers are not supported.
+The standard C relational operators are all supported.
+If after
+variable expansion, either the left or right hand side of a
+.Ql Ic ==
+or
+.Ql Ic "!="
+operator is not an integral value, then
+string comparison is performed between the expanded
+variables.
+If no relational operator is given, it is assumed that the expanded
+variable is being compared against 0 or an empty string in the case
+of a string comparison.
+.Pp
+When
+.Nm
+is evaluating one of these conditional expressions, and it encounters
+a (white-space separated) word it doesn't recognize, either the
+.Dq make
+or
+.Dq defined
+expression is applied to it, depending on the form of the conditional.
+If the form is
+.Ql Ic .ifdef ,
+.Ql Ic .ifndef ,
+or
+.Ql Ic .if
+the
+.Dq defined
+expression is applied.
+Similarly, if the form is
+.Ql Ic .ifmake
+or
+.Ql Ic .ifnmake , the
+.Dq make
+expression is applied.
+.Pp
+If the conditional evaluates to true the parsing of the makefile continues
+as before.
+If it evaluates to false, the following lines are skipped.
+In both cases this continues until a
+.Ql Ic .else
+or
+.Ql Ic .endif
+is found.
+.Pp
+For loops are typically used to apply a set of rules to a list of files.
+The syntax of a for loop is:
+.Pp
+.Bl -tag -compact -width Ds
+.It Ic \&.for Ar variable Oo Ar variable ... Oc Ic in Ar expression
+.It Aq make-rules
+.It Ic \&.endfor
+.El
+.Pp
+After the for
+.Ic expression
+is evaluated, it is split into words.
+On each iteration of the loop, one word is taken and assigned to each
+.Ic variable ,
+in order, and these
+.Ic variables
+are substituted into the
+.Ic make-rules
+inside the body of the for loop.
+The number of words must come out even; that is, if there are three
+iteration variables, the number of words provided must be a multiple
+of three.
+.Sh COMMENTS
+Comments begin with a hash
+.Pq Ql \&#
+character, anywhere but in a shell
+command line, and continue to the end of an unescaped new line.
+.Sh SPECIAL SOURCES (ATTRIBUTES)
+.Bl -tag -width .IGNOREx
+.It Ic .EXEC
+Target is never out of date, but always execute commands anyway.
+.It Ic .IGNORE
+Ignore any errors from the commands associated with this target, exactly
+as if they all were preceded by a dash
+.Pq Ql \- .
+.\" .It Ic .INVISIBLE
+.\" XXX
+.\" .It Ic .JOIN
+.\" XXX
+.It Ic .MADE
+Mark all sources of this target as being up-to-date.
+.It Ic .MAKE
+Execute the commands associated with this target even if the
+.Fl n
+or
+.Fl t
+options were specified.
+Normally used to mark recursive
+.Nm Ns 's .
+.It Ic .META
+Create a meta file for the target, even if it is flagged as
+.Ic .PHONY ,
+.Ic .MAKE ,
+or
+.Ic .SPECIAL .
+Usage in conjunction with
+.Ic .MAKE
+is the most likely case.
+In "meta" mode, the target is out-of-date if the meta file is missing.
+.It Ic .NOMETA
+Do not create a meta file for the target.
+Meta files are also not created for
+.Ic .PHONY ,
+.Ic .MAKE ,
+or
+.Ic .SPECIAL
+targets.
+.It Ic .NOMETA_CMP
+Ignore differences in commands when deciding if target is out of date.
+This is useful if the command contains a value which always changes.
+If the number of commands change, though, the target will still be out of date.
+.It Ic .NOPATH
+Do not search for the target in the directories specified by
+.Ic .PATH .
+.It Ic .NOTMAIN
+Normally
+.Nm
+selects the first target it encounters as the default target to be built
+if no target was specified.
+This source prevents this target from being selected.
+.It Ic .OPTIONAL
+If a target is marked with this attribute and
+.Nm
+can't figure out how to create it, it will ignore this fact and assume
+the file isn't needed or already exists.
+.It Ic .PHONY
+The target does not
+correspond to an actual file; it is always considered to be out of date,
+and will not be created with the
+.Fl t
+option.
+Suffix-transformation rules are not applied to
+.Ic .PHONY
+targets.
+.It Ic .PRECIOUS
+When
+.Nm
+is interrupted, it normally removes any partially made targets.
+This source prevents the target from being removed.
+.It Ic .RECURSIVE
+Synonym for
+.Ic .MAKE .
+.It Ic .SILENT
+Do not echo any of the commands associated with this target, exactly
+as if they all were preceded by an at sign
+.Pq Ql @ .
+.It Ic .USE
+Turn the target into
+.Nm Ns 's
+version of a macro.
+When the target is used as a source for another target, the other target
+acquires the commands, sources, and attributes (except for
+.Ic .USE )
+of the
+source.
+If the target already has commands, the
+.Ic .USE
+target's commands are appended
+to them.
+.It Ic .USEBEFORE
+Exactly like
+.Ic .USE ,
+but prepend the
+.Ic .USEBEFORE
+target commands to the target.
+.It Ic .WAIT
+If
+.Ic .WAIT
+appears in a dependency line, the sources that precede it are
+made before the sources that succeed it in the line.
+Since the dependents of files are not made until the file itself
+could be made, this also stops the dependents being built unless they
+are needed for another branch of the dependency tree.
+So given:
+.Bd -literal
+x: a .WAIT b
+ echo x
+a:
+ echo a
+b: b1
+ echo b
+b1:
+ echo b1
+
+.Ed
+the output is always
+.Ql a ,
+.Ql b1 ,
+.Ql b ,
+.Ql x .
+.br
+The ordering imposed by
+.Ic .WAIT
+is only relevant for parallel makes.
+.El
+.Sh SPECIAL TARGETS
+Special targets may not be included with other targets, i.e. they must be
+the only target specified.
+.Bl -tag -width .BEGINx
+.It Ic .BEGIN
+Any command lines attached to this target are executed before anything
+else is done.
+.It Ic .DEFAULT
+This is sort of a
+.Ic .USE
+rule for any target (that was used only as a
+source) that
+.Nm
+can't figure out any other way to create.
+Only the shell script is used.
+The
+.Ic .IMPSRC
+variable of a target that inherits
+.Ic .DEFAULT Ns 's
+commands is set
+to the target's own name.
+.It Ic .END
+Any command lines attached to this target are executed after everything
+else is done.
+.It Ic .ERROR
+Any command lines attached to this target are executed when another target fails.
+The
+.Ic .ERROR_TARGET
+variable is set to the target that failed.
+See also
+.Ic MAKE_PRINT_VAR_ON_ERROR .
+.It Ic .IGNORE
+Mark each of the sources with the
+.Ic .IGNORE
+attribute.
+If no sources are specified, this is the equivalent of specifying the
+.Fl i
+option.
+.It Ic .INTERRUPT
+If
+.Nm
+is interrupted, the commands for this target will be executed.
+.It Ic .MAIN
+If no target is specified when
+.Nm
+is invoked, this target will be built.
+.It Ic .MAKEFLAGS
+This target provides a way to specify flags for
+.Nm
+when the makefile is used.
+The flags are as if typed to the shell, though the
+.Fl f
+option will have
+no effect.
+.\" XXX: NOT YET!!!!
+.\" .It Ic .NOTPARALLEL
+.\" The named targets are executed in non parallel mode.
+.\" If no targets are
+.\" specified, then all targets are executed in non parallel mode.
+.It Ic .NOPATH
+Apply the
+.Ic .NOPATH
+attribute to any specified sources.
+.It Ic .NOTPARALLEL
+Disable parallel mode.
+.It Ic .NO_PARALLEL
+Synonym for
+.Ic .NOTPARALLEL ,
+for compatibility with other pmake variants.
+.It Ic .ORDER
+The named targets are made in sequence.
+This ordering does not add targets to the list of targets to be made.
+Since the dependents of a target do not get built until the target itself
+could be built, unless
+.Ql a
+is built by another part of the dependency graph,
+the following is a dependency loop:
+.Bd -literal
+\&.ORDER: b a
+b: a
+.Ed
+.Pp
+The ordering imposed by
+.Ic .ORDER
+is only relevant for parallel makes.
+.\" XXX: NOT YET!!!!
+.\" .It Ic .PARALLEL
+.\" The named targets are executed in parallel mode.
+.\" If no targets are
+.\" specified, then all targets are executed in parallel mode.
+.It Ic .PATH
+The sources are directories which are to be searched for files not
+found in the current directory.
+If no sources are specified, any previously specified directories are
+deleted.
+If the source is the special
+.Ic .DOTLAST
+target, then the current working
+directory is searched last.
+.It Ic .PHONY
+Apply the
+.Ic .PHONY
+attribute to any specified sources.
+.It Ic .PRECIOUS
+Apply the
+.Ic .PRECIOUS
+attribute to any specified sources.
+If no sources are specified, the
+.Ic .PRECIOUS
+attribute is applied to every
+target in the file.
+.It Ic .SHELL
+Sets the shell that
+.Nm
+will use to execute commands.
+The sources are a set of
+.Ar field=value
+pairs.
+.Bl -tag -width hasErrCtls
+.It Ar name
+This is the minimal specification, used to select one of the builtin
+shell specs;
+.Ar sh ,
+.Ar ksh ,
+and
+.Ar csh .
+.It Ar path
+Specifies the path to the shell.
+.It Ar hasErrCtl
+Indicates whether the shell supports exit on error.
+.It Ar check
+The command to turn on error checking.
+.It Ar ignore
+The command to disable error checking.
+.It Ar echo
+The command to turn on echoing of commands executed.
+.It Ar quiet
+The command to turn off echoing of commands executed.
+.It Ar filter
+The output to filter after issuing the
+.Ar quiet
+command.
+It is typically identical to
+.Ar quiet .
+.It Ar errFlag
+The flag to pass the shell to enable error checking.
+.It Ar echoFlag
+The flag to pass the shell to enable command echoing.
+.It Ar newline
+The string literal to pass the shell that results in a single newline
+character when used outside of any quoting characters.
+.El
+Example:
+.Bd -literal
+\&.SHELL: name=ksh path=/bin/ksh hasErrCtl=true \e
+ check="set \-e" ignore="set +e" \e
+ echo="set \-v" quiet="set +v" filter="set +v" \e
+ echoFlag=v errFlag=e newline="'\en'"
+.Ed
+.It Ic .SILENT
+Apply the
+.Ic .SILENT
+attribute to any specified sources.
+If no sources are specified, the
+.Ic .SILENT
+attribute is applied to every
+command in the file.
+.It Ic .SUFFIXES
+Each source specifies a suffix to
+.Nm .
+If no sources are specified, any previously specified suffixes are deleted.
+It allows the creation of suffix-transformation rules.
+.Pp
+Example:
+.Bd -literal
+\&.SUFFIXES: .o
+\&.c.o:
+ cc \-o ${.TARGET} \-c ${.IMPSRC}
+.Ed
+.El
+.Sh ENVIRONMENT
+.Nm
+uses the following environment variables, if they exist:
+.Ev MACHINE ,
+.Ev MACHINE_ARCH ,
+.Ev MAKE ,
+.Ev MAKEFLAGS ,
+.Ev MAKEOBJDIR ,
+.Ev MAKEOBJDIRPREFIX ,
+.Ev MAKESYSPATH ,
+.Ev PWD ,
+and
+.Ev TMPDIR .
+.Pp
+.Ev MAKEOBJDIRPREFIX
+and
+.Ev MAKEOBJDIR
+may only be set in the environment or on the command line to
+.Nm
+and not as makefile variables;
+see the description of
+.Ql Va .OBJDIR
+for more details.
+.Sh FILES
+.Bl -tag -width /usr/share/mk -compact
+.It .depend
+list of dependencies
+.It Makefile
+list of dependencies
+.It makefile
+list of dependencies
+.It sys.mk
+system makefile
+.It /usr/share/mk
+system makefile directory
+.El
+.Sh COMPATIBILITY
+The basic make syntax is compatible between different versions of make,
+however the special variables, variable modifiers and conditionals are not.
+.Pp
+The way that parallel makes are scheduled changed in
+NetBSD 4.0
+so that .ORDER and .WAIT apply recursively to the dependent nodes.
+The algorithms used may change again in the future.
+.Pp
+The way that .for loop variables are substituted changed after
+NetBSD 5.0
+so that they still appear to be variable expansions.
+In particular this stops them being treated as syntax, and removes some
+obscure problems using them in .if statements.
+.Pp
+Unlike other
+.Nm
+programs, this implementation by default executes all commands for a given
+target using a single shell invocation.
+This is done for both efficiency and to simplify error handling in remote
+command invocations.
+Typically this is transparent to the user, unless the target commands change
+the current working directory using
+.Dq cd
+or
+.Dq chdir .
+To be compatible with Makefiles that do this, one can use
+.Fl B
+to disable this behavior.
+.Pp
+In compatibility mode, each command is run in a separate process.
+If the command contains any shell meta characters
+.Pq Ql #=|^(){};&<>*?[]:$`\e\en
+it will be passed to the shell, otherwise
+.Nm
+will attempt direct execution.
+.Sh SEE ALSO
+.Xr mkdep 1
+.Sh HISTORY
+.Nm
+is derived from NetBSD
+.Xr make 1 .
+It uses autoconf to facilitate portability to other platforms.
+.Pp
+A
+make
+command appeared in
+.At v7 .
+This
+make
+implementation is based on Adam De Boor's pmake program which was written
+for Sprite at Berkeley.
+It was designed to be a parallel distributed make running jobs on different
+machines using a daemon called
+.Dq customs .
+.Sh BUGS
+The
+make
+syntax is difficult to parse without actually acting of the data.
+For instance finding the end of a variable use should involve scanning each
+the modifiers using the correct terminator for each field.
+In many places
+make
+just counts {} and () in order to find the end of a variable expansion.
+.Pp
+There is no way of escaping a space character in a filename.
--- /dev/null
+MAKE(1) NetBSD General Commands Manual MAKE(1)
+
+N\bNA\bAM\bME\bE
+ b\bbm\bma\bak\bke\be -- maintain program dependencies
+
+S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
+ b\bbm\bma\bak\bke\be [-\b-B\bBe\bei\bik\bkN\bNn\bnq\bqr\brs\bst\btW\bWX\bX] [-\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [-\b-d\bd _\bf_\bl_\ba_\bg_\bs]
+ [-\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be] [-\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be] [-\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs]
+ [-\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-T\bT _\bf_\bi_\bl_\be] [-\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be]
+ [_\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ b\bbm\bma\bak\bke\be is a program designed to simplify the maintenance of other pro-
+ grams. Its input is a list of specifications as to the files upon which
+ programs and other files depend. If no -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be makefile option is
+ given, b\bbm\bma\bak\bke\be will try to open `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be' then `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' in order to find
+ the specifications. If the file `_\b._\bd_\be_\bp_\be_\bn_\bd' exists, it is read (see
+ mkdep(1)).
+
+ This manual page is intended as a reference document only. For a more
+ thorough description of b\bbm\bma\bak\bke\be and makefiles, please refer to _\bP_\bM_\ba_\bk_\be _\b- _\bA
+ _\bT_\bu_\bt_\bo_\br_\bi_\ba_\bl.
+
+ b\bbm\bma\bak\bke\be will prepend the contents of the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable to
+ the command line arguments before parsing them.
+
+ The options are as follows:
+
+ -\b-B\bB Try to be backwards compatible by executing a single shell per
+ command and by executing the commands to make the sources of a
+ dependency line in sequence.
+
+ -\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Change to _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by before reading the makefiles or doing any-
+ thing else. If multiple -\b-C\bC options are specified, each is inter-
+ preted relative to the previous one: -\b-C\bC _\b/ -\b-C\bC _\be_\bt_\bc is equivalent to
+ -\b-C\bC _\b/_\be_\bt_\bc.
+
+ -\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
+ Define _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to be 1, in the global context.
+
+ -\b-d\bd _\b[_\b-_\b]_\bf_\bl_\ba_\bg_\bs
+ Turn on debugging, and specify which portions of b\bbm\bma\bak\bke\be are to
+ print debugging information. Unless the flags are preceded by
+ `-' they are added to the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable and will
+ be processed by any child make processes. By default, debugging
+ information is printed to standard error, but this can be changed
+ using the _\bF debugging flag. The debugging output is always
+ unbuffered; in addition, if debugging is enabled but debugging
+ output is not directed to standard output, then the standard out-
+ put is line buffered. _\bF_\bl_\ba_\bg_\bs is one or more of the following:
+
+ _\bA Print all possible debugging information; equivalent to
+ specifying all of the debugging flags.
+
+ _\ba Print debugging information about archive searching and
+ caching.
+
+ _\bC Print debugging information about current working direc-
+ tory.
+
+ _\bc Print debugging information about conditional evaluation.
+
+ _\bd Print debugging information about directory searching and
+ caching.
+
+ _\be Print debugging information about failed commands and
+ targets.
+
+ _\bF[+\b+]_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
+ Specify where debugging output is written. This must be
+ the last flag, because it consumes the remainder of the
+ argument. If the character immediately after the `F'
+ flag is `+', then the file will be opened in append mode;
+ otherwise the file will be overwritten. If the file name
+ is `stdout' or `stderr' then debugging output will be
+ written to the standard output or standard error output
+ file descriptors respectively (and the `+' option has no
+ effect). Otherwise, the output will be written to the
+ named file. If the file name ends `.%d' then the `%d' is
+ replaced by the pid.
+
+ _\bf Print debugging information about loop evaluation.
+
+ _\bg_\b1 Print the input graph before making anything.
+
+ _\bg_\b2 Print the input graph after making everything, or before
+ exiting on error.
+
+ _\bg_\b3 Print the input graph before exiting on error.
+
+ _\bj Print debugging information about running multiple
+ shells.
+
+ _\bl Print commands in Makefiles regardless of whether or not
+ they are prefixed by `@' or other "quiet" flags. Also
+ known as "loud" behavior.
+
+ _\bM Print debugging information about "meta" mode decisions
+ about targets.
+
+ _\bm Print debugging information about making targets, includ-
+ ing modification dates.
+
+ _\bn Don't delete the temporary command scripts created when
+ running commands. These temporary scripts are created in
+ the directory referred to by the TMPDIR environment vari-
+ able, or in _\b/_\bt_\bm_\bp if TMPDIR is unset or set to the empty
+ string. The temporary scripts are created by mkstemp(3),
+ and have names of the form _\bm_\ba_\bk_\be_\bX_\bX_\bX_\bX_\bX_\bX. _\bN_\bO_\bT_\bE: This can
+ create many files in TMPDIR or _\b/_\bt_\bm_\bp, so use with care.
+
+ _\bp Print debugging information about makefile parsing.
+
+ _\bs Print debugging information about suffix-transformation
+ rules.
+
+ _\bt Print debugging information about target list mainte-
+ nance.
+
+ _\bV Force the -\b-V\bV option to print raw values of variables.
+
+ _\bv Print debugging information about variable assignment.
+
+ _\bx Run shell commands with -\b-x\bx so the actual commands are
+ printed as they are executed.
+
+ -\b-e\be Specify that environment variables override macro assignments
+ within makefiles.
+
+ -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be
+ Specify a makefile to read instead of the default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be'. If
+ _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be is `-\b-', standard input is read. Multiple makefiles may
+ be specified, and are read in the order specified.
+
+ -\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Specify a directory in which to search for makefiles and included
+ makefiles. The system makefile directory (or directories, see
+ the -\b-m\bm option) is automatically included as part of this list.
+
+ -\b-i\bi Ignore non-zero exit of shell commands in the makefile. Equiva-
+ lent to specifying `-\b-' before each command line in the makefile.
+
+ -\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be
+ This option should _\bn_\bo_\bt be specified by the user.
+
+ When the _\bj option is in use in a recursive build, this option is
+ passed by a make to child makes to allow all the make processes
+ in the build to cooperate to avoid overloading the system.
+
+ -\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs
+ Specify the maximum number of jobs that b\bbm\bma\bak\bke\be may have running at
+ any one time. The value is saved in _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\bS. Turns compati-
+ bility mode off, unless the _\bB flag is also specified. When com-
+ patibility mode is off, all commands associated with a target are
+ executed in a single shell invocation as opposed to the tradi-
+ tional one shell invocation per line. This can break traditional
+ scripts which change directories on each command invocation and
+ then expect to start with a fresh environment on the next line.
+ It is more efficient to correct the scripts rather than turn
+ backwards compatibility on.
+
+ -\b-k\bk Continue processing after errors are encountered, but only on
+ those targets that do not depend on the target whose creation
+ caused the error.
+
+ -\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Specify a directory in which to search for sys.mk and makefiles
+ included via the <_\bf_\bi_\bl_\be>-style include statement. The -\b-m\bm option
+ can be used multiple times to form a search path. This path will
+ override the default system include path: /usr/share/mk. Fur-
+ thermore the system include path will be appended to the search
+ path used for "_\bf_\bi_\bl_\be"-style include statements (see the -\b-I\bI
+ option).
+
+ If a file or directory name in the -\b-m\bm argument (or the
+ MAKESYSPATH environment variable) starts with the string ".../"
+ then b\bbm\bma\bak\bke\be will search for the specified file or directory named
+ in the remaining part of the argument string. The search starts
+ with the current directory of the Makefile and then works upward
+ towards the root of the filesystem. If the search is successful,
+ then the resulting directory replaces the ".../" specification in
+ the -\b-m\bm argument. If used, this feature allows b\bbm\bma\bak\bke\be to easily
+ search in the current source tree for customized sys.mk files
+ (e.g., by using ".../mk/sys.mk" as an argument).
+
+ -\b-n\bn Display the commands that would have been executed, but do not
+ actually execute them unless the target depends on the .MAKE spe-
+ cial source (see below).
+
+ -\b-N\bN Display the commands which would have been executed, but do not
+ actually execute any of them; useful for debugging top-level
+ makefiles without descending into subdirectories.
+
+ -\b-q\bq Do not execute any commands, but exit 0 if the specified targets
+ are up-to-date and 1, otherwise.
+
+ -\b-r\br Do not use the built-in rules specified in the system makefile.
+
+ -\b-s\bs Do not echo any commands as they are executed. Equivalent to
+ specifying `@\b@' before each command line in the makefile.
+
+ -\b-T\bT _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
+ When used with the -\b-j\bj flag, append a trace record to _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
+ for each job started and completed.
+
+ -\b-t\bt Rather than re-building a target as specified in the makefile,
+ create it or update its modification time to make it appear up-
+ to-date.
+
+ -\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
+ Print b\bbm\bma\bak\bke\be's idea of the value of _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be, in the global con-
+ text. Do not build any targets. Multiple instances of this
+ option may be specified; the variables will be printed one per
+ line, with a blank line for each null or undefined variable. If
+ _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be contains a `$' then the value will be expanded before
+ printing.
+
+ -\b-W\bW Treat any warnings during makefile parsing as errors.
+
+ -\b-X\bX Don't export variables passed on the command line to the environ-
+ ment individually. Variables passed on the command line are
+ still exported via the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable. This
+ option may be useful on systems which have a small limit on the
+ size of command arguments.
+
+ _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be
+ Set the value of the variable _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to _\bv_\ba_\bl_\bu_\be. Normally, all
+ values passed on the command line are also exported to sub-makes
+ in the environment. The -\b-X\bX flag disables this behavior. Vari-
+ able assignments should follow options for POSIX compatibility
+ but no ordering is enforced.
+
+ There are seven different types of lines in a makefile: file dependency
+ specifications, shell commands, variable assignments, include statements,
+ conditional directives, for loops, and comments.
+
+ In general, lines may be continued from one line to the next by ending
+ them with a backslash (`\'). The trailing newline character and initial
+ whitespace on the following line are compressed into a single space.
+
+F\bFI\bIL\bLE\bE D\bDE\bEP\bPE\bEN\bND\bDE\bEN\bNC\bCY\bY S\bSP\bPE\bEC\bCI\bIF\bFI\bIC\bCA\bAT\bTI\bIO\bON\bNS\bS
+ Dependency lines consist of one or more targets, an operator, and zero or
+ more sources. This creates a relationship where the targets ``depend''
+ on the sources and are usually created from them. The exact relationship
+ between the target and the source is determined by the operator that sep-
+ arates them. The three operators are as follows:
+
+ :\b: A target is considered out-of-date if its modification time is less
+ than those of any of its sources. Sources for a target accumulate
+ over dependency lines when this operator is used. The target is
+ removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ !\b! Targets are always re-created, but not until all sources have been
+ examined and re-created as necessary. Sources for a target accumu-
+ late over dependency lines when this operator is used. The target
+ is removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ :\b::\b: If no sources are specified, the target is always re-created. Oth-
+ erwise, a target is considered out-of-date if any of its sources
+ has been modified more recently than the target. Sources for a
+ target do not accumulate over dependency lines when this operator
+ is used. The target will not be removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ Targets and sources may contain the shell wildcard values `?', `*', `[]',
+ and `{}'. The values `?', `*', and `[]' may only be used as part of the
+ final component of the target or source, and must be used to describe
+ existing files. The value `{}' need not necessarily be used to describe
+ existing files. Expansion is in directory order, not alphabetically as
+ done in the shell.
+
+S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
+ Each target may have associated with it a series of shell commands, nor-
+ mally used to create the target. Each of the commands in this script
+ _\bm_\bu_\bs_\bt be preceded by a tab. While any target may appear on a dependency
+ line, only one of these dependencies may be followed by a creation
+ script, unless the `:\b::\b:' operator is used.
+
+ If the first characters of the command line are any combination of `@\b@',
+ `+\b+', or `-\b-', the command is treated specially. A `@\b@' causes the command
+ not to be echoed before it is executed. A `+\b+' causes the command to be
+ executed even when -\b-n\bn is given. This is similar to the effect of the
+ .MAKE special source, except that the effect can be limited to a single
+ line of a script. A `-\b-' causes any non-zero exit status of the command
+ line to be ignored.
+
+V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bE A\bAS\bSS\bSI\bIG\bGN\bNM\bME\bEN\bNT\bTS\bS
+ Variables in make are much like variables in the shell, and, by tradi-
+ tion, consist of all upper-case letters.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be a\bas\bss\bsi\big\bgn\bnm\bme\ben\bnt\bt m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
+ The five operators that can be used to assign values to variables are as
+ follows:
+
+ =\b= Assign the value to the variable. Any previous value is overrid-
+ den.
+
+ +\b+=\b= Append the value to the current value of the variable.
+
+ ?\b?=\b= Assign the value to the variable if it is not already defined.
+
+ :\b:=\b= Assign with expansion, i.e. expand the value before assigning it
+ to the variable. Normally, expansion is not done until the vari-
+ able is referenced. _\bN_\bO_\bT_\bE: References to undefined variables are
+ _\bn_\bo_\bt expanded. This can cause problems when variable modifiers
+ are used.
+
+ !\b!=\b= Expand the value and pass it to the shell for execution and
+ assign the result to the variable. Any newlines in the result
+ are replaced with spaces.
+
+ Any white-space before the assigned _\bv_\ba_\bl_\bu_\be is removed; if the value is
+ being appended, a single space is inserted between the previous contents
+ of the variable and the appended value.
+
+ Variables are expanded by surrounding the variable name with either curly
+ braces (`{}') or parentheses (`()') and preceding it with a dollar sign
+ (`$'). If the variable name contains only a single letter, the surround-
+ ing braces or parentheses are not required. This shorter form is not
+ recommended.
+
+ If the variable name contains a dollar, then the name itself is expanded
+ first. This allows almost arbitrary variable names, however names con-
+ taining dollar, braces, parenthesis, or whitespace are really best
+ avoided!
+
+ If the result of expanding a variable contains a dollar sign (`$') the
+ string is expanded again.
+
+ Variable substitution occurs at three distinct times, depending on where
+ the variable is being used.
+
+ 1. Variables in dependency lines are expanded as the line is read.
+
+ 2. Variables in shell commands are expanded when the shell command is
+ executed.
+
+ 3. ``.for'' loop index variables are expanded on each loop iteration.
+ Note that other variables are not expanded inside loops so the fol-
+ lowing example code:
+
+
+ .for i in 1 2 3
+ a+= ${i}
+ j= ${i}
+ b+= ${j}
+ .endfor
+
+ all:
+ @echo ${a}
+ @echo ${b}
+
+ will print:
+
+ 1 2 3
+ 3 3 3
+
+ Because while ${a} contains ``1 2 3'' after the loop is executed,
+ ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since
+ after the loop completes ${j} contains ``3''.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be c\bcl\bla\bas\bss\bse\bes\bs
+ The four different classes of variables (in order of increasing prece-
+ dence) are:
+
+ Environment variables
+ Variables defined as part of b\bbm\bma\bak\bke\be's environment.
+
+ Global variables
+ Variables defined in the makefile or in included makefiles.
+
+ Command line variables
+ Variables defined as part of the command line.
+
+ Local variables
+ Variables that are defined specific to a certain target. The
+ seven local variables are as follows:
+
+ _\b._\bA_\bL_\bL_\bS_\bR_\bC The list of all sources for this target; also known as
+ `_\b>'.
+
+ _\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE The name of the archive file.
+
+ _\b._\bI_\bM_\bP_\bS_\bR_\bC In suffix-transformation rules, the name/path of the
+ source from which the target is to be transformed (the
+ ``implied'' source); also known as `_\b<'. It is not
+ defined in explicit rules.
+
+ _\b._\bM_\bE_\bM_\bB_\bE_\bR The name of the archive member.
+
+ _\b._\bO_\bO_\bD_\bA_\bT_\bE The list of sources for this target that were deemed
+ out-of-date; also known as `_\b?'.
+
+ _\b._\bP_\bR_\bE_\bF_\bI_\bX The file prefix of the target, containing only the file
+ portion, no suffix or preceding directory components;
+ also known as `_\b*'.
+
+ _\b._\bT_\bA_\bR_\bG_\bE_\bT The name of the target; also known as `_\b@'.
+
+ The shorter forms `_\b@', `_\b?', `_\b<', `_\b>', and `_\b*' are permitted for
+ backward compatibility with historical makefiles and are not rec-
+ ommended. The six variables `_\b@_\bF', `_\b@_\bD', `_\b<_\bF', `_\b<_\bD', `_\b*_\bF', and
+ `_\b*_\bD' are permitted for compatibility with AT&T System V UNIX
+ makefiles and are not recommended.
+
+ Four of the local variables may be used in sources on dependency
+ lines because they expand to the proper value for each target on
+ the line. These variables are `_\b._\bT_\bA_\bR_\bG_\bE_\bT', `_\b._\bP_\bR_\bE_\bF_\bI_\bX', `_\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE',
+ and `_\b._\bM_\bE_\bM_\bB_\bE_\bR'.
+
+ A\bAd\bdd\bdi\bit\bti\bio\bon\bna\bal\bl b\bbu\bui\bil\blt\bt-\b-i\bin\bn v\bva\bar\bri\bia\bab\bbl\ble\bes\bs
+ In addition, b\bbm\bma\bak\bke\be sets or knows about the following variables:
+
+ _\b$ A single dollar sign `$', i.e. `$$' expands to a single
+ dollar sign.
+
+ _\b._\bA_\bL_\bL_\bT_\bA_\bR_\bG_\bE_\bT_\bS The list of all targets encountered in the Makefile. If
+ evaluated during Makefile parsing, lists only those tar-
+ gets encountered thus far.
+
+ _\b._\bC_\bU_\bR_\bD_\bI_\bR A path to the directory where b\bbm\bma\bak\bke\be was executed. Refer
+ to the description of `PWD' for more details.
+
+ MAKE The name that b\bbm\bma\bak\bke\be was executed with (_\ba_\br_\bg_\bv_\b[_\b0_\b]). For
+ compatibility b\bbm\bma\bak\bke\be also sets _\b._\bM_\bA_\bK_\bE with the same value.
+ The preferred variable to use is the environment variable
+ MAKE because it is more compatible with other versions of
+ b\bbm\bma\bak\bke\be and cannot be confused with the special target with
+ the same name.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bD_\bE_\bP_\bE_\bN_\bD_\bF_\bI_\bL_\bE
+ Names the makefile (default `_\b._\bd_\be_\bp_\be_\bn_\bd') from which gener-
+ ated dependencies are read.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bA_\bN_\bD_\b__\bV_\bA_\bR_\bI_\bA_\bB_\bL_\bE_\bS
+ A boolean that controls the default behavior of the -\b-V\bV
+ option.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD The list of variables exported by b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\bS The argument to the -\b-j\bj option.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX
+ If b\bbm\bma\bak\bke\be is run with _\bj then output for each target is
+ prefixed with a token `--- target ---' the first part of
+ which can be controlled via _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX.
+ For example:
+ .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
+ would produce tokens like `---make[1234] target ---' mak-
+ ing it easier to track the degree of parallelism being
+ achieved.
+
+ MAKEFLAGS The environment variable `MAKEFLAGS' may contain anything
+ that may be specified on b\bbm\bma\bak\bke\be's command line. Anything
+ specified on b\bbm\bma\bak\bke\be's command line is appended to the
+ `MAKEFLAGS' variable which is then entered into the envi-
+ ronment for all programs which b\bbm\bma\bak\bke\be executes.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bL_\bE_\bV_\bE_\bL The recursion depth of b\bbm\bma\bak\bke\be. The initial instance of
+ b\bbm\bma\bak\bke\be will be 0, and an incremented value is put into the
+ environment to be seen by the next generation. This
+ allows tests like: .if ${.MAKE.LEVEL} == 0 to protect
+ things which should only be evaluated in the initial
+ instance of b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\b__\bP_\bR_\bE_\bF_\bE_\bR_\bE_\bN_\bC_\bE
+ The ordered list of makefile names (default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be',
+ `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be') that b\bbm\bma\bak\bke\be will look for.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\bS
+ The list of makefiles read by b\bbm\bma\bak\bke\be, which is useful for
+ tracking dependencies. Each makefile is recorded only
+ once, regardless of the number of times read.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bO_\bD_\bE Processed after reading all makefiles. Can affect the
+ mode that b\bbm\bma\bak\bke\be runs in. It can contain a number of key-
+ words:
+
+ _\bc_\bo_\bm_\bp_\ba_\bt Like -\b-B\bB, puts b\bbm\bma\bak\bke\be into "compat" mode.
+
+ _\bm_\be_\bt_\ba Puts b\bbm\bma\bak\bke\be into "meta" mode, where meta files
+ are created for each target to capture the
+ command run, the output generated and if
+ filemon(4) is available, the system calls
+ which are of interest to b\bbm\bma\bak\bke\be. The captured
+ output can be very useful when diagnosing
+ errors.
+
+ _\bc_\bu_\br_\bd_\bi_\br_\bO_\bk_\b= _\bb_\bf Normally b\bbm\bma\bak\bke\be will not create .meta files
+ in `_\b._\bC_\bU_\bR_\bD_\bI_\bR'. This can be overridden by set-
+ ting _\bb_\bf to a value which represents True.
+
+ _\be_\bn_\bv For debugging, it can be useful to inlcude
+ the environment in the .meta file.
+
+ _\bv_\be_\br_\bb_\bo_\bs_\be If in "meta" mode, print a clue about the
+ target being built. This is useful if the
+ build is otherwise running silently. The
+ message printed the value of:
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bP_\bR_\bE_\bF_\bI_\bX.
+
+ _\bi_\bg_\bn_\bo_\br_\be_\b-_\bc_\bm_\bd Some makefiles have commands which are simply
+ not stable. This keyword causes them to be
+ ignored for determining whether a target is
+ out of date in "meta" mode. See also
+ .\b.N\bNO\bOM\bME\bET\bTA\bA_\b_C\bCM\bMP\bP.
+
+ _\bs_\bi_\bl_\be_\bn_\bt_\b= _\bb_\bf If _\bb_\bf is True, when a .meta file is created,
+ mark the target .\b.S\bSI\bIL\bLE\bEN\bNT\bT.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bB_\bA_\bI_\bL_\bI_\bW_\bI_\bC_\bK
+ In "meta" mode, provides a list of prefixes which match
+ the directories controlled by b\bbm\bma\bak\bke\be. If a file that was
+ generated outside of _\b._\bO_\bB_\bJ_\bD_\bI_\bR but within said bailiwick is
+ missing, the current target is considered out-of-date.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bC_\bR_\bE_\bA_\bT_\bE_\bD
+ In "meta" mode, this variable contains a list of all the
+ meta files updated. If not empty, it can be used to
+ trigger processing of _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bF_\bI_\bL_\bE_\bS.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bF_\bI_\bL_\bE_\bS
+ In "meta" mode, this variable contains a list of all the
+ meta files used (updated or not). This list can be used
+ to process the meta files to extract dependency informa-
+ tion.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bP_\bR_\bE_\bF_\bI_\bX
+ Defines the message printed for each meta file updated in
+ "meta verbose" mode. The default value is:
+ Building ${.TARGET:H:tA}/${.TARGET:T}
+
+ _\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS This variable is used to record the names of variables
+ assigned to on the command line, so that they may be
+ exported as part of `MAKEFLAGS'. This behaviour can be
+ disabled by assigning an empty value to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'
+ within a makefile. Extra variables can be exported from
+ a makefile by appending their names to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'.
+ `MAKEFLAGS' is re-exported whenever `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS' is
+ modified.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bP_\bI_\bD The process-id of b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bP_\bP_\bI_\bD The parent process-id of b\bbm\bma\bak\bke\be.
+
+ _\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR
+ When b\bbm\bma\bak\bke\be stops due to an error, it prints its name and
+ the value of `_\b._\bC_\bU_\bR_\bD_\bI_\bR' as well as the value of any vari-
+ ables named in `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR'.
+
+ _\b._\bn_\be_\bw_\bl_\bi_\bn_\be This variable is simply assigned a newline character as
+ its value. This allows expansions using the :\b:@\b@ modifier
+ to put a newline between iterations of the loop rather
+ than a space. For example, the printing of
+ `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR' could be done as
+ ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
+
+ _\b._\bO_\bB_\bJ_\bD_\bI_\bR A path to the directory where the targets are built. Its
+ value is determined by trying to chdir(2) to the follow-
+ ing directories in order and using the first match:
+
+ 1. ${MAKEOBJDIRPREFIX}${.CURDIR}
+
+ (Only if `MAKEOBJDIRPREFIX' is set in the environ-
+ ment or on the command line.)
+
+ 2. ${MAKEOBJDIR}
+
+ (Only if `MAKEOBJDIR' is set in the environment or
+ on the command line.)
+
+ 3. ${.CURDIR}_\b/_\bo_\bb_\bj_\b.${MACHINE}
+
+ 4. ${.CURDIR}_\b/_\bo_\bb_\bj
+
+ 5. _\b/_\bu_\bs_\br_\b/_\bo_\bb_\bj_\b/${.CURDIR}
+
+ 6. ${.CURDIR}
+
+ Variable expansion is performed on the value before it's
+ used, so expressions such as
+ ${.CURDIR:S,^/usr/src,/var/obj,}
+ may be used. This is especially useful with
+ `MAKEOBJDIR'.
+
+ `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' may be modified in the makefile as a global
+ variable. In all cases, b\bbm\bma\bak\bke\be will chdir(2) to `_\b._\bO_\bB_\bJ_\bD_\bI_\bR'
+ and set `PWD' to that directory before executing any tar-
+ gets.
+
+ _\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR A path to the directory of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being
+ parsed.
+
+ _\b._\bP_\bA_\bR_\bS_\bE_\bF_\bI_\bL_\bE The basename of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being parsed.
+ This variable and `_\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR' are both set only while the
+ `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be_\bs' are being parsed. If you want to retain
+ their current values, assign them to a variable using
+ assignment with expansion: (`:\b:=\b=').
+
+ _\b._\bP_\bA_\bT_\bH A variable that represents the list of directories that
+ b\bbm\bma\bak\bke\be will search for files. The search list should be
+ updated using the target `_\b._\bP_\bA_\bT_\bH' rather than the vari-
+ able.
+
+ PWD Alternate path to the current directory. b\bbm\bma\bak\bke\be normally
+ sets `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the canonical path given by getcwd(3).
+ However, if the environment variable `PWD' is set and
+ gives a path to the current directory, then b\bbm\bma\bak\bke\be sets
+ `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the value of `PWD' instead. This behaviour
+ is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR'
+ contains a variable transform. `PWD' is set to the value
+ of `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' for all programs which b\bbm\bma\bak\bke\be executes.
+
+ .TARGETS The list of targets explicitly specified on the command
+ line, if any.
+
+ VPATH Colon-separated (``:'') lists of directories that b\bbm\bma\bak\bke\be
+ will search for files. The variable is supported for
+ compatibility with old make programs only, use `_\b._\bP_\bA_\bT_\bH'
+ instead.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
+ Variable expansion may be modified to select or modify each word of the
+ variable (where a ``word'' is white-space delimited sequence of charac-
+ ters). The general format of a variable expansion is as follows:
+
+ ${variable[:modifier[:...]]}
+
+ Each modifier begins with a colon, which may be escaped with a backslash
+ (`\').
+
+ A set of modifiers can be specified via a variable, as follows:
+
+ modifier_variable=modifier[:...]
+ ${variable:${modifier_variable}[:...]}
+
+ In this case the first modifier in the modifier_variable does not start
+ with a colon, since that must appear in the referencing variable. If any
+ of the modifiers in the modifier_variable contain a dollar sign (`$'),
+ these must be doubled to avoid early expansion.
+
+ The supported modifiers are:
+
+ :\b:E\bE Replaces each word in the variable with its suffix.
+
+ :\b:H\bH Replaces each word in the variable with everything but the last com-
+ ponent.
+
+ :\b:M\bM_\bp_\ba_\bt_\bt_\be_\br_\bn
+ Select only those words that match _\bp_\ba_\bt_\bt_\be_\br_\bn. The standard shell
+ wildcard characters (`*', `?', and `[]') may be used. The wildcard
+ characters may be escaped with a backslash (`\').
+
+ :\b:N\bN_\bp_\ba_\bt_\bt_\be_\br_\bn
+ This is identical to `:\b:M\bM', but selects all words which do not match
+ _\bp_\ba_\bt_\bt_\be_\br_\bn.
+
+ :\b:O\bO Order every word in variable alphabetically. To sort words in
+ reverse order use the `:\b:O\bO:\b:[\b[-\b-1\b1.\b..\b.1\b1]\b]' combination of modifiers.
+
+ :\b:O\bOx\bx Randomize words in variable. The results will be different each
+ time you are referring to the modified variable; use the assignment
+ with expansion (`:\b:=\b=') to prevent such behaviour. For example,
+
+ LIST= uno due tre quattro
+ RANDOM_LIST= ${LIST:Ox}
+ STATIC_RANDOM_LIST:= ${LIST:Ox}
+
+ all:
+ @echo "${RANDOM_LIST}"
+ @echo "${RANDOM_LIST}"
+ @echo "${STATIC_RANDOM_LIST}"
+ @echo "${STATIC_RANDOM_LIST}"
+ may produce output similar to:
+
+ quattro due tre uno
+ tre due quattro uno
+ due uno quattro tre
+ due uno quattro tre
+
+ :\b:Q\bQ Quotes every shell meta-character in the variable, so that it can be
+ passed safely through recursive invocations of b\bbm\bma\bak\bke\be.
+
+ :\b:R\bR Replaces each word in the variable with everything but its suffix.
+
+ :\b:g\bgm\bmt\bti\bim\bme\be
+ The value is a format string for strftime(3), using the current
+ gmtime(3).
+
+ :\b:h\bha\bas\bsh\bh
+ Compute a 32bit hash of the value and encode it as hex digits.
+
+ :\b:l\blo\boc\bca\bal\blt\bti\bim\bme\be
+ The value is a format string for strftime(3), using the current
+ localtime(3).
+
+ :\b:t\btA\bA Attempt to convert variable to an absolute path using realpath(3),
+ if that fails, the value is unchanged.
+
+ :\b:t\btl\bl Converts variable to lower-case letters.
+
+ :\b:t\bts\bs_\bc
+ Words in the variable are normally separated by a space on expan-
+ sion. This modifier sets the separator to the character _\bc. If _\bc is
+ omitted, then no separator is used. The common escapes (including
+ octal numeric codes), work as expected.
+
+ :\b:t\btu\bu Converts variable to upper-case letters.
+
+ :\b:t\btW\bW Causes the value to be treated as a single word (possibly containing
+ embedded white space). See also `:\b:[\b[*\b*]\b]'.
+
+ :\b:t\btw\bw Causes the value to be treated as a sequence of words delimited by
+ white space. See also `:\b:[\b[@\b@]\b]'.
+
+ :\b:S\bS/_\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg/_\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg/[1\b1g\bgW\bW]
+ Modify the first occurrence of _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg in the variable's value,
+ replacing it with _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg. If a `g' is appended to the last
+ slash of the pattern, all occurrences in each word are replaced. If
+ a `1' is appended to the last slash of the pattern, only the first
+ word is affected. If a `W' is appended to the last slash of the
+ pattern, then the value is treated as a single word (possibly con-
+ taining embedded white space). If _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg begins with a caret
+ (`^'), _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg is anchored at the beginning of each word. If
+ _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg ends with a dollar sign (`$'), it is anchored at the end
+ of each word. Inside _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg, an ampersand (`&') is replaced by
+ _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg (without any `^' or `$'). Any character may be used as a
+ delimiter for the parts of the modifier string. The anchoring,
+ ampersand and delimiter characters may be escaped with a backslash
+ (`\').
+
+ Variable expansion occurs in the normal fashion inside both
+ _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg and _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg with the single exception that a backslash
+ is used to prevent the expansion of a dollar sign (`$'), not a pre-
+ ceding dollar sign as is usual.
+
+ :\b:C\bC/_\bp_\ba_\bt_\bt_\be_\br_\bn/_\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt/[1\b1g\bgW\bW]
+ The :\b:C\bC modifier is just like the :\b:S\bS modifier except that the old and
+ new strings, instead of being simple strings, are a regular expres-
+ sion (see regex(3)) string _\bp_\ba_\bt_\bt_\be_\br_\bn and an ed(1)-style string
+ _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt. Normally, the first occurrence of the pattern _\bp_\ba_\bt_\bt_\be_\br_\bn
+ in each word of the value is substituted with _\br_\be_\bp_\bl_\ba_\bc_\be_\bm_\be_\bn_\bt. The `1'
+ modifier causes the substitution to apply to at most one word; the
+ `g' modifier causes the substitution to apply to as many instances
+ of the search pattern _\bp_\ba_\bt_\bt_\be_\br_\bn as occur in the word or words it is
+ found in; the `W' modifier causes the value to be treated as a sin-
+ gle word (possibly containing embedded white space). Note that `1'
+ and `g' are orthogonal; the former specifies whether multiple words
+ are potentially affected, the latter whether multiple substitutions
+ can potentially occur within each affected word.
+
+ :\b:T\bT Replaces each word in the variable with its last component.
+
+ :\b:u\bu Remove adjacent duplicate words (like uniq(1)).
+
+ :\b:?\b?_\bt_\br_\bu_\be_\b__\bs_\bt_\br_\bi_\bn_\bg:\b:_\bf_\ba_\bl_\bs_\be_\b__\bs_\bt_\br_\bi_\bn_\bg
+ If the variable name (not its value), when parsed as a .if condi-
+ tional expression, evaluates to true, return as its value the
+ _\bt_\br_\bu_\be_\b__\bs_\bt_\br_\bi_\bn_\bg, otherwise return the _\bf_\ba_\bl_\bs_\be_\b__\bs_\bt_\br_\bi_\bn_\bg. Since the variable
+ name is used as the expression, :? must be the first modifier after
+ the variable name itself - which will, of course, usually contain
+ variable expansions. A common error is trying to use expressions
+ like
+ ${NUMBERS:M42:?match:no}
+ which actually tests defined(NUMBERS), to determine is any words
+ match "42" you need to use something like:
+ ${"${NUMBERS:M42}" != "":?match:no}.
+
+ _\b:_\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg_\b=_\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg
+ This is the AT&T System V UNIX style variable substitution. It must
+ be the last modifier specified. If _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg or _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg do not
+ contain the pattern matching character _\b% then it is assumed that
+ they are anchored at the end of each word, so only suffixes or
+ entire words may be replaced. Otherwise _\b% is the substring of
+ _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg to be replaced in _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg.
+
+ Variable expansion occurs in the normal fashion inside both
+ _\bo_\bl_\bd_\b__\bs_\bt_\br_\bi_\bn_\bg and _\bn_\be_\bw_\b__\bs_\bt_\br_\bi_\bn_\bg with the single exception that a backslash
+ is used to prevent the expansion of a dollar sign (`$'), not a pre-
+ ceding dollar sign as is usual.
+
+ :\b:@\b@_\bt_\be_\bm_\bp@\b@_\bs_\bt_\br_\bi_\bn_\bg@\b@
+ This is the loop expansion mechanism from the OSF Development Envi-
+ ronment (ODE) make. Unlike .\b.f\bfo\bor\br loops expansion occurs at the time
+ of reference. Assign _\bt_\be_\bm_\bp to each word in the variable and evaluate
+ _\bs_\bt_\br_\bi_\bn_\bg. The ODE convention is that _\bt_\be_\bm_\bp should start and end with a
+ period. For example.
+ ${LINKS:@.LINK.@${LN} ${TARGET} ${.LINK.}@}
+
+ However a single character varaiable is often more readable:
+ ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}
+
+ :\b:U\bU_\bn_\be_\bw_\bv_\ba_\bl
+ If the variable is undefined _\bn_\be_\bw_\bv_\ba_\bl is the value. If the variable
+ is defined, the existing value is returned. This is another ODE
+ make feature. It is handy for setting per-target CFLAGS for
+ instance:
+ ${_${.TARGET:T}_CFLAGS:U${DEF_CFLAGS}}
+ If a value is only required if the variable is undefined, use:
+ ${VAR:D:Unewval}
+
+ :\b:D\bD_\bn_\be_\bw_\bv_\ba_\bl
+ If the variable is defined _\bn_\be_\bw_\bv_\ba_\bl is the value.
+
+ :\b:L\bL The name of the variable is the value.
+
+ :\b:P\bP The path of the node which has the same name as the variable is the
+ value. If no such node exists or its path is null, then the name of
+ the variable is used. In order for this modifier to work, the name
+ (node) must at least have appeared on the rhs of a dependency.
+
+ :\b:!\b!_\bc_\bm_\bd!\b!
+ The output of running _\bc_\bm_\bd is the value.
+
+ :\b:s\bsh\bh If the variable is non-empty it is run as a command and the output
+ becomes the new value.
+
+ :\b::\b:=\b=_\bs_\bt_\br
+ The variable is assigned the value _\bs_\bt_\br after substitution. This
+ modifier and its variations are useful in obscure situations such as
+ wanting to set a variable when shell commands are being parsed.
+ These assignment modifiers always expand to nothing, so if appearing
+ in a rule line by themselves should be preceded with something to
+ keep b\bbm\bma\bak\bke\be happy.
+
+ The `:\b::\b:' helps avoid false matches with the AT&T System V UNIX style
+ :\b:=\b= modifier and since substitution always occurs the :\b::\b:=\b= form is
+ vaguely appropriate.
+
+ :\b::\b:?\b?=\b=_\bs_\bt_\br
+ As for :\b::\b:=\b= but only if the variable does not already have a value.
+
+ :\b::\b:+\b+=\b=_\bs_\bt_\br
+ Append _\bs_\bt_\br to the variable.
+
+ :\b::\b:!\b!=\b=_\bc_\bm_\bd
+ Assign the output of _\bc_\bm_\bd to the variable.
+
+ :\b:[\b[_\br_\ba_\bn_\bg_\be]\b]
+ Selects one or more words from the value, or performs other opera-
+ tions related to the way in which the value is divided into words.
+
+ Ordinarily, a value is treated as a sequence of words delimited by
+ white space. Some modifiers suppress this behaviour, causing a
+ value to be treated as a single word (possibly containing embedded
+ white space). An empty value, or a value that consists entirely of
+ white-space, is treated as a single word. For the purposes of the
+ `:\b:[\b[]\b]' modifier, the words are indexed both forwards using positive
+ integers (where index 1 represents the first word), and backwards
+ using negative integers (where index -1 represents the last word).
+
+ The _\br_\ba_\bn_\bg_\be is subjected to variable expansion, and the expanded
+ result is then interpreted as follows:
+
+ _\bi_\bn_\bd_\be_\bx Selects a single word from the value.
+
+ _\bs_\bt_\ba_\br_\bt.\b..\b._\be_\bn_\bd
+ Selects all words from _\bs_\bt_\ba_\br_\bt to _\be_\bn_\bd, inclusive. For example,
+ `:\b:[\b[2\b2.\b..\b.-\b-1\b1]\b]' selects all words from the second word to the last
+ word. If _\bs_\bt_\ba_\br_\bt is greater than _\be_\bn_\bd, then the words are out-
+ put in reverse order. For example, `:\b:[\b[-\b-1\b1.\b..\b.1\b1]\b]' selects all
+ the words from last to first.
+
+ *\b* Causes subsequent modifiers to treat the value as a single
+ word (possibly containing embedded white space). Analogous
+ to the effect of "$*" in Bourne shell.
+
+ 0 Means the same as `:\b:[\b[*\b*]\b]'.
+
+ @\b@ Causes subsequent modifiers to treat the value as a sequence
+ of words delimited by white space. Analogous to the effect
+ of "$@" in Bourne shell.
+
+ #\b# Returns the number of words in the value.
+
+I\bIN\bNC\bCL\bLU\bUD\bDE\bE S\bST\bTA\bAT\bTE\bEM\bME\bEN\bNT\bTS\bS,\b, C\bCO\bON\bND\bDI\bIT\bTI\bIO\bON\bNA\bAL\bLS\bS A\bAN\bND\bD F\bFO\bOR\bR L\bLO\bOO\bOP\bPS\bS
+ Makefile inclusion, conditional structures and for loops reminiscent of
+ the C programming language are provided in b\bbm\bma\bak\bke\be. All such structures
+ are identified by a line beginning with a single dot (`.') character.
+ Files are included with either .\b.i\bin\bnc\bcl\blu\bud\bde\be <_\bf_\bi_\bl_\be> or .\b.i\bin\bnc\bcl\blu\bud\bde\be "_\bf_\bi_\bl_\be". Vari-
+ ables between the angle brackets or double quotes are expanded to form
+ the file name. If angle brackets are used, the included makefile is
+ expected to be in the system makefile directory. If double quotes are
+ used, the including makefile's directory and any directories specified
+ using the -\b-I\bI option are searched before the system makefile directory.
+ For compatibility with other versions of b\bbm\bma\bak\bke\be `include file ...' is also
+ accepted. If the include statement is written as .\b.-\b-i\bin\bnc\bcl\blu\bud\bde\be or as
+ .\b.s\bsi\bin\bnc\bcl\blu\bud\bde\be then errors locating and/or opening include files are ignored.
+
+ Conditional expressions are also preceded by a single dot as the first
+ character of a line. The possible conditionals are as follows:
+
+ .\b.e\ber\brr\bro\bor\br _\bm_\be_\bs_\bs_\ba_\bg_\be
+ The message is printed along with the name of the makefile and
+ line number, then b\bbm\bma\bak\bke\be will exit.
+
+ .\b.e\bex\bxp\bpo\bor\brt\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
+ Export the specified global variable. If no variable list is
+ provided, all globals are exported except for internal variables
+ (those that start with `.'). This is not affected by the -\b-X\bX
+ flag, so should be used with caution. For compatibility with
+ other b\bbm\bma\bak\bke\be programs `export variable=value' is also accepted.
+
+ Appending a variable name to _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD is equivalent to
+ exporting a variable.
+
+ .\b.e\bex\bxp\bpo\bor\brt\bt-\b-e\ben\bnv\bv _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
+ The same as `.export', except that the variable is not appended
+ to _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD. This allows exporting a value to the environ-
+ ment which is different from that used by b\bbm\bma\bak\bke\be internally.
+
+ .\b.i\bin\bnf\bfo\bo _\bm_\be_\bs_\bs_\ba_\bg_\be
+ The message is printed along with the name of the makefile and
+ line number.
+
+ .\b.u\bun\bnd\bde\bef\bf _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
+ Un-define the specified global variable. Only global variables
+ may be un-defined.
+
+ .\b.u\bun\bne\bex\bxp\bpo\bor\brt\bt _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.
+ The opposite of `.export'. The specified global _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be will be
+ removed from _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD. If no variable list is provided,
+ all globals are unexported, and _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD deleted.
+
+ .\b.u\bun\bne\bex\bxp\bpo\bor\brt\bt-\b-e\ben\bnv\bv
+ Unexport all globals previously exported and clear the environ-
+ ment inherited from the parent. This operation will cause a mem-
+ ory leak of the original environment, so should be used spar-
+ ingly. Testing for _\b._\bM_\bA_\bK_\bE_\b._\bL_\bE_\bV_\bE_\bL being 0, would make sense. Also
+ note that any variables which originated in the parent environ-
+ ment should be explicitly preserved if desired. For example:
+
+ .if ${.MAKE.LEVEL} == 0
+ PATH := ${PATH}
+ .unexport-env
+ .export PATH
+ .endif
+
+ Would result in an environment containing only `PATH', which is
+ the minimal useful environment. Actually `.MAKE.LEVEL' will also
+ be pushed into the new environment.
+
+ .\b.w\bwa\bar\brn\bni\bin\bng\bg _\bm_\be_\bs_\bs_\ba_\bg_\be
+ The message prefixed by `_\bw_\ba_\br_\bn_\bi_\bn_\bg_\b:' is printed along with the name
+ of the makefile and line number.
+
+ .\b.i\bif\bf [!]_\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn _\b._\b._\b.]
+ Test the value of an expression.
+
+ .\b.i\bif\bfd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
+ Test the value of a variable.
+
+ .\b.i\bif\bfn\bnd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
+ Test the value of a variable.
+
+ .\b.i\bif\bfm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+ Test the target being built.
+
+ .\b.i\bif\bfn\bnm\bma\bak\bke\be [!] _\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+ Test the target being built.
+
+ .\b.e\bel\bls\bse\be Reverse the sense of the last conditional.
+
+ .\b.e\bel\bli\bif\bf [!] _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn _\b._\b._\b.]
+ A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bf'.
+
+ .\b.e\bel\bli\bif\bfd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
+ A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfd\bde\bef\bf'.
+
+ .\b.e\bel\bli\bif\bfn\bnd\bde\bef\bf [!]_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.]
+ A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfn\bnd\bde\bef\bf'.
+
+ .\b.e\bel\bli\bif\bfm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+ A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfm\bma\bak\bke\be'.
+
+ .\b.e\bel\bli\bif\bfn\bnm\bma\bak\bke\be [!]_\bt_\ba_\br_\bg_\be_\bt [_\bo_\bp_\be_\br_\ba_\bt_\bo_\br _\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+ A combination of `.\b.e\bel\bls\bse\be' followed by `.\b.i\bif\bfn\bnm\bma\bak\bke\be'.
+
+ .\b.e\ben\bnd\bdi\bif\bf End the body of the conditional.
+
+ The _\bo_\bp_\be_\br_\ba_\bt_\bo_\br may be any one of the following:
+
+ |\b||\b| Logical OR.
+
+ &\b&&\b& Logical AND; of higher precedence than ``||''.
+
+ As in C, b\bbm\bma\bak\bke\be will only evaluate a conditional as far as is necessary to
+ determine its value. Parentheses may be used to change the order of
+ evaluation. The boolean operator `!\b!' may be used to logically negate an
+ entire conditional. It is of higher precedence than `&\b&&\b&'.
+
+ The value of _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn may be any of the following:
+
+ d\bde\bef\bfi\bin\bne\bed\bd Takes a variable name as an argument and evaluates to true if
+ the variable has been defined.
+
+ m\bma\bak\bke\be Takes a target name as an argument and evaluates to true if the
+ target was specified as part of b\bbm\bma\bak\bke\be's command line or was
+ declared the default target (either implicitly or explicitly,
+ see _\b._\bM_\bA_\bI_\bN) before the line containing the conditional.
+
+ e\bem\bmp\bpt\bty\by Takes a variable, with possible modifiers, and evaluates to true
+ if the expansion of the variable would result in an empty
+ string.
+
+ e\bex\bxi\bis\bst\bts\bs Takes a file name as an argument and evaluates to true if the
+ file exists. The file is searched for on the system search path
+ (see _\b._\bP_\bA_\bT_\bH).
+
+ t\bta\bar\brg\bge\bet\bt Takes a target name as an argument and evaluates to true if the
+ target has been defined.
+
+ c\bco\bom\bmm\bma\ban\bnd\bds\bs
+ Takes a target name as an argument and evaluates to true if the
+ target has been defined and has commands associated with it.
+
+ _\bE_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn may also be an arithmetic or string comparison. Variable
+ expansion is performed on both sides of the comparison, after which the
+ integral values are compared. A value is interpreted as hexadecimal if
+ it is preceded by 0x, otherwise it is decimal; octal numbers are not sup-
+ ported. The standard C relational operators are all supported. If after
+ variable expansion, either the left or right hand side of a `=\b==\b=' or `!\b!=\b='
+ operator is not an integral value, then string comparison is performed
+ between the expanded variables. If no relational operator is given, it
+ is assumed that the expanded variable is being compared against 0 or an
+ empty string in the case of a string comparison.
+
+ When b\bbm\bma\bak\bke\be is evaluating one of these conditional expressions, and it
+ encounters a (white-space separated) word it doesn't recognize, either
+ the ``make'' or ``defined'' expression is applied to it, depending on the
+ form of the conditional. If the form is `.\b.i\bif\bfd\bde\bef\bf', `.\b.i\bif\bfn\bnd\bde\bef\bf', or `.\b.i\bif\bf'
+ the ``defined'' expression is applied. Similarly, if the form is
+ `.\b.i\bif\bfm\bma\bak\bke\be' or `.\b.i\bif\bfn\bnm\bma\bak\bke\be, t\bth\bhe\be' ``make'' expression is applied.
+
+ If the conditional evaluates to true the parsing of the makefile contin-
+ ues as before. If it evaluates to false, the following lines are
+ skipped. In both cases this continues until a `.\b.e\bel\bls\bse\be' or `.\b.e\ben\bnd\bdi\bif\bf' is
+ found.
+
+ For loops are typically used to apply a set of rules to a list of files.
+ The syntax of a for loop is:
+
+ .\b.f\bfo\bor\br _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be [_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be _\b._\b._\b.] i\bin\bn _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn
+ <make-rules>
+ .\b.e\ben\bnd\bdf\bfo\bor\br
+
+ After the for e\bex\bxp\bpr\bre\bes\bss\bsi\bio\bon\bn is evaluated, it is split into words. On each
+ iteration of the loop, one word is taken and assigned to each v\bva\bar\bri\bia\bab\bbl\ble\be,
+ in order, and these v\bva\bar\bri\bia\bab\bbl\ble\bes\bs are substituted into the m\bma\bak\bke\be-\b-r\bru\bul\ble\bes\bs inside
+ the body of the for loop. The number of words must come out even; that
+ is, if there are three iteration variables, the number of words provided
+ must be a multiple of three.
+
+C\bCO\bOM\bMM\bME\bEN\bNT\bTS\bS
+ Comments begin with a hash (`#') character, anywhere but in a shell com-
+ mand line, and continue to the end of an unescaped new line.
+
+S\bSP\bPE\bEC\bCI\bIA\bAL\bL S\bSO\bOU\bUR\bRC\bCE\bES\bS (\b(A\bAT\bTT\bTR\bRI\bIB\bBU\bUT\bTE\bES\bS)\b)
+ .\b.E\bEX\bXE\bEC\bC Target is never out of date, but always execute commands any-
+ way.
+
+ .\b.I\bIG\bGN\bNO\bOR\bRE\bE Ignore any errors from the commands associated with this tar-
+ get, exactly as if they all were preceded by a dash (`-').
+
+ .\b.M\bMA\bAD\bDE\bE Mark all sources of this target as being up-to-date.
+
+ .\b.M\bMA\bAK\bKE\bE Execute the commands associated with this target even if the -\b-n\bn
+ or -\b-t\bt options were specified. Normally used to mark recursive
+ b\bbm\bma\bak\bke\be's.
+
+ .\b.M\bME\bET\bTA\bA Create a meta file for the target, even if it is flagged as
+ .\b.P\bPH\bHO\bON\bNY\bY, .\b.M\bMA\bAK\bKE\bE, or .\b.S\bSP\bPE\bEC\bCI\bIA\bAL\bL. Usage in conjunction with .\b.M\bMA\bAK\bKE\bE is
+ the most likely case. In "meta" mode, the target is out-of-
+ date if the meta file is missing.
+
+ .\b.N\bNO\bOM\bME\bET\bTA\bA Do not create a meta file for the target. Meta files are also
+ not created for .\b.P\bPH\bHO\bON\bNY\bY, .\b.M\bMA\bAK\bKE\bE, or .\b.S\bSP\bPE\bEC\bCI\bIA\bAL\bL targets.
+
+ .\b.N\bNO\bOM\bME\bET\bTA\bA_\b_C\bCM\bMP\bP
+ Ignore differences in commands when deciding if target is out
+ of date. This is useful if the command contains a value which
+ always changes. If the number of commands change, though, the
+ target will still be out of date.
+
+ .\b.N\bNO\bOP\bPA\bAT\bTH\bH Do not search for the target in the directories specified by
+ .\b.P\bPA\bAT\bTH\bH.
+
+ .\b.N\bNO\bOT\bTM\bMA\bAI\bIN\bN Normally b\bbm\bma\bak\bke\be selects the first target it encounters as the
+ default target to be built if no target was specified. This
+ source prevents this target from being selected.
+
+ .\b.O\bOP\bPT\bTI\bIO\bON\bNA\bAL\bL
+ If a target is marked with this attribute and b\bbm\bma\bak\bke\be can't fig-
+ ure out how to create it, it will ignore this fact and assume
+ the file isn't needed or already exists.
+
+ .\b.P\bPH\bHO\bON\bNY\bY The target does not correspond to an actual file; it is always
+ considered to be out of date, and will not be created with the
+ -\b-t\bt option. Suffix-transformation rules are not applied to
+ .\b.P\bPH\bHO\bON\bNY\bY targets.
+
+ .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS
+ When b\bbm\bma\bak\bke\be is interrupted, it normally removes any partially
+ made targets. This source prevents the target from being
+ removed.
+
+ .\b.R\bRE\bEC\bCU\bUR\bRS\bSI\bIV\bVE\bE
+ Synonym for .\b.M\bMA\bAK\bKE\bE.
+
+ .\b.S\bSI\bIL\bLE\bEN\bNT\bT Do not echo any of the commands associated with this target,
+ exactly as if they all were preceded by an at sign (`@').
+
+ .\b.U\bUS\bSE\bE Turn the target into b\bbm\bma\bak\bke\be's version of a macro. When the tar-
+ get is used as a source for another target, the other target
+ acquires the commands, sources, and attributes (except for
+ .\b.U\bUS\bSE\bE) of the source. If the target already has commands, the
+ .\b.U\bUS\bSE\bE target's commands are appended to them.
+
+ .\b.U\bUS\bSE\bEB\bBE\bEF\bFO\bOR\bRE\bE
+ Exactly like .\b.U\bUS\bSE\bE, but prepend the .\b.U\bUS\bSE\bEB\bBE\bEF\bFO\bOR\bRE\bE target commands
+ to the target.
+
+ .\b.W\bWA\bAI\bIT\bT If .\b.W\bWA\bAI\bIT\bT appears in a dependency line, the sources that precede
+ it are made before the sources that succeed it in the line.
+ Since the dependents of files are not made until the file
+ itself could be made, this also stops the dependents being
+ built unless they are needed for another branch of the depen-
+ dency tree. So given:
+
+ x: a .WAIT b
+ echo x
+ a:
+ echo a
+ b: b1
+ echo b
+ b1:
+ echo b1
+
+ the output is always `a', `b1', `b', `x'.
+ The ordering imposed by .\b.W\bWA\bAI\bIT\bT is only relevant for parallel
+ makes.
+
+S\bSP\bPE\bEC\bCI\bIA\bAL\bL T\bTA\bAR\bRG\bGE\bET\bTS\bS
+ Special targets may not be included with other targets, i.e. they must be
+ the only target specified.
+
+ .\b.B\bBE\bEG\bGI\bIN\bN Any command lines attached to this target are executed before
+ anything else is done.
+
+ .\b.D\bDE\bEF\bFA\bAU\bUL\bLT\bT
+ This is sort of a .\b.U\bUS\bSE\bE rule for any target (that was used only
+ as a source) that b\bbm\bma\bak\bke\be can't figure out any other way to cre-
+ ate. Only the shell script is used. The .\b.I\bIM\bMP\bPS\bSR\bRC\bC variable of a
+ target that inherits .\b.D\bDE\bEF\bFA\bAU\bUL\bLT\bT's commands is set to the target's
+ own name.
+
+ .\b.E\bEN\bND\bD Any command lines attached to this target are executed after
+ everything else is done.
+
+ .\b.E\bER\bRR\bRO\bOR\bR Any command lines attached to this target are executed when
+ another target fails. The .\b.E\bER\bRR\bRO\bOR\bR_\b_T\bTA\bAR\bRG\bGE\bET\bT variable is set to the
+ target that failed. See also M\bMA\bAK\bKE\bE_\b_P\bPR\bRI\bIN\bNT\bT_\b_V\bVA\bAR\bR_\b_O\bON\bN_\b_E\bER\bRR\bRO\bOR\bR.
+
+ .\b.I\bIG\bGN\bNO\bOR\bRE\bE Mark each of the sources with the .\b.I\bIG\bGN\bNO\bOR\bRE\bE attribute. If no
+ sources are specified, this is the equivalent of specifying the
+ -\b-i\bi option.
+
+ .\b.I\bIN\bNT\bTE\bER\bRR\bRU\bUP\bPT\bT
+ If b\bbm\bma\bak\bke\be is interrupted, the commands for this target will be
+ executed.
+
+ .\b.M\bMA\bAI\bIN\bN If no target is specified when b\bbm\bma\bak\bke\be is invoked, this target
+ will be built.
+
+ .\b.M\bMA\bAK\bKE\bEF\bFL\bLA\bAG\bGS\bS
+ This target provides a way to specify flags for b\bbm\bma\bak\bke\be when the
+ makefile is used. The flags are as if typed to the shell,
+ though the -\b-f\bf option will have no effect.
+
+ .\b.N\bNO\bOP\bPA\bAT\bTH\bH Apply the .\b.N\bNO\bOP\bPA\bAT\bTH\bH attribute to any specified sources.
+
+ .\b.N\bNO\bOT\bTP\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL
+ Disable parallel mode.
+
+ .\b.N\bNO\bO_\b_P\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL
+ Synonym for .\b.N\bNO\bOT\bTP\bPA\bAR\bRA\bAL\bLL\bLE\bEL\bL, for compatibility with other pmake
+ variants.
+
+ .\b.O\bOR\bRD\bDE\bER\bR The named targets are made in sequence. This ordering does not
+ add targets to the list of targets to be made. Since the depen-
+ dents of a target do not get built until the target itself could
+ be built, unless `a' is built by another part of the dependency
+ graph, the following is a dependency loop:
+
+ .ORDER: b a
+ b: a
+
+ The ordering imposed by .\b.O\bOR\bRD\bDE\bER\bR is only relevant for parallel
+ makes.
+
+ .\b.P\bPA\bAT\bTH\bH The sources are directories which are to be searched for files
+ not found in the current directory. If no sources are speci-
+ fied, any previously specified directories are deleted. If the
+ source is the special .\b.D\bDO\bOT\bTL\bLA\bAS\bST\bT target, then the current working
+ directory is searched last.
+
+ .\b.P\bPH\bHO\bON\bNY\bY Apply the .\b.P\bPH\bHO\bON\bNY\bY attribute to any specified sources.
+
+ .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS
+ Apply the .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS attribute to any specified sources. If no
+ sources are specified, the .\b.P\bPR\bRE\bEC\bCI\bIO\bOU\bUS\bS attribute is applied to
+ every target in the file.
+
+ .\b.S\bSH\bHE\bEL\bLL\bL Sets the shell that b\bbm\bma\bak\bke\be will use to execute commands. The
+ sources are a set of _\bf_\bi_\be_\bl_\bd_\b=_\bv_\ba_\bl_\bu_\be pairs.
+
+ _\bn_\ba_\bm_\be This is the minimal specification, used to select
+ one of the builtin shell specs; _\bs_\bh, _\bk_\bs_\bh, and _\bc_\bs_\bh.
+
+ _\bp_\ba_\bt_\bh Specifies the path to the shell.
+
+ _\bh_\ba_\bs_\bE_\br_\br_\bC_\bt_\bl Indicates whether the shell supports exit on error.
+
+ _\bc_\bh_\be_\bc_\bk The command to turn on error checking.
+
+ _\bi_\bg_\bn_\bo_\br_\be The command to disable error checking.
+
+ _\be_\bc_\bh_\bo The command to turn on echoing of commands executed.
+
+ _\bq_\bu_\bi_\be_\bt The command to turn off echoing of commands exe-
+ cuted.
+
+ _\bf_\bi_\bl_\bt_\be_\br The output to filter after issuing the _\bq_\bu_\bi_\be_\bt com-
+ mand. It is typically identical to _\bq_\bu_\bi_\be_\bt.
+
+ _\be_\br_\br_\bF_\bl_\ba_\bg The flag to pass the shell to enable error checking.
+
+ _\be_\bc_\bh_\bo_\bF_\bl_\ba_\bg The flag to pass the shell to enable command echo-
+ ing.
+
+ _\bn_\be_\bw_\bl_\bi_\bn_\be The string literal to pass the shell that results in
+ a single newline character when used outside of any
+ quoting characters.
+ Example:
+
+ .SHELL: name=ksh path=/bin/ksh hasErrCtl=true \
+ check="set -e" ignore="set +e" \
+ echo="set -v" quiet="set +v" filter="set +v" \
+ echoFlag=v errFlag=e newline="'\n'"
+
+ .\b.S\bSI\bIL\bLE\bEN\bNT\bT Apply the .\b.S\bSI\bIL\bLE\bEN\bNT\bT attribute to any specified sources. If no
+ sources are specified, the .\b.S\bSI\bIL\bLE\bEN\bNT\bT attribute is applied to every
+ command in the file.
+
+ .\b.S\bSU\bUF\bFF\bFI\bIX\bXE\bES\bS
+ Each source specifies a suffix to b\bbm\bma\bak\bke\be. If no sources are
+ specified, any previously specified suffixes are deleted. It
+ allows the creation of suffix-transformation rules.
+
+ Example:
+
+ .SUFFIXES: .o
+ .c.o:
+ cc -o ${.TARGET} -c ${.IMPSRC}
+
+E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
+ b\bbm\bma\bak\bke\be uses the following environment variables, if they exist: MACHINE,
+ MACHINE_ARCH, MAKE, MAKEFLAGS, MAKEOBJDIR, MAKEOBJDIRPREFIX, MAKESYSPATH,
+ PWD, and TMPDIR.
+
+ MAKEOBJDIRPREFIX and MAKEOBJDIR may only be set in the environment or on
+ the command line to b\bbm\bma\bak\bke\be and not as makefile variables; see the descrip-
+ tion of `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' for more details.
+
+F\bFI\bIL\bLE\bES\bS
+ .depend list of dependencies
+ Makefile list of dependencies
+ makefile list of dependencies
+ sys.mk system makefile
+ /usr/share/mk system makefile directory
+
+C\bCO\bOM\bMP\bPA\bAT\bTI\bIB\bBI\bIL\bLI\bIT\bTY\bY
+ The basic make syntax is compatible between different versions of make,
+ however the special variables, variable modifiers and conditionals are
+ not.
+
+ The way that parallel makes are scheduled changed in NetBSD 4.0 so that
+ .ORDER and .WAIT apply recursively to the dependent nodes. The algo-
+ rithms used may change again in the future.
+
+ The way that .for loop variables are substituted changed after NetBSD 5.0
+ so that they still appear to be variable expansions. In particular this
+ stops them being treated as syntax, and removes some obscure problems
+ using them in .if statements.
+
+ Unlike other b\bbm\bma\bak\bke\be programs, this implementation by default executes all
+ commands for a given target using a single shell invocation. This is
+ done for both efficiency and to simplify error handling in remote command
+ invocations. Typically this is transparent to the user, unless the tar-
+ get commands change the current working directory using ``cd'' or
+ ``chdir''. To be compatible with Makefiles that do this, one can use -\b-B\bB
+ to disable this behavior.
+
+ In compatibility mode, each command is run in a separate process. If the
+ command contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it
+ will be passed to the shell, otherwise b\bbm\bma\bak\bke\be will attempt direct execu-
+ tion.
+
+S\bSE\bEE\bE A\bAL\bLS\bSO\bO
+ mkdep(1)
+
+H\bHI\bIS\bST\bTO\bOR\bRY\bY
+ b\bbm\bma\bak\bke\be is derived from NetBSD make(1). It uses autoconf to facilitate
+ portability to other platforms.
+
+ A make command appeared in Version 7 AT&T UNIX. This make implementation
+ is based on Adam De Boor's pmake program which was written for Sprite at
+ Berkeley. It was designed to be a parallel distributed make running jobs
+ on different machines using a daemon called ``customs''.
+
+B\bBU\bUG\bGS\bS
+ The make syntax is difficult to parse without actually acting of the
+ data. For instance finding the end of a variable use should involve
+ scanning each the modifiers using the correct terminator for each field.
+ In many places make just counts {} and () in order to find the end of a
+ variable expansion.
+
+MAKE(1) NetBSD General Commands Manual MAKE(1)
+
+ There is no way of escaping a space character in a filename.
+
+N\bNA\bAM\bME\bE
+ b\bbm\bma\bak\bke\be -- maintain program dependencies
+
+S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
+ b\bbm\bma\bak\bke\be [-\b-B\bBe\bei\bik\bkN\bNn\bnq\bqr\brs\bst\btW\bWX\bX] [-\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [-\b-d\bd _\bf_\bl_\ba_\bg_\bs]
+ [-\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be] [-\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be] [-\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs]
+ [-\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [-\b-T\bT _\bf_\bi_\bl_\be] [-\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be] [_\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be]
+ [_\bt_\ba_\br_\bg_\be_\bt _\b._\b._\b.]
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+ b\bbm\bma\bak\bke\be is a program designed to simplify the maintenance of other pro-
+ grams. Its input is a list of specifications as to the files upon which
+ programs and other files depend. If no -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be makefile option is
+ given, b\bbm\bma\bak\bke\be will try to open `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be' then `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' in order to find
+ the specifications. If the file `_\b._\bd_\be_\bp_\be_\bn_\bd' exists, it is read (see
+ mkdep(1)).
+
+ This manual page is intended as a reference document only. For a more
+ thorough description of b\bbm\bma\bak\bke\be and makefiles, please refer to _\bP_\bM_\ba_\bk_\be _\b- _\bA
+ _\bT_\bu_\bt_\bo_\br_\bi_\ba_\bl.
+
+ b\bbm\bma\bak\bke\be will prepend the contents of the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable to
+ the command line arguments before parsing them.
+
+ The options are as follows:
+
+ -\b-B\bB Try to be backwards compatible by executing a single shell per
+ command and by executing the commands to make the sources of a
+ dependency line in sequence.
+
+ -\b-C\bC _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Change to _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by before reading the makefiles or doing any-
+ thing else. If multiple -\b-C\bC options are specified, each is inter-
+ preted relative to the previous one: -\b-C\bC _\b/ -\b-C\bC _\be_\bt_\bc is equivalent to
+ -\b-C\bC _\b/_\be_\bt_\bc.
+
+ -\b-D\bD _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
+ Define _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to be 1, in the global context.
+
+ -\b-d\bd _\b[_\b-_\b]_\bf_\bl_\ba_\bg_\bs
+ Turn on debugging, and specify which portions of b\bbm\bma\bak\bke\be are to
+ print debugging information. Unless the flags are preceded by
+ `-' they are added to the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable and will
+ be processed by any child make processes. By default, debugging
+ information is printed to standard error, but this can be changed
+ using the _\bF debugging flag. The debugging output is always
+ unbuffered; in addition, if debugging is enabled but debugging
+ output is not directed to standard output, then the standard out-
+ put is line buffered. _\bF_\bl_\ba_\bg_\bs is one or more of the following:
+
+ _\bA Print all possible debugging information; equivalent to
+ specifying all of the debugging flags.
+
+ _\ba Print debugging information about archive searching and
+ caching.
+
+ _\bC Print debugging information about current working direc-
+ tory.
+
+ _\bc Print debugging information about conditional evaluation.
+
+ _\bd Print debugging information about directory searching and
+ caching.
+
+ _\be Print debugging information about failed commands and
+ targets.
+
+ _\bF[+\b+]_\bf_\bi_\bl_\be_\bn_\ba_\bm_\be
+ Specify where debugging output is written. This must be
+ the last flag, because it consumes the remainder of the
+ argument. If the character immediately after the `F'
+ flag is `+', then the file will be opened in append mode;
+ otherwise the file will be overwritten. If the file name
+ is `stdout' or `stderr' then debugging output will be
+ written to the standard output or standard error output
+ file descriptors respectively (and the `+' option has no
+ effect). Otherwise, the output will be written to the
+ named file. If the file name ends `.%d' then the `%d' is
+ replaced by the pid.
+
+ _\bf Print debugging information about loop evaluation.
+
+ _\bg_\b1 Print the input graph before making anything.
+
+ _\bg_\b2 Print the input graph after making everything, or before
+ exiting on error.
+
+ _\bg_\b3 Print the input graph before exiting on error.
+
+ _\bj Print debugging information about running multiple
+ shells.
+
+ _\bl Print commands in Makefiles regardless of whether or not
+ they are prefixed by `@' or other "quiet" flags. Also
+ known as "loud" behavior.
+
+ _\bM Print debugging information about "meta" mode decisions
+ about targets.
+
+ _\bm Print debugging information about making targets, includ-
+ ing modification dates.
+
+ _\bn Don't delete the temporary command scripts created when
+ running commands. These temporary scripts are created in
+ the directory referred to by the TMPDIR environment vari-
+ able, or in _\b/_\bt_\bm_\bp if TMPDIR is unset or set to the empty
+ string. The temporary scripts are created by mkstemp(3),
+ and have names of the form _\bm_\ba_\bk_\be_\bX_\bX_\bX_\bX_\bX_\bX. _\bN_\bO_\bT_\bE: This can
+ create many files in TMPDIR or _\b/_\bt_\bm_\bp, so use with care.
+
+ _\bp Print debugging information about makefile parsing.
+
+ _\bs Print debugging information about suffix-transformation
+ rules.
+
+ _\bt Print debugging information about target list mainte-
+ nance.
+
+ _\bV Force the -\b-V\bV option to print raw values of variables.
+
+ _\bv Print debugging information about variable assignment.
+
+ _\bx Run shell commands with -\b-x\bx so the actual commands are
+ printed as they are executed.
+
+ -\b-e\be Specify that environment variables override macro assignments
+ within makefiles.
+
+ -\b-f\bf _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be
+ Specify a makefile to read instead of the default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be'. If
+ _\bm_\ba_\bk_\be_\bf_\bi_\bl_\be is `-\b-', standard input is read. Multiple makefiles may
+ be specified, and are read in the order specified.
+
+ -\b-I\bI _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Specify a directory in which to search for makefiles and included
+ makefiles. The system makefile directory (or directories, see
+ the -\b-m\bm option) is automatically included as part of this list.
+
+ -\b-i\bi Ignore non-zero exit of shell commands in the makefile. Equiva-
+ lent to specifying `-\b-' before each command line in the makefile.
+
+ -\b-J\bJ _\bp_\br_\bi_\bv_\ba_\bt_\be
+ This option should _\bn_\bo_\bt be specified by the user.
+
+ When the _\bj option is in use in a recursive build, this option is
+ passed by a make to child makes to allow all the make processes
+ in the build to cooperate to avoid overloading the system.
+
+ -\b-j\bj _\bm_\ba_\bx_\b__\bj_\bo_\bb_\bs
+ Specify the maximum number of jobs that b\bbm\bma\bak\bke\be may have running at
+ any one time. The value is saved in _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\bS. Turns compati-
+ bility mode off, unless the _\bB flag is also specified. When com-
+ patibility mode is off, all commands associated with a target are
+ executed in a single shell invocation as opposed to the tradi-
+ tional one shell invocation per line. This can break traditional
+ scripts which change directories on each command invocation and
+ then expect to start with a fresh environment on the next line.
+ It is more efficient to correct the scripts rather than turn
+ backwards compatibility on.
+
+ -\b-k\bk Continue processing after errors are encountered, but only on
+ those targets that do not depend on the target whose creation
+ caused the error.
+
+ -\b-m\bm _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
+ Specify a directory in which to search for sys.mk and makefiles
+ included via the <_\bf_\bi_\bl_\be>-style include statement. The -\b-m\bm option
+ can be used multiple times to form a search path. This path will
+ override the default system include path: /usr/share/mk. Fur-
+ thermore the system include path will be appended to the search
+ path used for "_\bf_\bi_\bl_\be"-style include statements (see the -\b-I\bI
+ option).
+
+ If a file or directory name in the -\b-m\bm argument (or the
+ MAKESYSPATH environment variable) starts with the string ".../"
+ then b\bbm\bma\bak\bke\be will search for the specified file or directory named
+ in the remaining part of the argument string. The search starts
+ with the current directory of the Makefile and then works upward
+ towards the root of the filesystem. If the search is successful,
+ then the resulting directory replaces the ".../" specification in
+ the -\b-m\bm argument. If used, this feature allows b\bbm\bma\bak\bke\be to easily
+ search in the current source tree for customized sys.mk files
+ (e.g., by using ".../mk/sys.mk" as an argument).
+
+ -\b-n\bn Display the commands that would have been executed, but do not
+ actually execute them unless the target depends on the .MAKE spe-
+ cial source (see below).
+
+ -\b-N\bN Display the commands which would have been executed, but do not
+ actually execute any of them; useful for debugging top-level
+ makefiles without descending into subdirectories.
+
+ -\b-q\bq Do not execute any commands, but exit 0 if the specified targets
+ are up-to-date and 1, otherwise.
+
+ -\b-r\br Do not use the built-in rules specified in the system makefile.
+
+ -\b-s\bs Do not echo any commands as they are executed. Equivalent to
+ specifying `@\b@' before each command line in the makefile.
+
+ -\b-T\bT _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
+ When used with the -\b-j\bj flag, append a trace record to _\bt_\br_\ba_\bc_\be_\bf_\bi_\bl_\be
+ for each job started and completed.
+
+ -\b-t\bt Rather than re-building a target as specified in the makefile,
+ create it or update its modification time to make it appear up-
+ to-date.
+
+ -\b-V\bV _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be
+ Print b\bbm\bma\bak\bke\be's idea of the value of _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be, in the global con-
+ text. Do not build any targets. Multiple instances of this
+ option may be specified; the variables will be printed one per
+ line, with a blank line for each null or undefined variable. If
+ _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be contains a `$' then the value will be expanded before
+ printing.
+
+ -\b-W\bW Treat any warnings during makefile parsing as errors.
+
+ -\b-X\bX Don't export variables passed on the command line to the environ-
+ ment individually. Variables passed on the command line are
+ still exported via the _\bM_\bA_\bK_\bE_\bF_\bL_\bA_\bG_\bS environment variable. This
+ option may be useful on systems which have a small limit on the
+ size of command arguments.
+
+ _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be_\b=_\bv_\ba_\bl_\bu_\be
+ Set the value of the variable _\bv_\ba_\br_\bi_\ba_\bb_\bl_\be to _\bv_\ba_\bl_\bu_\be. Normally, all
+ values passed on the command line are also exported to sub-makes
+ in the environment. The -\b-X\bX flag disables this behavior. Vari-
+ able assignments should follow options for POSIX compatibility
+ but no ordering is enforced.
+
+ There are seven different types of lines in a makefile: file dependency
+ specifications, shell commands, variable assignments, include statements,
+ conditional directives, for loops, and comments.
+
+ In general, lines may be continued from one line to the next by ending
+ them with a backslash (`\'). The trailing newline character and initial
+ whitespace on the following line are compressed into a single space.
+
+F\bFI\bIL\bLE\bE D\bDE\bEP\bPE\bEN\bND\bDE\bEN\bNC\bCY\bY S\bSP\bPE\bEC\bCI\bIF\bFI\bIC\bCA\bAT\bTI\bIO\bON\bNS\bS
+ Dependency lines consist of one or more targets, an operator, and zero or
+ more sources. This creates a relationship where the targets ``depend''
+ on the sources and are usually created from them. The exact relationship
+ between the target and the source is determined by the operator that sep-
+ arates them. The three operators are as follows:
+
+ :\b: A target is considered out-of-date if its modification time is less
+ than those of any of its sources. Sources for a target accumulate
+ over dependency lines when this operator is used. The target is
+ removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ !\b! Targets are always re-created, but not until all sources have been
+ examined and re-created as necessary. Sources for a target accumu-
+ late over dependency lines when this operator is used. The target
+ is removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ :\b::\b: If no sources are specified, the target is always re-created. Oth-
+ erwise, a target is considered out-of-date if any of its sources
+ has been modified more recently than the target. Sources for a
+ target do not accumulate over dependency lines when this operator
+ is used. The target will not be removed if b\bbm\bma\bak\bke\be is interrupted.
+
+ Targets and sources may contain the shell wildcard values `?', `*', `[]',
+ and `{}'. The values `?', `*', and `[]' may only be used as part of the
+ final component of the target or source, and must be used to describe
+ existing files. The value `{}' need not necessarily be used to describe
+ existing files. Expansion is in directory order, not alphabetically as
+ done in the shell.
+
+S\bSH\bHE\bEL\bLL\bL C\bCO\bOM\bMM\bMA\bAN\bND\bDS\bS
+ Each target may have associated with it a series of shell commands, nor-
+ mally used to create the target. Each of the commands in this script
+ _\bm_\bu_\bs_\bt be preceded by a tab. While any target may appear on a dependency
+ line, only one of these dependencies may be followed by a creation
+ script, unless the `:\b::\b:' operator is used.
+
+ If the first characters of the command line are any combination of `@\b@',
+ `+\b+', or `-\b-', the command is treated specially. A `@\b@' causes the command
+ not to be echoed before it is executed. A `+\b+' causes the command to be
+ executed even when -\b-n\bn is given. This is similar to the effect of the
+ .MAKE special source, except that the effect can be limited to a single
+ line of a script. A `-\b-' causes any non-zero exit status of the command
+ line to be ignored.
+
+V\bVA\bAR\bRI\bIA\bAB\bBL\bLE\bE A\bAS\bSS\bSI\bIG\bGN\bNM\bME\bEN\bNT\bTS\bS
+ Variables in make are much like variables in the shell, and, by tradi-
+ tion, consist of all upper-case letters.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be a\bas\bss\bsi\big\bgn\bnm\bme\ben\bnt\bt m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
+ The five operators that can be used to assign values to variables are as
+ follows:
+
+ =\b= Assign the value to the variable. Any previous value is overrid-
+ den.
+
+ +\b+=\b= Append the value to the current value of the variable.
+
+ ?\b?=\b= Assign the value to the variable if it is not already defined.
+
+ :\b:=\b= Assign with expansion, i.e. expand the value before assigning it
+ to the variable. Normally, expansion is not done until the vari-
+ able is referenced. _\bN_\bO_\bT_\bE: References to undefined variables are
+ _\bn_\bo_\bt expanded. This can cause problems when variable modifiers
+ are used.
+
+ !\b!=\b= Expand the value and pass it to the shell for execution and
+ assign the result to the variable. Any newlines in the result
+ are replaced with spaces.
+
+ Any white-space before the assigned _\bv_\ba_\bl_\bu_\be is removed; if the value is
+ being appended, a single space is inserted between the previous contents
+ of the variable and the appended value.
+
+ Variables are expanded by surrounding the variable name with either curly
+ braces (`{}') or parentheses (`()') and preceding it with a dollar sign
+ (`$'). If the variable name contains only a single letter, the surround-
+ ing braces or parentheses are not required. This shorter form is not
+ recommended.
+
+ If the variable name contains a dollar, then the name itself is expanded
+ first. This allows almost arbitrary variable names, however names con-
+ taining dollar, braces, parenthesis, or whitespace are really best
+ avoided!
+
+ If the result of expanding a variable contains a dollar sign (`$') the
+ string is expanded again.
+
+ Variable substitution occurs at three distinct times, depending on where
+ the variable is being used.
+
+ 1. Variables in dependency lines are expanded as the line is read.
+
+ 2. Variables in shell commands are expanded when the shell command is
+ executed.
+
+ 3. ``.for'' loop index variables are expanded on each loop iteration.
+ Note that other variables are not expanded inside loops so the fol-
+ lowing example code:
+
+
+ .for i in 1 2 3
+ a+= ${i}
+ j= ${i}
+ b+= ${j}
+ .endfor
+
+ all:
+ @echo ${a}
+ @echo ${b}
+
+ will print:
+
+ 1 2 3
+ 3 3 3
+
+ Because while ${a} contains ``1 2 3'' after the loop is executed,
+ ${b} contains ``${j} ${j} ${j}'' which expands to ``3 3 3'' since
+ after the loop completes ${j} contains ``3''.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be c\bcl\bla\bas\bss\bse\bes\bs
+ The four different classes of variables (in order of increasing prece-
+ dence) are:
+
+ Environment variables
+ Variables defined as part of b\bbm\bma\bak\bke\be's environment.
+
+ Global variables
+ Variables defined in the makefile or in included makefiles.
+
+ Command line variables
+ Variables defined as part of the command line.
+
+ Local variables
+ Variables that are defined specific to a certain target. The
+ seven local variables are as follows:
+
+ _\b._\bA_\bL_\bL_\bS_\bR_\bC The list of all sources for this target; also known as
+ `_\b>'.
+
+ _\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE The name of the archive file.
+
+ _\b._\bI_\bM_\bP_\bS_\bR_\bC In suffix-transformation rules, the name/path of the
+ source from which the target is to be transformed (the
+ ``implied'' source); also known as `_\b<'. It is not
+ defined in explicit rules.
+
+ _\b._\bM_\bE_\bM_\bB_\bE_\bR The name of the archive member.
+
+ _\b._\bO_\bO_\bD_\bA_\bT_\bE The list of sources for this target that were deemed
+ out-of-date; also known as `_\b?'.
+
+ _\b._\bP_\bR_\bE_\bF_\bI_\bX The file prefix of the target, containing only the file
+ portion, no suffix or preceding directory components;
+ also known as `_\b*'.
+
+ _\b._\bT_\bA_\bR_\bG_\bE_\bT The name of the target; also known as `_\b@'.
+
+ The shorter forms `_\b@', `_\b?', `_\b<', `_\b>', and `_\b*' are permitted for
+ backward compatibility with historical makefiles and are not rec-
+ ommended. The six variables `_\b@_\bF', `_\b@_\bD', `_\b<_\bF', `_\b<_\bD', `_\b*_\bF', and
+ `_\b*_\bD' are permitted for compatibility with AT&T System V UNIX
+ makefiles and are not recommended.
+
+ Four of the local variables may be used in sources on dependency
+ lines because they expand to the proper value for each target on
+ the line. These variables are `_\b._\bT_\bA_\bR_\bG_\bE_\bT', `_\b._\bP_\bR_\bE_\bF_\bI_\bX', `_\b._\bA_\bR_\bC_\bH_\bI_\bV_\bE',
+ and `_\b._\bM_\bE_\bM_\bB_\bE_\bR'.
+
+ A\bAd\bdd\bdi\bit\bti\bio\bon\bna\bal\bl b\bbu\bui\bil\blt\bt-\b-i\bin\bn v\bva\bar\bri\bia\bab\bbl\ble\bes\bs
+ In addition, b\bbm\bma\bak\bke\be sets or knows about the following variables:
+
+ _\b$ A single dollar sign `$', i.e. `$$' expands to a single
+ dollar sign.
+
+ _\b._\bA_\bL_\bL_\bT_\bA_\bR_\bG_\bE_\bT_\bS The list of all targets encountered in the Makefile. If
+ evaluated during Makefile parsing, lists only those tar-
+ gets encountered thus far.
+
+ _\b._\bC_\bU_\bR_\bD_\bI_\bR A path to the directory where b\bbm\bma\bak\bke\be was executed. Refer
+ to the description of `PWD' for more details.
+
+ MAKE The name that b\bbm\bma\bak\bke\be was executed with (_\ba_\br_\bg_\bv_\b[_\b0_\b]). For
+ compatibility b\bbm\bma\bak\bke\be also sets _\b._\bM_\bA_\bK_\bE with the same value.
+ The preferred variable to use is the environment variable
+ MAKE because it is more compatible with other versions of
+ b\bbm\bma\bak\bke\be and cannot be confused with the special target with
+ the same name.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bD_\bE_\bP_\bE_\bN_\bD_\bF_\bI_\bL_\bE
+ Names the makefile (default `_\b._\bd_\be_\bp_\be_\bn_\bd') from which gener-
+ ated dependencies are read.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bA_\bN_\bD_\b__\bV_\bA_\bR_\bI_\bA_\bB_\bL_\bE_\bS
+ A boolean that controls the default behavior of the -\b-V\bV
+ option.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bE_\bX_\bP_\bO_\bR_\bT_\bE_\bD The list of variables exported by b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\bS The argument to the -\b-j\bj option.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX
+ If b\bbm\bma\bak\bke\be is run with _\bj then output for each target is
+ prefixed with a token `--- target ---' the first part of
+ which can be controlled via _\b._\bM_\bA_\bK_\bE_\b._\bJ_\bO_\bB_\b._\bP_\bR_\bE_\bF_\bI_\bX.
+ For example:
+ .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
+ would produce tokens like `---make[1234] target ---' mak-
+ ing it easier to track the degree of parallelism being
+ achieved.
+
+ MAKEFLAGS The environment variable `MAKEFLAGS' may contain anything
+ that may be specified on b\bbm\bma\bak\bke\be's command line. Anything
+ specified on b\bbm\bma\bak\bke\be's command line is appended to the
+ `MAKEFLAGS' variable which is then entered into the envi-
+ ronment for all programs which b\bbm\bma\bak\bke\be executes.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bL_\bE_\bV_\bE_\bL The recursion depth of b\bbm\bma\bak\bke\be. The initial instance of
+ b\bbm\bma\bak\bke\be will be 0, and an incremented value is put into the
+ environment to be seen by the next generation. This
+ allows tests like: .if ${.MAKE.LEVEL} == 0 to protect
+ things which should only be evaluated in the initial
+ instance of b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\b__\bP_\bR_\bE_\bF_\bE_\bR_\bE_\bN_\bC_\bE
+ The ordered list of makefile names (default `_\bm_\ba_\bk_\be_\bf_\bi_\bl_\be',
+ `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be') that b\bbm\bma\bak\bke\be will look for.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bA_\bK_\bE_\bF_\bI_\bL_\bE_\bS
+ The list of makefiles read by b\bbm\bma\bak\bke\be, which is useful for
+ tracking dependencies. Each makefile is recorded only
+ once, regardless of the number of times read.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bO_\bD_\bE Processed after reading all makefiles. Can affect the
+ mode that b\bbm\bma\bak\bke\be runs in. It can contain a number of key-
+ words:
+
+ _\bc_\bo_\bm_\bp_\ba_\bt Like -\b-B\bB, puts b\bbm\bma\bak\bke\be into "compat" mode.
+
+ _\bm_\be_\bt_\ba Puts b\bbm\bma\bak\bke\be into "meta" mode, where meta files
+ are created for each target to capture the
+ command run, the output generated and if
+ filemon(4) is available, the system calls
+ which are of interest to b\bbm\bma\bak\bke\be. The captured
+ output can be very useful when diagnosing
+ errors.
+
+ _\bc_\bu_\br_\bd_\bi_\br_\bO_\bk_\b= _\bb_\bf Normally b\bbm\bma\bak\bke\be will not create .meta files
+ in `_\b._\bC_\bU_\bR_\bD_\bI_\bR'. This can be overridden by set-
+ ting _\bb_\bf to a value which represents True.
+
+ _\be_\bn_\bv For debugging, it can be useful to inlcude
+ the environment in the .meta file.
+
+ _\bv_\be_\br_\bb_\bo_\bs_\be If in "meta" mode, print a clue about the
+ target being built. This is useful if the
+ build is otherwise running silently. The
+ message printed the value of:
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bP_\bR_\bE_\bF_\bI_\bX.
+
+ _\bi_\bg_\bn_\bo_\br_\be_\b-_\bc_\bm_\bd Some makefiles have commands which are simply
+ not stable. This keyword causes them to be
+ ignored for determining whether a target is
+ out of date in "meta" mode. See also
+ .\b.N\bNO\bOM\bME\bET\bTA\bA_\b_C\bCM\bMP\bP.
+
+ _\bs_\bi_\bl_\be_\bn_\bt_\b= _\bb_\bf If _\bb_\bf is True, when a .meta file is created,
+ mark the target .\b.S\bSI\bIL\bLE\bEN\bNT\bT.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bB_\bA_\bI_\bL_\bI_\bW_\bI_\bC_\bK
+ In "meta" mode, provides a list of prefixes which match
+ the directories controlled by b\bbm\bma\bak\bke\be. If a file that was
+ generated outside of _\b._\bO_\bB_\bJ_\bD_\bI_\bR but within said bailiwick is
+ missing, the current target is considered out-of-date.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bC_\bR_\bE_\bA_\bT_\bE_\bD
+ In "meta" mode, this variable contains a list of all the
+ meta files updated. If not empty, it can be used to
+ trigger processing of _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bF_\bI_\bL_\bE_\bS.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bF_\bI_\bL_\bE_\bS
+ In "meta" mode, this variable contains a list of all the
+ meta files used (updated or not). This list can be used
+ to process the meta files to extract dependency informa-
+ tion.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bM_\bE_\bT_\bA_\b._\bP_\bR_\bE_\bF_\bI_\bX
+ Defines the message printed for each meta file updated in
+ "meta verbose" mode. The default value is:
+ Building ${.TARGET:H:tA}/${.TARGET:T}
+
+ _\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS This variable is used to record the names of variables
+ assigned to on the command line, so that they may be
+ exported as part of `MAKEFLAGS'. This behaviour can be
+ disabled by assigning an empty value to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'
+ within a makefile. Extra variables can be exported from
+ a makefile by appending their names to `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS'.
+ `MAKEFLAGS' is re-exported whenever `_\b._\bM_\bA_\bK_\bE_\bO_\bV_\bE_\bR_\bR_\bI_\bD_\bE_\bS' is
+ modified.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bP_\bI_\bD The process-id of b\bbm\bma\bak\bke\be.
+
+ _\b._\bM_\bA_\bK_\bE_\b._\bP_\bP_\bI_\bD The parent process-id of b\bbm\bma\bak\bke\be.
+
+ _\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR
+ When b\bbm\bma\bak\bke\be stops due to an error, it prints its name and
+ the value of `_\b._\bC_\bU_\bR_\bD_\bI_\bR' as well as the value of any vari-
+ ables named in `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR'.
+
+ _\b._\bn_\be_\bw_\bl_\bi_\bn_\be This variable is simply assigned a newline character as
+ its value. This allows expansions using the :\b:@\b@ modifier
+ to put a newline between iterations of the loop rather
+ than a space. For example, the printing of
+ `_\bM_\bA_\bK_\bE_\b__\bP_\bR_\bI_\bN_\bT_\b__\bV_\bA_\bR_\b__\bO_\bN_\b__\bE_\bR_\bR_\bO_\bR' could be done as
+ ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
+
+ _\b._\bO_\bB_\bJ_\bD_\bI_\bR A path to the directory where the targets are built. Its
+ value is determined by trying to chdir(2) to the follow-
+ ing directories in order and using the first match:
+
+ 1. ${MAKEOBJDIRPREFIX}${.CURDIR}
+
+ (Only if `MAKEOBJDIRPREFIX' is set in the environ-
+ ment or on the command line.)
+
+ 2. ${MAKEOBJDIR}
+
+ (Only if `MAKEOBJDIR' is set in the environment or
+ on the command line.)
+
+ 3. ${.CURDIR}_\b/_\bo_\bb_\bj_\b.${MACHINE}
+
+ 4. ${.CURDIR}_\b/_\bo_\bb_\bj
+
+ 5. _\b/_\bu_\bs_\br_\b/_\bo_\bb_\bj_\b/${.CURDIR}
+
+ 6. ${.CURDIR}
+
+ Variable expansion is performed on the value before it's
+ used, so expressions such as
+ ${.CURDIR:S,^/usr/src,/var/obj,}
+ may be used. This is especially useful with
+ `MAKEOBJDIR'.
+
+ `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' may be modified in the makefile as a global
+ variable. In all cases, b\bbm\bma\bak\bke\be will chdir(2) to `_\b._\bO_\bB_\bJ_\bD_\bI_\bR'
+ and set `PWD' to that directory before executing any tar-
+ gets.
+
+ _\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR A path to the directory of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being
+ parsed.
+
+ _\b._\bP_\bA_\bR_\bS_\bE_\bF_\bI_\bL_\bE The basename of the current `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be' being parsed.
+ This variable and `_\b._\bP_\bA_\bR_\bS_\bE_\bD_\bI_\bR' are both set only while the
+ `_\bM_\ba_\bk_\be_\bf_\bi_\bl_\be_\bs' are being parsed. If you want to retain
+ their current values, assign them to a variable using
+ assignment with expansion: (`:\b:=\b=').
+
+ _\b._\bP_\bA_\bT_\bH A variable that represents the list of directories that
+ b\bbm\bma\bak\bke\be will search for files. The search list should be
+ updated using the target `_\b._\bP_\bA_\bT_\bH' rather than the vari-
+ able.
+
+ PWD Alternate path to the current directory. b\bbm\bma\bak\bke\be normally
+ sets `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the canonical path given by getcwd(3).
+ However, if the environment variable `PWD' is set and
+ gives a path to the current directory, then b\bbm\bma\bak\bke\be sets
+ `_\b._\bC_\bU_\bR_\bD_\bI_\bR' to the value of `PWD' instead. This behaviour
+ is disabled if `MAKEOBJDIRPREFIX' is set or `MAKEOBJDIR'
+ contains a variable transform. `PWD' is set to the value
+ of `_\b._\bO_\bB_\bJ_\bD_\bI_\bR' for all programs which b\bbm\bma\bak\bke\be executes.
+
+ .TARGETS The list of targets explicitly specified on the command
+ line, if any.
+
+ VPATH Colon-separated (``:'') lists of directories that b\bbm\bma\bak\bke\be
+ will search for files. The variable is supported for
+ compatibility with old make programs only, use `_\b._\bP_\bA_\bT_\bH'
+ instead.
+
+ V\bVa\bar\bri\bia\bab\bbl\ble\be m\bmo\bod\bdi\bif\bfi\bie\ber\brs\bs
+ Variable expansion may be modified to select or modify each word of the
+ variable (where a ``word'' is white-space delimited sequence of charac-
+ ters). The general format of a variable expansion is as follows:
+
+ ${variable[:modifier[:...]]}
+
+ Each modifier begins with a colon, which may be escaped with a backslash
+ (`\').
+
+ A set of modifiers can be specified via a variable, as follows:
+
+ modifier_variable=modifier[:...]
+ ${variable:${modifier_variable}[:...]}
+
+ In this case the first modifier in the modifier_variable does not start
+ with a colon, since that must appear in the referencing variable. If any
+ of the modifiers in the modifier_variable contain a dollar sign (`$'),
+ these must be doubled to avoid early expansion.
+
+ The supported modifiers are:
+
+ :\b:E\bE Replaces each word in the variable with its suffix.
+
+ :\b:H\bH Replaces each word in the variable with everything but the last com-
+ ponent.
+
+ :\b:M\bM_\bp_\ba_\bt_\bt_\be_\br_\bn
+ Select only those words that match _\bp_\ba_\bt_\bt_\be_\br_\bn. The standard shell
+ wildcard characters (`*', `?', and `[]') may be used. The wildcard
+ characters may be escaped with a backslash (`\').
+
+ :\b:N\bN_\bp_\ba_\bt_\bt_\be_\br_\bn
+ This is identical to `:\b:M\bM', but selects all words which do not match
+ _\bp_\ba_\bt_\bt_\be_\br_\bn.
+
+ :\b:O\bO Order every word in variable alphabetically. To sort words in
+ reverse order use the `:\b:O\bO:\b:[\b[-\b-1\b1.\b..\b.1\b1]\b]' combination of modifiers.
+
+ :\b:O\bOx\bx Randomize words in variable. The results will be different each
+ time you are referring to the modified variable; use the assignment
+ with expansion (`:\b:=\b=') to prevent such behaviour. For example,
+
+ LIST= uno due tre quattro
+ &nb