Home | History | Annotate | Download | only in mk
History log of /src/share/mk/bsd.subdir.mk
RevisionDateAuthorComments
 1.56  10-Jul-2022  rillig bsd.subdir.mk: replace obscure indirection with direct condition

Since 2008, when make generates the body of a .for loop, it does not
copy the items as raw strings but as expressions of the form ${:U...}.
This prevents syntactical changes from code injection in the body of the
.for loop.

Since then, using .for loop variables in conditions works. Since the
same time, the variable assignment operator '+=' doesn't need to be
protected by a leading space anymore. Even if the item from the .for
loop is 'libc++', the trailing '+' is not parsed as part of the variable
assignment operator, and it never had been parsed this way. The space
probably has been cargo cult programming. The only ambiguous case had
been in a variable assignment, when the variable name ended with a
variable from the .for loop, and the assignment operator was '='. Only
in this case could the parser be tricked into parsing the variable
assignment as 'libc+ +=' instead of the intended 'libc++ ='.
 1.55  10-Jul-2022  rillig bsd.subdir.mk: remove practically dead code

The condition '${dir:H} != ""' is almost always satisfied, since 2001 at
least. The only input for the modifier ':H' that leads to an empty
string is "/". It doesn't make sense though to specify the root
directory as a subdirectory.

While here, remove quotes around the left-hand side of comparisons in
conditions. The quotes have become redundant in 2008, when the .for
loop stopped inserting raw text into the .for loop body.

If the special case for "/" had actually been intended, it should have
been written as the equivalent '.if ${dir} == "/"' instead of hiding
this feature behind an edge case behavior of the modifier ':H'.

Based on the comments, the condition should have been '${dir:M/*}', but
it hadn't been written that way.
 1.54  10-Jun-2018  christos use SUBDIR.roff suggested by uwe@
 1.53  10-Jun-2018  kamil Fix the MKGROFF=no MKCXX=yes build

Allow to disable building groff. This is a build tool written in C++.

This option is useful with an external toolchain configured for building the
distribution rather than building tools (e.g. C++ lookup paths may differ).

Looks ok by <christos>

Sponsored by <The NetBSD Foundation>
 1.52  26-May-2010  uwe branches: 1.52.44;
Fix typo in comment.
 1.51  19-Dec-2009  christos We mustn't search in the path for ${dir}.${MACHINE}; make sure we only
find the ones relative to ${.CURDIR}.
 1.50  29-Nov-2009  uebayasi Remove an unneeded test (.if defined(V)) in .for v in ${V} ... .endfor.
Tested by running build.sh distribution.
 1.49  25-Oct-2008  apb Add a NOSUBDIR variable for bsd.subdir.mk. If NOSUBDIR is defined
then SUBDIR is ignored.
 1.48  13-Apr-2004  lukem Add MAKEDIRPREFIX shell macro to <bsd.own.mk>.
Usage: ${MAKEDIRTARGET} dir target [params]
Runs "cd $${dir} && ${MAKE} [params] $${target}",
displaying a "pretty" message whilst doing so.

Use MAKEDIRPREFIX to implement the __recurse .USE macro in <bsd.subdir.mk>
 1.47  29-Jan-2004  lukem Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.
 1.46  02-Nov-2001  tv Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.
 1.45  04-Oct-2001  tv Make sure "clean" target is always defined, to compensate for cleandir
now being defined in terms of clean.
 1.44  22-Sep-2001  tv The -m option is automatically propagated by make(1). Don't add yet more
(possibly wrong) `-m' options; this will only make MAKEFLAGS bigger and
bigger with each recursion.
 1.43  21-Sep-2001  tv Allow for recursion speedups by predefining rules for large subtrees which
don't need to run a particular target (such as "includes-games" at top level,
or "includes-sushi" at share/).
 1.42  14-Aug-2001  tv On recursion, don't recurse "clean" if making "cleandir". (Related to
bsd.own.mk change that defined clean as a dependency of cleandir.)
 1.41  09-Jan-2001  sommerfeld Don't send .WAIT into the bitbucket
 1.40  01-Jan-2001  sommerfeld Restore the intermediate subdir-${targ} targets since they're
referenced elsewhere; fixes problem of afterinstall running too soon.
 1.39  30-Dec-2000  sommerfeld Change SUBDIR expansions so that a .WAIT in a subdirs list turns into
.WAIT (rather than a ${targ}-.WAIT) in the ${targ}'s subdir dependancy list.

This allows .WAIT to be used in SUBDIR as a synchronization barrier
for recursive parallel builds.
 1.38  06-Jun-2000  mycroft Fix some breakage with directory that have no subdirectories.
 1.37  06-Jun-2000  mycroft Oops; fix a subtle bit of semantics that was broken in the previous.
 1.36  06-Jun-2000  mycroft Oops. DTRT with directory names with dashes (e.g. for crypto-*).
 1.35  06-Jun-2000  mycroft A few changes to decrease parsing time and memory usage.
 1.34  16-Apr-2000  mrg branches: 1.34.2;
fix an error in the previous
 1.33  10-Apr-2000  mrg fix long standing bug in `make build' with $DESTDIR:
- during `make build' after /usr/share/mk has been installed, call
make with `-m $DESTDIR/usr/share/mk'.
 1.32  11-Mar-2000  aidan Allow absolute directories in SUBDIR. There's probably a better fix that
can go in 'make'.
 1.31  11-Feb-1999  tv Remove `dirname: all-dirname' compatibility hack. It's been long supposed
to go away, and even commented as such....
 1.30  13-Nov-1997  thorpej Echo the target we're working on while traversing subdirs, so one can
better judge how much longer a build will take. Patch submitted
by Brian Grayson <bgrayson@ece.utexas.edu> in PR #4419.
 1.29  27-Oct-1997  drochner Fix the before/after-install ordering problem in a different way.
The old fix broke with multiple targets on the make command line.
 1.28  11-Oct-1997  mycroft branches: 1.28.2;
Don't include bsd.obj.mk in these two files.
 1.27  11-Oct-1997  mycroft Several changes:
* Allow bsd.man.mk to be included separately.
* Always include bsd.own.mk and bsd.obj.mk.
* Include bsd.man.mk and bsd.nls.mk even if NOMAN or NONLS; just turn off
building of the affected files instead.
* Require bsd.subdir.mk to be included explicitly.
(Will make appropriate changes to Makefiles shortly.)
 1.26  11-Oct-1997  mycroft Move the previous to a different place, because `.if !target(...' sucks.
 1.25  10-Oct-1997  mycroft Massively simplify this. Partly from David Holland in PR 3823.
 1.24  31-May-1997  cjs Back out BUILDDIR and NOINSTALL changes.
 1.23  27-May-1997  cjs branches: 1.23.2;
Re-add other folks' changes that I accidently reverted when I did my
build system changes commit.
 1.22  26-May-1997  cjs These updates to the build allow building against include files
and libs in the object tree, if you use a separate object tree,
while maintaining backward compatability with other build methods.
See the notes in src/share/mk/bsd.README for full details. Note
that the `make includes' target now only installs the include files
in the build directory (if you use one--otherwise they go in DESTDIR
just like before); `make install' will install include files in
DESTDIR.
 1.21  17-May-1997  christos Add a realinstall target so that we recurse to subdirectories making install,
before the our afterinstall target fires.
 1.20  07-May-1997  mycroft Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.19  07-May-1997  mycroft Various simplifications.
 1.18  06-May-1997  mycroft Set the .MAKE attribute for all recursive targets.
 1.17  06-May-1997  mycroft Add a pile of missing .PHONYs.
 1.16  16-Apr-1997  christos Annotate missing directories as [skipped: missing] (from Christoph Badura)
 1.15  15-Apr-1997  christos Skip missing subdirectories to enable builds in partial source trees.
Directories being skipped are mentioned as '===> dir [skipped]'
 1.14  29-Mar-1997  mikel merge lite-2 changes (mostly SCCSids)
 1.13  24-Mar-1997  christos make rules update:
- add UPDATE and BUILD features
- add new FILES, INCS, SCRIPTS variables
- allow man pages source installation
 1.12  21-Mar-1997  cgd changes to allow "make -j N" to more easily parallelize many subdirs
 1.11  04-Apr-1996  jtc Added new standard target "includes" (used to install header files) to
bsd.subdir.mk. Added some documentation to bsd.README.
 1.10  24-Jul-1995  cgd show the directory depth, by printing out the hierarchy name.
Suggested by Ty Sarna, implemented by me. Useful, because it tells you
how deep you are, and allows you to paste the pathname in to 'cd' to the
directory.
 1.9  09-Oct-1994  mycroft Stop if cd fails.
 1.8  26-Jul-1994  mycroft Move the inclusion of bsd.own.mk to a better place.
 1.7  30-Jun-1994  cgd branches: 1.7.2;
RCSID frobbing, and minor sanity adjustments.
 1.6  30-Jun-1994  cgd don't be careless with _SUBDIRUSE
 1.5  09-Feb-1994  cgd have _SUBDIRUSE done in 'realinstall', not in 'install' so that
'afterinstall' actually happens *after* the real install!
since this entire section is in a "!target(install)", having
it done the other way was wrong and unnecessary (i.e. the
previous change/comment was bogus).
 1.4  17-Aug-1993  mycroft Make sure we don't recurse into subdirectories if Makefile specified `install'
target. (It's usually blank and is specifically to avoid doing this...)
 1.3  15-Aug-1993  mycroft Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.
 1.2  15-Aug-1993  mycroft Abstract out dependency stuff, and add RCS identifiers.
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  29-Mar-1997  mikel import 4.4BSD-Lite2 versions
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.2.2  09-Oct-1994  mycroft Update from trunk.
 1.7.2.1  26-Jul-1994  cgd from trunk.
 1.23.2.1  12-Oct-1997  cjs Update to 1.28.
 1.28.2.2  13-Nov-1997  thorpej Sync w/ trunk.
 1.28.2.1  29-Oct-1997  mellon Pull rev 1.29 up from trunk (drochner)
 1.34.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.52.44.1  25-Jun-2018  pgoyette Sync with HEAD

RSS XML Feed