Commit Graph

45 Commits

Author SHA1 Message Date
bdrewery
a7e487652a META_MODE: Delete build targets that fail.
If a meta mode change is triggered but then the build fails then the
next build will not retrigger meta mode. This only prevented by
removing the target on rebuild or on the failure to rebuild.

Sponsored by:	DellEMC
2019-06-15 17:08:28 +00:00
bdrewery
c3d7eb1d7b Follow-up r320061: Need to respect make.conf/env LIBDIR overrides.
This fixes the lib32 build from creating all stale .depend files.

X-MFC-With:	320061
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-06-19 18:08:02 +00:00
bdrewery
df1398b14a WITH_META_MODE: End each ERROR_CMD CMD line with ';'.
This makes it easier to debug multi-line command failures.

X-MFC-With:	r319862
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-06-16 21:48:42 +00:00
bdrewery
af137d191a WITH_META_MODE: Don't try showing command if .ERROR_META_FILE is empty.
This was sed'ing on stdin for failing .PHONY targets.

Reported by:	Mark Millard
X-MFC-With:	r319862
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-06-16 04:28:10 +00:00
bdrewery
55bd2850e7 META_MODE: Show .ERROR_CMD in error.
This uses a hack to get the CMD from the meta file rather than
.ERROR_CMD since bmake currently blanks the value for non-jobs
mode.

Reviewed by:	sjg (indirectly)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-06-12 19:13:29 +00:00
bdrewery
107ea631d3 WITH_META_MODE: Enable printing of some of make's environment on error.
This will print a set of variables from make on error using
MAKE_PRINT_VAR_ON_ERROR.  It is already enabled for the DIRDEPS_BUILD.
It may make sense to enable this in the non-meta mode as well once
people are more used to its more verbose error output.

This makes it much simpler to see which .meta file is used when a
command files so that it may be inspected for the build command.

Suggested by:	sjg
Approved by:	re (implicit)
Sponsored by:	EMC / Isilon Storage Division
2016-06-14 16:20:25 +00:00
bdrewery
a8b775f4b7 Follow-up r297835: Let the intented default cookie work.
This happened to work for not prepending .OBJDIR twice but broke the
other case of prepending it when needed.

Pointyhat to:	bdrewery
Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:45 +00:00
bdrewery
c41790fef1 Rework META_TARGETS so that it automatically adds META_DEPS to the targets.
This will only be done if the target is defined, so if the target is
defined after bsd.sys.mk is included then it needs to manually add
${META_DEPS} still.

Sponsored by:	EMC / Isilon Storage Division
2016-04-14 21:04:42 +00:00
bdrewery
95166937b1 META_MODE: Support targets that already have .OBJDIR in them for META_COOKIE.
Sponsored by:	EMC / Isilon Storage Division
2016-04-11 21:12:24 +00:00
bdrewery
c473d9aeb7 Define OBJTOP earlier if possible for use in targets.
Sponsored by:	EMC / Isilon Storage Division
2016-03-31 14:48:17 +00:00
bdrewery
94e9e924f7 Follow-up r296700: Fix incorrectly declaring these as .MAIN.
This broke bootstrap-tools at least for DIRDEPS_BUILD.

Sponsored by:	EMC / Isilon Storage Division
2016-03-13 20:51:45 +00:00
bdrewery
c3a42f86a7 META_MODE: We can only use a cookie if filemon is being used.
Sponsored by:	EMC / Isilon Storage Divsion
2016-03-11 23:45:32 +00:00
bdrewery
88db8d87c1 META_MODE: Simplify the META_COOKIE handling to use .USE/.USEBEFORE.
Extend it to other cases of meta mode cookies so they get the proper rm
cookie behavior when a .meta file detects it needs to rebuild and fails.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:28 +00:00
bdrewery
24b7e3c54f DIRDEPS_BUILD: Remove the cookie when target is out-of-date.
The meta file may decide the target is out of date but nothing
ensures that the *next* build will build this target if it
fails this time for some reason; it is still out-of-date
until it succeeds.

Convert the include/ cookie usage to the global versions.

Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:44:27 +00:00
bdrewery
2beef85d71 Define .MAKE.MODE to normal to avoid the need for :U later.
Sponsored by:	EMC / Isilon Storage Division
2016-01-19 22:41:44 +00:00
bdrewery
2307c1cb1a META MODE: Show PATH on errors.
Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:44:31 +00:00
sjg
206f180a1a Rename META_MODE option to DIRDEPS_BUILD
This allows META_FILES option to be renamed META_MODE.
Also add META_COOKIE_TOUCH for use in targets that can benefit
from a cookie when in meta mode.

Differential Revision:	https://reviews.freebsd.org/D4153
Reviewed by:	bdrewery
2015-11-14 03:24:48 +00:00
sjg
9b22f67e32 Move include of make.conf back to its old position.
This means moving include of local.sys.mk and src.sys.mk too.
Introduce new includes to take the early slot, for the purpose
of being able to influence toolchains and the like.

Differential Revision:	D2860
Reviewed by:	imp
2015-06-19 14:56:24 +00:00
sjg
03f5bcf460 Skip MAKE_PRINT_VAR_ON_ERROR unless we are doing META_MODE
with all the recursion in normal build it is too much noise.
2015-06-15 21:09:18 +00:00
sjg
008d7c831f Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
sjg
7687e7609c Allow AUTO_OBJ with out META_MODE.
Remove frobbing of SRCCONF etc - not strictly relevant to meta mode.
2015-05-29 06:45:32 +00:00
sjg
71dd385569 Move META_MODE bits to local.meta.sys.mk
By moving META_MODE bits from local.sys.mk, they are easier
to skip when MK_META_MODE=no

Update some filters to cope with sync from head.

If buildworld etc or WITHOUT_META_MODE disable all the META_MODE
related options.
2015-05-26 21:44:15 +00:00
sjg
3d790601e4 Move include of auto.obj.mk to sys.mk 2015-05-24 02:45:15 +00:00
sjg
d7cd1d425c Merge head from 7/28 2014-08-19 06:50:54 +00:00
sjg
03e1e7777c Crude cross-build support thanks to clang 2014-07-25 20:44:04 +00:00
sjg
24a7f90a97 export sanitized MAKESYSPATH in case .../ appears in default syspath. 2014-06-25 00:19:58 +00:00
sjg
ab341e179e Use _LIBDIR in STAGE_LIBDIR so we DTRT for PRIVATE libs.
We now use SYSROOT
and (for now) non-shared toolchain when building for host.
2014-05-16 14:58:48 +00:00
sjg
8195b9a30b When bootstrapping tools MACHINE==host and EARLY_BUILD defined,
so not use any of stage tree.

M_whence only first value counts
2014-05-10 00:23:12 +00:00
sjg
5978bd2e08 Avoid /etc/make.conf
and make it easier to deal with compiler updates
2014-05-05 18:15:18 +00:00
sjg
ab7cd266bc Handle the different expectations of MACHINE_ARCH b/w buildworld etc
and dirdeps.
2013-10-16 16:05:12 +00:00
sjg
5892775af6 Some cleanup and re-org.
Also update CFLAGS_LAST.clang to match new compiler version.
Add BOOT_MACHINE_DIR (so we can stick to unqualified Makefile.depend)
2013-10-12 23:46:41 +00:00
sjg
b3b7fc783e Include more stuff within the meta mode block, so that buildworld
can function normally.

Submitted by:	John Van Horne
2013-06-04 15:25:57 +00:00
sjg
e7beb35a3f Cleanup some backwards compat stuff we do not need.
Introduce TARGET_OBJ_SPEC (derrived from TARGET_SPEC_VARS)
so we can build something like universe.
2013-05-11 01:03:29 +00:00
sjg
76506db45d Add stage-install.sh so we can do away with the need to have
$STAGE_OBJTOP/include for src/include.
2013-04-19 18:45:03 +00:00
sjg
957bb16f6a If building for "host" and we do not have Makefile.depend.host;
do not update it.
This allows us to avoid populating the tree with Makefile.depend.host
that aren't absolutely necessary.
2013-03-17 03:09:08 +00:00
sjg
1eca611df3 We need .OBJDIR done earlier 2013-03-17 01:53:47 +00:00
sjg
b44c493437 Apply DEP_DIRDEPS_FILTER.${DEP_MACHINE} as needed.
Use DEP_DIRDEPS_FILTER.host to supress dependencies for host tools.
2013-03-12 17:21:03 +00:00
sjg
01d132e6de Control default .MAKE.DEPENDFILE indepentend of .MAKE.DEPENDFILE_PREFERENCE 2013-03-08 01:51:32 +00:00
sjg
314150ce46 Do no assume ${DESTDIR}/usr/include is always valid 2013-02-20 00:13:26 +00:00
sjg
ac20e093eb If MAKESYSPATH contained .../ entry resolve it so that it still works
when we launch make from obj tree.
If we don't have sysroot support we need some c++ and clang specific
include dirs in the stage tree.
2013-02-16 01:19:18 +00:00
sjg
5fe646bf30 Use STAGE_OBJTOP for STAGE_SYMLINKS_DIR etc 2013-01-29 00:11:21 +00:00
sjg
cd8e42e799 Add TIME_STAMP 2012-11-09 05:43:15 +00:00
sjg
237c973dc2 Need CXXFLAGS_LAST and LDFLAGS_LAST 2012-11-08 21:38:26 +00:00
sjg
778e93c51a Sync from head 2012-11-04 02:52:03 +00:00
marcel
9dd41e3647 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00