freebsd kernel with SKQ
Go to file
bdrewery acbe8d7b87 Fix most cases of bsd.progs.mk running duplicate or missing commands.
This mostly fixes an interaction with bsd.test.mk with PROGS and SCRIPTS.
This was most notable with 'make clean' and 'make install', which r281055
and r272055 attempted to address but were inadequate.

It also addresses similar issues in bsd.progs.mk when not using bsd.test.mk.

This also fixes cases of NOT running commands in the parent when using
bsd.progs.mk:
  - 'make clean' was not run for the main process for Makefiles which had both
    FILES and SUBDIR but no PROGS or SCRIPTS.  This usually was just a
    leftover Kyuafile.auto.  One such example is usr.bin/bmake/tests/sysmk/t1/2.
  - 'make obj' was not running in the current directory with bsd.test.mk due
    to early inclusion of bsd.subdir.mk.  This was not really a problem due to
    the SUBDIRS using 'mkdir -p' for their objdirs.

There were subtle bugs causing this wrong behavior:
  1. bsd.progs.mk needs to set SCRIPTS to empty when recursing to avoid
     the sub-makes from installing, cleaning or building the SCRIPTS;
     only the parent make should be doing this.  r281055 effectively did
     the same but wasn't enough.
  2. CLEANFILES may contain (especially from *.test.mk) files which only
     the parent should clean, such as from FILES and SCRIPTS.  To resolve
     sub-makes also cleaning these, reset CLEANFILES and CLEANDIRS in the
     children before including bsd.prog.mk.  A tempting alternative would be
     to only handle CLEANFILES in the parent but then the child bsd.prog.mk
     CLEANFILES of per-PROGS wouldn't be setup.
  3. bsd.subdir.mk was included too soon in bsd.test.mk.  It needs to be
     included after bsd.prog.mk as the SCRIPTS logic is short-circuitted if
     'install:' is already defined (which bsd.subdir.mk does).  There is
     actually no need to include bsd.subdir.mk from bsd.test.mk as bsd.prog.mk
     and bsd.obj.mk will do so in the proper order.  The description in r257095
     covers this for FILES and was fixed differently, though changing the
     handling of target(install) in bsd.prog.mk may make sense after more
     research.
  4. bsd.progs.mk had extra logic to handle recursing SCRIPTS if PROGS was
     empty, which isn't its business to be doing.  SCRIPTS is handled fine
     by bsd.prog.mk.  This mostly reverts and reworks the fix in r259209 and
     partially reverts r272055.
  5. bsd.progs.mk has no need to depend 'all:' on SCRIPTS and FILES.  These
     are handled by bsd.prog.mk/bsd.files.mk fine.  This also partially reverts
     r272055.
  6. bsd.progs.mk was not drop-in safe for bsd.prog.mk.  Move the PROGS
     check from r273186 to allow it to be used safely.

Specific tested cases:
  SCRIPTS:no PROGS:no FILES:yes SUBDIR:yes
    usr.bin/bmake/tests/sysmk/t1/2

  SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
    usr.bin/bmake/tests/sysmk/t1/2/1

  SCRIPTS:yes PROGS:yes FILES:yes SUBDIR:yes
    lib/libthr/tests

  SCRIPTS:yes PROGS:no FILES:yes SUBDIR:no
    usr.bin/yacc/tests
    libexec/atf/atf-sh/tests

A full buildworld/installworld/clean comparison with mtree was also done.
The only relevant difference was the new fixed behavior of removing
Kyuafile.auto from the objdir in 'clean'.

Converting SCRIPTS to be a special case FILES group will make this less
fragile and is being explored.

One known remaining issue is 'cleandepend' removing the tags files for
every recursive call.

Note that the 'make clean' command runs for the CURDIR last, which can make
it appear to run multiple times when cleaning in tests/, but each command is
for a SUBDIR returning up the chain.  This is purely bsd.subdir.mk behavior.

PR:		191055
PR:		191955
MFC after:	2 weeks
Sponsored by:	EMC / Isilon Storage Division
2015-09-23 23:20:49 +00:00
bin Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
cddl Use FILES for installing the dtrace scripts. 2015-09-18 21:18:44 +00:00
contrib Bring LLVM libunwind snapshot into contrib/llvm/projects 2015-09-23 19:30:46 +00:00
crypto Fix OpenSSH multiple vulnerabilities by backporting three changes 2015-08-25 20:48:37 +00:00
etc The "automount" rc script should depend on "automountd", not the other 2015-09-18 06:54:52 +00:00
games Correctly case FreeBSD in my entry in the tips file 2015-09-08 22:51:10 +00:00
gnu Fix installation of 32bit libraries after r288074. 2015-09-21 21:44:02 +00:00
include Import LLVM libunwind snapshot revision 246528 2015-09-23 19:02:06 +00:00
kerberos5 Move setting of LDFLAGS to the modules which require it actually, as 2015-08-27 17:16:18 +00:00
lib Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-23 16:16:16 +00:00
libexec META_MODE: No need to fix the link in this case. 2015-09-18 23:12:38 +00:00
release Whitespace alignment 2015-09-11 22:42:26 +00:00
rescue Add META_MODE support. 2015-06-13 19:20:56 +00:00
sbin Fix /sbin/route to never look up (invalid) interface names through DNS 2015-09-17 16:56:49 +00:00
secure Replace afterinstall: hack from r111083 with 'make delete-old' functionality. 2015-09-19 03:46:10 +00:00
share Fix most cases of bsd.progs.mk running duplicate or missing commands. 2015-09-23 23:20:49 +00:00
sys geom_dev: Use kenv 'dumpdev' in the same way as rc/etc.d/dumpon 2015-09-23 21:08:52 +00:00
targets Connect sesutil(1) and numactl(1) for META_MODE. 2015-09-19 17:47:36 +00:00
tests Use _exit() instead of exit() in child processes created during tests. 2015-09-09 22:54:07 +00:00
tools Delete /etc/autofs/special_noauto when MK_AUTOFS == no 2015-09-21 03:39:13 +00:00
usr.bin Similar to r266147, don't define PROG in the test subdirs. 2015-09-23 21:35:58 +00:00
usr.sbin Fix crash on parsing some inf files 2015-09-22 16:59:41 +00:00
.arcconfig Add repository.callsign, to help arcanist figure out what repo it's 2015-07-02 22:23:52 +00:00
.arclint phabricator related changes: 2015-04-20 20:33:22 +00:00
COPYRIGHT Bump copyright year. 2014-12-31 10:00:43 +00:00
LOCKS
MAINTAINERS Remove cokane@ from MAINTAINERS for 3dfx(4)/tdfx(4) because their email 2014-11-25 05:25:12 +00:00
Makefile Rework r287900 to keep arm64/aarch64 stable in the TARGETS list. 2015-09-17 04:54:49 +00:00
Makefile.inc1 Move DTrace tools to cross-tools stage 2015-09-21 16:07:22 +00:00
ObsoleteFiles.inc Replace afterinstall: hack from r54681 with 'make delete-old' functionality. 2015-09-19 03:51:19 +00:00
README Import OpenSSL 1.0.1p. 2015-07-09 16:41:34 +00:00
UPDATING Add reminder to run etcupdate or mergemaster to get updated 2015-08-29 07:59:31 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree.  See build(7)
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The `buildkernel` and `installkernel` targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process.  See build(7), config(8),
and http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
for more information.

Note: If you want to build and install the kernel with the
`buildkernel` and `installkernel` targets, you might need to build
world before.  More information is available in the handbook.

The kernel configuration files reside in the sys/<arch>/conf
sub-directory.  GENERIC is the default configuration used in release builds.
NOTES contains entries and documentation for all possible
devices, not just those commonly used.


Source Roadmap:
---------------

bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tests		Regression tests which can be run by Kyua.  See tests/README
		for additional information.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html