Pass make flags to kernel and lib builds
authorkn <kn@openbsd.org>
Mon, 26 Jul 2021 12:47:44 +0000 (12:47 +0000)
committerkn <kn@openbsd.org>
Mon, 26 Jul 2021 12:47:44 +0000 (12:47 +0000)
commitce5d0fa6344ecbdbb8642094267f71e2fd717741
tree239371980f8a8586d9b0234c3fe560c10c2933ea
parent4a58382d425db89491200cff85d7f35c88d4cc53
Pass make flags to kernel and lib builds

Running `make -j4' in /usr/src/distrib/amd64/ramdisk_cd/ et al. executes
make(1) to both build the RAMDISK kernel and build libraries.

Doing so does not propagate the flags specified to the ramdisk_cd
invocation, which in turn means `-j4' for example is ignored and both kernel
and libraries will not be built in parallel.

Pass make(1)'s MFLAGS along to retain relevant flags;  make is clever enough
to separate flags, variable assignments and targets from each other and only
pass along things to `MFLAGS' that'd make sense, i.e. `make -C. -j4 foo=bar'
does *not* pass `-C.' to change directories.
(can be easily tested with `make -p ... | grep MFLAGS'.)

This makes hacking on ramdisks/the installer much faster, espescially since
the `bsd' target does `make clean' and therefore builds a new kernel every
time.

OK deraadt
18 files changed:
distrib/alpha/miniroot/Makefile
distrib/amd64/ramdiskA/Makefile
distrib/amd64/ramdisk_cd/Makefile
distrib/arm64/ramdisk/Makefile
distrib/armv7/ramdisk/Makefile
distrib/hppa/ramdisk/Makefile
distrib/i386/ramdisk/Makefile
distrib/i386/ramdisk_cd/Makefile
distrib/landisk/ramdisk/Makefile
distrib/loongson/ramdisk/Makefile
distrib/luna88k/ramdisk/Makefile
distrib/macppc/ramdisk/Makefile
distrib/octeon/ramdisk/Makefile
distrib/powerpc64/ramdisk/Makefile
distrib/riscv64/ramdisk/Makefile
distrib/sparc64/miniroot/Makefile
distrib/sparc64/ramdisk/Makefile
distrib/sparc64/ramdiskB/Makefile