freebsd-dev/tools/build
Jessica Clarke 62f243acea tools/build/make.py: Make --with-default-sys-path mirror usr.bin/bmake
The top-level Makefile passes -m to its sub-makes in order to ensure
they use the in-tree mk files in share/mk, but the top-level make itself
has to rely on whatever environment the bmake used has. For FreeBSD, we
configure the system bmake with .../share/mk:/usr/share/mk, which means
it will pick up src's share/mk whenever run from within the src tree,
but currently for non-FreeBSD we configure our bootstrap bmake only with
bmake's own mk files. This is mostly compatible, with two exceptions:

1. "targets" runs at the top level, but needs TARGET_MACHINE_LIST and
   the corresponding MACHINE_ARCH_LIST_${target}, otherwise it will just
   print an empty list.

2. "universe" and "universe-toolchain", when run at the top level (i.e.
   not via the various wrappers around universe like tinderbox), end up
   failing in universe-toolchain itself with:

     bmake[1]: "/path/to/freebsd/share/mk/src.sys.obj.mk" line 112: Cannot use MAKEOBJDIR=
     Unset MAKEOBJDIR to get default:  MAKEOBJDIR='${.CURDIR:S,^${SRCTOP},${OBJTOP},}'

By including .../share/mk in the default sys path like FreeBSD's system
bmake we ensure that we get the in-tree mk files for the top-level make,
not just sub-makes, and avoid such issues.

Note that we cannot (yet) stop using the installed mk files, since the
MAKEOBJDIRPREFIX check in Makefile runs in the object directory and uses
env -i, thereby losing the MAKESYSPATH exported by src.sys.env.mk. Other
such issues may also exist, though are likely rare if so.

Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D41544
2023-08-23 17:56:56 +01:00
..
bootstrap-m4 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
cross-build Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libc-bootstrap Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
make_check Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
mk Fix GoogleTest 1.14.0 import 2023-08-18 19:33:58 -07:00
options Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
test-includes test-includes: improve portability 2022-03-22 20:23:22 +00:00
beinstall.sh Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
check-links.sh Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
checkstyle9.pl checkstyle9.pl: Add check for bad email 2023-06-12 10:08:17 -06:00
depend-cleanup.sh Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
dummy.c Remove $FreeBSD$: one-line .h pattern 2023-08-16 11:54:23 -06:00
fcntl.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
freebsd-yeet.pl Update freebsd-yeet for mfc 2023-08-21 19:37:20 -06:00
fspacectl.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
futimens.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
make.py tools/build/make.py: Make --with-default-sys-path mirror usr.bin/bmake 2023-08-23 17:56:56 +01:00
Makefile kbdcontrol: Support building as a bootstrap tool on old and non-FreeBSD 2023-08-22 21:00:28 +01:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
stat.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
stdlib.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
strings.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
utimensat.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00