History log of /freebsd-head/share/mk/bsd.init.mk
Revision Date Author Comments
e8e93672479c2309d414021a4aec379ec31839c1 07-Apr-2020 bdrewery <bdrewery@FreeBSD.org> NO_OBJ: Always fix .OBJDIR regardless of AUTO_OBJ.

Sponsored by: Dell EMC
MFC after: 2 weeks
3f7167a6b6bb8758e79adc656b2267c5f0e61bbb 04-Jul-2019 bdrewery <bdrewery@FreeBSD.org> Consider *clean targets as non-build targets as well.

MFC after: 2 weeks
Sponsored by: DellEMC
5c861640127b95aa6b29327a48da153695e84c10 20-Jun-2018 bdrewery <bdrewery@FreeBSD.org> Reduce exec and fstat overhead for non-build targets.

This is mostly targetting 'make showconfig' and 'make test-system-*' for
the benefit of makeman and universe-one-clang work.

Sponsored by: Dell EMC
e10157c9151153264e6899c5e2a10a495ed9f247 10-Nov-2017 bdrewery <bdrewery@FreeBSD.org> Handle some .OBJDIR == .CURDIR cases.

- If OBJROOT is SRCTOP then don't add on TARGET.TARGET_ARCH. This
only happens at the top-level, and for sub-directories when the
user is clever with MAKEOBJDIRPREFIX=/.
- Don't bother checking 'test -w' on .CURDIR.
- Properly set OBJTOP/OBJROOT to SRCTOP in various needed cases.
- Check if the OBJDIR is writable even for *clean* targets since it
determines which .OBJDIR the user gets; If they cannot write to an
existing eligible .OBJDIR then it needs to clean in .CURDIR instead.
- Add guard to cleanworld/cleanuniverse from removing SRCTOP.
- Ensure OBJTOP is proper for .OBJDIR=.CURDIR which fixes finding
libraries since src.libnames.mk is based on OBJTOP.
- Avoid some chdir(2) for modifying .OBJDIR

Sponsored by: Dell EMC Isilon
602b873130231f7d05b712bf5f9bc12be5689cdd 05-Nov-2017 bdrewery <bdrewery@FreeBSD.org> AUTO_OBJ: Allow 'make cleandir obj all' combinations.

The cleanobj target will not really remove the OBJDIR in this case,
it will only remove the OBJDIR if only clean targets are ran.

Sponsored by: Dell EMC Isilon
bc0048e6ef4e19a563d756ecef73a1589f56acd6 05-Nov-2017 bdrewery <bdrewery@FreeBSD.org> AUTO_OBJ: Set .OBJDIR=.CURDIR earlier for NO_OBJ Makefiles.

auto.obj.mk is loaded before the Makefile which may have NO_OBJ set inside of
it. In that case we can't avoid creating the OBJDIR but we do need to avoid
using it. Fixing .OBJDIR in bsd.init.mk at least fixes all of the build .mk
files to have a proper .OBJDIR. It does not fix the Makefile itself but
usually if they have NO_OBJ set they are not inspecting ${.OBJDIR} anyhow.

It is ideal to only have this in bsd.init.mk and to remove it from bsd.obj.mk,
but then bsd.obj.mk would need to include bsd.init.mk. Doing something like
that would require more testing. It has been proposed that bsd.obj.mk not be
included directly but it has been possible for too long to do so to change it
at this point.

Note too that it may make sense to fix .OBJDIR even when AUTO_OBJ is not
enabled but the historical behavior has always been that NO_OBJ just avoids
running 'make obj', so .OBJDIR should already be .CURDIR.

Also while NO_OBJ seems like it should be removed at this point, it is not
always possible to fix Makefiles to properly use an .OBJDIR. The cost of
keeping NO_OBJ support is minimal.

Sponsored by: Dell EMC Isilon
8425f75b1c5896118207db2cb22534a6adab3110 16-Sep-2017 sjg <sjg@FreeBSD.org> Use OBJS_SRCS_FILTER to control setting OBJS from SRCS

Some makefiles do reachover builds.
In some cases it is convenient to list subdirs of the distribution
in SRCS.

It is not very convenient, or always even desirable to have corresponding
subdirs in .OBJDIR, so OBJS_SRCS_FILTER allows the makefile to choose.
The default value 'R' matches existing practice.

But a makefile can set OBJS_SRCS_FILTER= T (the R gets added by
bsd.init.mk) to avoid the need for subdirs in .OBJDIR

Differential Revision: https://reviews.freebsd.org/D12218
Reviewed by: bdrewery
57488d2ac84e0b7d009bf87b575239f31115aa0f 20-Jun-2017 bdrewery <bdrewery@FreeBSD.org> Fix 'make clean all' to work again.

This likely broke completely with r308599.

Apply the same fix for 'make destroy' which is a DIRDEPS_BUILD thing.

PR: 219819
Reported by: trasz
MFC after: 3 days
Sponsored by: Dell EMC Isilon
9a2a2c228bdf97dd2d3279cdb8589b0ba22bd8a2 28-May-2017 vangyzen <vangyzen@FreeBSD.org> Fix INSTALL_AS_USER with external nsswitch databases

The INSTALL_AS_USER option tells "install" to use the current
user name as the owner of the installed file. The "install"
command executed by the build is statically linked, so it does not
load nsswitch modules, such as nss_ldap.so, so it fails when
the user is only defined in such a database.

Fix it to use the current UID instead of user name. This works
for all users. I expect it is also slightly more efficient.

Reviewed by: sjg
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10862
cafe808c23784f475468bda7478606ef38752ce0 28-May-2017 vangyzen <vangyzen@FreeBSD.org> Fix INSTALL_AS_USER

Move INSTALL_AS_USER into bsd.init.mk to maximize the chance that
it has final authority over fooOWN and fooGRP.

Reviewed by: sjg
MFC after: 3 days
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D10810
329898f839eac9ce08e796aa572dff74edf1d758 06-May-2017 bdrewery <bdrewery@FreeBSD.org> Fix some "don't build" optimizations from r308599 not working due to a typo.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
1ef06821e208be7394b624926bbc5e59c8360593 13-Nov-2016 bdrewery <bdrewery@FreeBSD.org> Consolidate the "don't build" optimizations into _SKIP_BUILD.

_SKIP_BUILD will be set when nothing is expected to be built. This can
be used to optimize some tree-walks and operations which don't need to
load dependency files or generate dependencies via beforebuild-style
hacks.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
44e193847ad09762163ba1cb5a695e61091ba866 13-Nov-2016 bdrewery <bdrewery@FreeBSD.org> DIRDEPS_BUILD: Don't hook 'beforebuild' into 'all' in MAKELEVEL 0.

This was a mistake in r295641, but is effectively prevented from
being a problem due to r296699 preventing 'make all' from being
usable at MAKELEVEL 0 for DIRDEPS_BUILD.

MFC after: 2 weeks
Sponsored by: Dell EMC Isilon
b526555a342ed225e3fff50a343ff5ad10c03522 31-Aug-2016 bdrewery <bdrewery@FreeBSD.org> Add a 'make print-dir' that simply traverses all directories and prints them.

This is useful for finding connected directories.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
5c68448b2f996875f54eceb0cf97c6a1a749748c 29-Jun-2016 bdrewery <bdrewery@FreeBSD.org> Don't warn about needing filemon for makeman.

r287879 wasn't quite enough here since Makefile.inc1 is running
'make -C release -V VERSION' and hitting the warning.

Reported by: lattera
Sponsored by: EMC / Isilon Storage Division
Approved by: re (blanket, META_MODE)
2e92e3aeda2801e9820b08eaeacabb3df0b62270 14-Jun-2016 bdrewery <bdrewery@FreeBSD.org> WITH_META_MODE: Lessen the filemon(4) requirement scope.

- Move the sys.mk filemon requirement to bsd.init.mk as a warning.
This is intended only to show when building directly in a subdirectory
without filemon loaded.
- Move the error into Makefile and only apply it when building
from the META_TGT_WHITELIST target list.

-DNO_FILEMON can be used to suppress both the warning and the error but
makes WITH_META_MODE less useful. It will only compare build commands
in this mode rather than track all dependencies.

This fixes installing from a jail which doesn't need filemon in this
phase [1].

Reported by: Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
Approved by: re (implicit)
Sponsored by: EMC / Isilon Storage Division
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
6943e659c079f7524b7ada835d0dda9991ca4ae1 16-Feb-2016 bdrewery <bdrewery@FreeBSD.org> Consolidate common beforebuild logic.

Sponsored by: EMC / Isilon Storage Division
5f9638e1a65b68a70c4720052d6b797e1888b2ab 14-Jun-2015 sjg <sjg@FreeBSD.org> Avoid anoying warning
30006bb9784dc5017f7238229b77c757c9ebc7b1 10-Jun-2015 sjg <sjg@FreeBSD.org> Building on fmake is no longer possible so removed tests for bmake.
fa893c649edc005c28da5b9be7be814999af7841 16-May-2014 sjg <sjg@FreeBSD.org> Include bsd.opts.mk before local.init.mk
4c3c62dfba3f4dc0246129927ddb3b874ea16f07 24-Apr-2014 imp <imp@FreeBSD.org> Include bsd.opts.mk before Makefile.inc so Makefile.inc can do things
based on MK_xxx symbols. Continue to include bsd.own.mk after
Makefile.inc to preserve current behavior.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
caf94f2ccaa8e9b68db9cc260ba5fb4a26b038f4 10-Jan-2013 des <des@FreeBSD.org> Remove all support for legacy NOFOO and NO_FOO build options.
b2b32894a5c3e28859525c133dd41d0ef8cf031b 08-Nov-2012 sjg <sjg@FreeBSD.org> Allow clean at level 0
9dd41e3647df728006e0749ac139cfeb773c3873 22-Aug-2012 marcel <marcel@FreeBSD.org> Sync FreeBSD's bmake branch with Juniper's internal bmake branch.

Requested by: Simon Gerraty <sjg@juniper.net>
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
19b6af98ec71398e77874582eb84ec5310c7156f 22-Nov-2008 dfr <dfr@FreeBSD.org> Clone Kip's Xen on stable/6 tree so that I can work on improving FreeBSD/amd64
performance in Xen's HVM mode.
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
f2968c80c994b77c5c1dafc45fce7be685d043e1 11-Apr-2005 harti <harti@FreeBSD.org> Make sure the only thing that follows .endif or .else is a comment.
24bdd9ea5289a703a2feefe9c07617b241be97a2 09-Jan-2005 ru <ru@FreeBSD.org> Revert previous revision. Including bsd.compat.mk is necessary
both from sys.mk (to handle old knobs set in /etc/make.conf),
and from here (to handle old knobs set in individual makefiles).
00b956726aea745fe444447b04c83491e32218c3 23-Dec-2004 ru <ru@FreeBSD.org> Include bsd.compat.mk early from sys.mk, enough for makefiles
using conditional statements to see the new spellings of NO_*
knobs (in case user still uses old spellings).

Reported by: kris
3b01b845055a6c3374f14bc8997be5a5d299cd8c 21-Dec-2004 ru <ru@FreeBSD.org> NOATM -> NO_ATM
dc24ddd41e8f19486380221cdd30ad699719d0d2 17-Apr-2002 ru <ru@FreeBSD.org> 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.