History log of /freebsd-9.3-release/share/mk/bsd.subdir.mk
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 264303 09-Apr-2014 dim

MFC r263778:

Add a SUBDIR_PARALLEL option to bsd.subdir.mk, to allow make to process
all the SUBDIR entries in parallel, instead of serially. Apply this
option to a selected number of Makefiles, which can greatly speed up the
build on multi-core machines, when using make -j.

This can be extended to more Makefiles later on, whenever they are
verified to work correctly with parallel building.

I tested this on a 24-core machine, with make -j48 buildworld (N = 6):

before stddev after stddev
======= ====== ======= ======
real time 1741.1 16.5 959.8 2.7
user time 12468.7 16.4 14393.0 16.8
sys time 1825.0 54.8 2110.6 22.8

(user+sys)/real 8.2 17.1

E.g. the build was approximately 45% faster in real time. On machines
with less cores, or with lower -j settings, the speedup will not be as
impressive. But at least you can now almost max out a machine with
buildworld!

Submitted by: jilles

MFC r263833:

Enable parallel building for gnu/usr.bin and usr.bin/clang too.


# 252048 20-Jun-2013 sjg

share/mk: merge: r241298,243393,249057,251506 from head for bmake support.

Makefile: buildworld etc will be done with make from src tree,
make sure that bmake's -J 15,16 are not passed to it.

Reviewed by: obrien


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 200178 06-Dec-2009 ed

Make `make cleanilinks' work in /sys/modules.

cleanilinks wasn't listed in <bsd.subdir.mk>. Instead of adding it to
/sys/modules/Makefile, we'd better just add it to <bsd.subdir.mk>
directly, so we don't need to change files like /sys/modules/sound/Makefile
as well. This means you can finally clean up all those dangling symlinks
created by individual module compilation at once.


# 174409 07-Dec-2007 ru

Make "manlint" recursive.

Prodded by: obrien


# 146817 31-May-2005 ru

For ${SUBDIR} targets, change the type of dependency operator from `::'
to `:', so that it stays compatible with a stale dependency recorded in
.depend when the type of "foo" changes from file to directory or back.
Compensate for the loss of the "If no sources are specified, the target
is always re-created" feature by marking these targets with the .PHONY
attribute. While here, fix a bug in the target's script (nobody uses
these targets apparently).


# 141912 14-Feb-2005 ru

Add a SUBDIR_TARGETS variable which can be set to a list of
additional targets that will cause descending into subdirs.
Example:

cd /sys/modules; make load SUBDIR_TARGETS=load

(But don't try it with your pet.)

Submitted by: Alexey Klimov
PR: 47601


# 139761 06-Jan-2005 krion

Remove trailing spaces.


# 134904 07-Sep-2004 imp

[[ Forced commit due to fumble with the file used to commit with.
cvsgNMRSs vs cvsg4JFe3 :-( ]]

When recursing, print the target name as well as the subdirectory.
This changes the output a little, but appears to break no scripts.
These changes should make the debugging of build problems easier, as
well as explain why it appears things build 4 times (they don't,
really, since there's obj, depend, all and install).

I've been running these changes, or variations on them, for about 2
years.

Reviewed by: arch@ (des, markm, koshy, marcel, scottl)


# 134903 07-Sep-2004 imp

Although 'Unanimous Consent' appears to be a well defined and used in
the US Senate, Canadian Parliament and Australian Senate, it was
causing some confusion. After some consultation with Mark Murray,
change this to 'without objection' since often times a plain-speaking
term is preferable to a regionally used term.

Also, clarify that this procedure is to be used when for more mundane
matters that need a sanity check, but don't need the whole, ponderous
voting proceedure that more difficult issues require. Core members
that read email in any given 48 hour period are trusted enough to know
the difference and to provide the sanity check as necessary.

Reviewed by: markm


# 133369 09-Aug-2004 harti

Use the '+' flag to make make recurse into sub-directories even when
given -n. For POLA reasons this behaviour is switched on only when
at least two -n flags are given to make. One -n flag keeps the old behaviour
of showing the shell command that would recurse into the sub-directories.

Discussed with: ru


# 99875 12-Jul-2002 ru

Moved the `distribute' target from bsd.obj.mk to bsd.subdir.mk,
to make it call `install' in the bsd.subdir.mk-driven makefiles
too. (share/examples/Makefile,v 1.29 changed the bsd.prog.mk
to bsd.subdir.mk and many stuff was lost during "make release".
I then merged this change in rev. 1.28.2.2 to work around the
namespace pollution (FILES) in this makefile.)

There was an added complexity here. Both the `distribute' and
`install' targets are recursive (they propagate to SUBDIRs).
So `distribute' first calls `install' in the ${.CURDIR}, then
calls `distribute' in each SUBDIR, etc. The problem is that
`install' (being also recursive) causes the stuff from SUBDIR
to be installed twice, first time thru `install' in ${.CURDIR}
triggered by `distribute', second time by `distribute' run in
the SUBDIR. This problem is not new, but it became apparent
only after I moved the `distribute' target from bsd.obj.mk to
bsd.subdir.mk. My first attempt testing the fix failed due to
this, because the whole world was distributed twice, causing
all the imaginable mess (kerberos5 stuff was installed into both
"base" and "krb5" dists, there was /sbin/init.bak, etc.)
I say the problem is not new because bsd.prog.mk and bsd.lib.mk
makefiles with SUBDIR (even without this fix) had this problem
for years. Try e.g. running ``make distribute DISTDIR=/foo''
from usr.bin/bzip2 or from lib/libcom_err (without the fix) and
watch the output.

So the solution was to make `install' behave non-recursive when
executed by `distribute'. My first attempt in passing SUBDIR=
to the `install' in the `distribute' body failed because of the
way how src/Makefile and src/Makefile.inc1 communicate with each
other. SUBDIR='s assignment precedence on the "make install
SUBDIR=" command line is lowered after src/Makefile wrapper calls
"make ... -f ${.CURDIR}/Makefile.inc1 install" because SUBDIR=
is moved into environment, and Makefile.inc1's assignments now
take higher precedence. This may be fixed someday when we merge
Makefile with Makefile.inc1. For now, this is implemented as a
NO_SUBDIR knob.

Spotted by: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
Prodded by: des
MFC after: 3 days


# 99215 01-Jul-2002 ru

Get rid of the bogus dependencies between beforeinstall, realinstall,
and afterinstall targets. Make sure they are run in sequence in the
-j case.

This fixes the recent breakage with beforeinstall being run _after_
realinstall.

Reported by: knu


# 97769 03-Jun-2002 ru

Reimplement FILES support using bsd.files.mk with the
same set of features as in recently added bsd.incs.mk
(FILESGROUPS, accessibility from both bsd.prog.mk and
bsd.lib.mk, de-pessimized typical installation path,
etc.) New standard targets: buildfiles, installfiles,
and files (buildfiles + installfiles).


# 96668 15-May-2002 ru

Rename `includes' to `buildincludes'.
Rename `incsinstall' to `installincludes'.
Make `includes' a -j safe shortcut for `buildincludes' + `installincludes'.
`buildincludes' and `installincludes' are SUBDIR friendly, if run directly.


# 96462 12-May-2002 ru

Added new bsd.incs.mk which handles installing of header files
via INCS. Implemented INCSLINKS (equivalent to SYMLINKS) to
handle symlinking include files. Allow for multiple groups of
include files to be installed, with the powerful INCSGROUPS knob.
Documentation to follow.

Added standard `includes' and `incsinstall' targets, use them
in Makefile.inc1. Headers from the following makefiles were
not installed before (during `includes' in Makefile.inc1):

kerberos5/lib/libtelnet/Makefile
lib/libbz2/Makefile
lib/libdevinfo/Makefile
lib/libform/Makefile
lib/libisc/Makefile
lib/libmenu/Makefile
lib/libmilter/Makefile
lib/libpanel/Makefile

Replaced all `beforeinstall' targets for installing includes
with the INCS stuff.

Renamed INCDIR to INCSDIR, for consistency with FILES and SCRIPTS,
and for compatibility with NetBSD. Similarly for INCOWN, INCGRP,
and INCMODE.

Consistently use INCLUDEDIR instead of /usr/include.

gnu/lib/libstdc++/Makefile and gnu/lib/libsupc++/Makefile changes
were only lightly tested due to the missing contrib/libstdc++-v3.
I fully tested the pre-WIP_GCC31 version of this patch with the
contrib/libstdc++.295 stuff.

These changes have been tested on i386 with the -DNO_WERROR "make
world" and "make release".


# 96164 07-May-2002 ru

Added internal, non-recursive (SUBDIR) versions of the `all-man'
and `maninstall' targets. This fixes the issue where each subdir
was descended into twice during "make all", and also resurrects
the standardization of `maninstall'.

Urged by: bde


# 95509 26-Apr-2002 ru

Milestone #1 in cross-arch make releases.

Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.

Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.

Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).

Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).

In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.

Moved the creation of the "crypto" dist from release.5 to
release.2.

In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.

Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.

Inline createBOOTMFS target.

Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.

Assorted fixes:

Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".

Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.

gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.

release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.

Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.

XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)

Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.

Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>


# 95356 24-Apr-2002 ru

The install.debug and reinstall.debug targets are needed solely
to build kernel and kernel modules so stop supporting them in
bsd.subdir.mk and reimplement them in kern.post.mk and kmod.mk
as special versions of the install and reinstall targets, and
only define them if DEBUG is also defined (when debug versions
are really built).

Prompted by: bde


# 95327 23-Apr-2002 obrien

Change the name of the 'bin' distribution to 'base'.
This is done since it contains much more than /bin, and also gets in the
way when making a combined install+fixit CD.

OK'ed by: jkh


# 95306 23-Apr-2002 ru

Merge bsd.obj.mk's version of the _SUBDIR target with bsd.subdir.mk.

Ensure all standard targets honor SUBDIR. Now `make obj' descends into
SUBDIRs even if NOOBJ is set (some descendants may still need an object
directory, but we do not have such precedents). Now `make install' in
non-bsd.subdir.mk makefiles runs `afterinstall' target _after_ `install'
in SUBDIRs, like we do in bsd.subdir.mk. Nothing depended on the wrong
order anyway.

Fixed `distribute' targets (except for the bsd.subdir.mk version) so that
they do not depend on _SUBDIR; `distribute' calls `install' which already
depends on _SUBDIR.

De-standardize `maninstall', otherwise manpages would be installed twice.
(To be revised later.)


# 94940 17-Apr-2002 ru

Don't include bsd.own.mk from sys.mk, this makes it impossible
to use ``.if defined()'' inside bsd.own.mk to test for defines
in individual makefiles. For example, setting DEBUG_FLAGS in
Makefile didn't take the desired effect on the STRIP assignment.

Added bsd.init.mk (like in NetBSD) that handles the inclusion
of ../Makefile.inc and bsd.own.mk from all bsd.*.mk files that
"build something".

Back out bsd.own.mk,v 1.15: moved OBJFORMAT initialization back
to sys.mk (several source tree makefiles want to check it early)
and removed MACHINE_ARCH initialization (it's hard to see from
looking at the commitlogs what the problem was at the time, but
now it serves no purpose).

Prohibit the direct inclusion of bsd.man.mk and bsd.libnames.mk.

Protect bsd.obj.mk from repetitive inclusion. Prohibiting the
direct inclusion of bsd.obj.mk might be a good idea too.


# 90311 06-Feb-2002 ru

Back out revision 1.23 (SUBDIR_CHANGE).

Not objected to by: bde, eivind


# 85570 26-Oct-2001 des

Support the "install.debug" and "reinstall.debug" targets for kernel modules.
Small tweaks to kldxref may be necessary to avoid the surprising (but harm-
less) behaviour of 'kldload foo' loading foo.ko.debug instead of foo.ko if
it is present in the kernel directory.

Approved by: a week of silence on -arch
MFC after: 2 weeks


# 74842 27-Mar-2001 ru

Make it possible to build manpages for the entire source tree.


# 55337 03-Jan-2000 marcel

Fix typo.

Submitted by: Richard Wackerbarth <rkw@dataplex.net>


# 53152 14-Nov-1999 marcel

${MACHINE} -> ${MACHINE_ARCH}

All Makefiles now use MACHINE_ARCH for the target architecture.
Unification is required for cross-building.

Tags added to:
sys/boot/Makefile
sys/boot/arc/loader/Makefile
sys/kern/Makefile
usr.bin/cpp/Makefile
usr.bin/gcore/Makefile
usr.bin/truss/Makefile

usr.bin/gcore/Makefile:
fixed typo: MACHINDE -> MACHINE_ARCH


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 44922 21-Mar-1999 bde

Restored objlink. The previous commit was confused about the difference
between OBJLINK and objlink.


# 44755 14-Mar-1999 markm

Bitrot. Remove objlink as it is not pleasant to be downwind.

PR: 8071
Reviewed by: Sheldon Hearn <sheldonh@iafrica.com>


# 38183 08-Aug-1998 peter

Make ../Makefile.inc handling more consistant to prevent multiple includes
when certain .mk files include other .mk files. This will remove the
need for multiple include protection in some other makefiles around the
tree (and helps some elf conditionals).


# 35784 06-May-1998 wosch

Delete stale comment.
Pointed out by: bde


# 34934 28-Mar-1998 eivind

Support for fine-grained external control of subdir building.


# 34892 26-Mar-1998 eivind

Remove special handling of 'tags' for complex subdir systems
(presently only used in tip; should have been used by e.g. pkg_add).

Submitted by: bde


# 34829 23-Mar-1998 eivind

Support new version of global.

Submitted by: Shigio Yamaguchi <shigio@wafu.netgate.net>
Tested by: make buildworld


# 34528 12-Mar-1998 eivind

Introduce the 'regress' target.

Silently approved by: -hackers, -current


# 31177 15-Nov-1997 wosch

target(__target) -> target(${__target})

PR: bin/4736
Submitted by: Martin Kammerhofer <dada@sbox.tu-graz.ac.at>

Index: bsd.subdir.mk
===================================================================
RCS file: /usr/cvs/src/share/mk/bsd.subdir.mk,v
retrieving revision 1.18
diff -u -r1.18 bsd.subdir.mk
--- bsd.subdir.mk 1997/06/21 15:40:34 1.18
+++ bsd.subdir.mk 1997/11/09 18:04:33
@@ -59,7 +59,7 @@

.for __target in all checkdpadd clean cleandir depend lint \
maninstall obj objlink
-.if !target(__target)
+.if !target(${__target})
${__target}: _SUBDIRUSE
.endif
.endfor


# 26760 21-Jun-1997 jkh

Change the distribute targets so that a given item in our source tree
can place itself into n distributions, where n >= 1.


# 24861 13-Apr-1997 jkh

Support GLOBAL style tags.


# 24431 31-Mar-1997 scrappy

Remove ${MAKEFLAGS} on recommendation by Bruce, mainly because the reason
for adding it was so that -j3 carried through on a make -j3 world, but found
at least one circumstance where it breaks 'make depend'


# 24421 30-Mar-1997 scrappy

Add ${MAKEFLAGS} to ${MAKE} in _SUBDIRUSE so that something like
'make -j3 world' works

Jordan points out that this may not be the only place this is required to be
added, but so far, its the only one I've found to break -j3


# 23549 08-Mar-1997 wosch

Add comments.


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 18427 20-Sep-1996 bde

Added a `checkdpadd' target to help check that ${DPADD} is consistent with
${LDADD}. It doesn't handle internal libraries very well yet.


# 16672 24-Jun-1996 jkh

Add default targets for cleandepend and objlink.
Submitted by: Michael Hancock <michaelh@cet.co.jp>


# 15061 05-Apr-1996 wosch

remove BINGRP?=, BINOWN?=, BINMODE?=, STRIP?=
use .for loop for common targets


# 6716 25-Feb-1995 phk

"make distribute" have changed, beware if you use it.


# 5812 23-Jan-1995 jkh

Eliminate a bogus stray tab.


# 5585 14-Jan-1995 jkh

Change DISTRIBUTION names. Also make bsd.doc.mk go to doc distribution,
not bin. Hmmm.


# 4442 13-Nov-1994 phk

Add a new "distribute" target. This is a variant of install, which will
put the stuff into the right "distribution". As default things end up
in "bindist".

Normal (ie: most) makefiles know naught of this.

More commits will follow, which will direct various parts of the tree
into the distribution we want them in.

Some of the grief of being release-engineer is supposed to go away with this.


# 2827 16-Sep-1994 jkh

Add support for DEBUG_FLAGS. If you say something like:

make DEBUG_FLAGS=-g2

You can compile something for debugging at debugging level 2.
It will also take care not to strip the resulting executable(s).


# 2352 28-Aug-1994 bde

Use ${ECHODIR} instead of `echo' for printing directory names so that
`make -ss' is very quiet.


# 1844 04-Aug-1994 wollman

Spplat our 1.1.5 `mk' ifiles over the top of the 4.4 ones. So far
as I can tell, this is ts the right thing to do.


# 1639 30-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1638,
which included commits to RCS files with non-trunk default branches.


# 1638 30-May-1994 rgrimes

BSD 4.4 Lite Share Sources