Commit Graph

34 Commits

Author SHA1 Message Date
Simon J. Gerraty
92a4e8b348 dirdeps.mk allow for TARGET_SPEC_VARS.host
While *most* projects need only DEP_MACHINE for host, there is always
an exception.  So we allow for TARGET_SPEC_VARS.host to be a subset of
TARGET_SPEC_VARS.  The default will *just work* for most projects.

We set DEP_TARGET_SPEC_VARS and hence DEP_TARGET_SPEC based on
DEP_MACHINE.  Allow for M_dep_qual_fixes.host to be different too and
take care to apply the right set.
2023-05-15 13:25:10 -07:00
Simon J. Gerraty
41d638f203 Update dirdeps.mk
Ensure host build_dirs are not qualified.
2023-05-13 14:05:56 -07:00
Simon J. Gerraty
bee3d4bf8e Move DIRDEPS_BUILD settings to sys.dirdeps.mk
When originally implemented, there was no distinction between
DIRDEPS_BUILD and META_MODE, they were one and the same.

META_MODE however is useful by itself, but since meta.sys.mk
had lots of settings related to DIRDEPS_BUILD its use was limited
to DIRDEPS_BUILD.

Move (most) DIRDEPS_BUILD related items to sys.dirdeps.mk
so that meta.sys.mk can be used for just META_MODE.
There is of course some bluring of the lines, so settings remain
in meta.sys.mk

Add MK_META_ERROR_TARGET to enable the META_MODE .ERROR target
independent of DIRDEPS_BUILD, it copies failed .meta files to ${SB}/error
to make it easier to identify the cause of build failures.

Since sys.dirdeps.mk should be included first, most of
local.meta.sys.mk becomes local.sys.dirdeps.mk
and some other bits need to move to local.sys.dirdeps.env.mk

Also fix dirdeps.mk to not add CURDIR to DIRDEPS when it is SRCTOP.

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D40053
2023-05-11 16:15:04 -07:00
Simon J. Gerraty
ba4d333364 dirdeps.mk for host* DEP_TARGET_SPEC is just DEP_MACHINE
This helps avoid ugly noise in dirdeps.cache on Linux.
2023-05-04 11:29:33 -07:00
Simon J. Gerraty
fb30bb0d4d dirdeps.mk ensure M_dep_qual_fixes is applied 2023-04-22 18:00:45 -07:00
Simon J. Gerraty
9eaf82f27c dirdeps.mk guard against inclusion from Makefile.depend.options
A typo in Makefile.depend.options including dirdeps.mk rather than
dirdeps-options.mk can result in infinite recursion - don't let that happen.

Reviewed by:	stevek
2023-04-18 20:15:25 -07:00
Simon J. Gerraty
a3d015bbf1 Update dirdeps.mk
Fix handling of local.dirdeps-missing.mk
we need to reset DEP_RELDIR and DIRDEPS just as if including
a Makefile.depend*

Also fix a typo in DIRDEP_LOADAVG_REPORT
and improve debug output.

Reviewed by: stevek
2023-04-16 18:17:26 -07:00
Simon J. Gerraty
525d1e204b Update dirdeps.mk
Latest dirdeps.mk is far more efficient when generating
DIRDEPS_CACHE.

Update dirdeps-options.mk to allow DEP_RELDIR to factor
into option processing. This is not very interesting if all
options are global.
2022-04-23 14:44:17 -07:00
Simon J. Gerraty
3b26e5a453 Update dirdeps.mk et al to 20211212 versions
dirdeps.mk: simplify computation of qualified vs unqualified dirdeps.
	Note the importance of avoiding unresolved variables in DIRDEPS
	Fix DIRDEP_LOADAVG_REPORT - expr(1) fails if expression evaluates to 0
	Trim ${SRCTOP}/ from debug etc messages to make comparison easier.
	Include number of DIRDEPS in debug output.
	Trim ${SRCTOP}/ when exporting to env while building DIRDEPS_CACHE
	to help avoid env exhaustion.
	Use DIRDEPS_ALL_MACHINES_FILTER to better handle ALL_MACHINES
	in complex build environments.

dirdeps-options.mk: use separate .undef for each variable

dirdeps-targets.mk: allow for '.' in DIRDEPS_TARGETS_DIRS

meta.autodep.mk: leverage ${.SUFFIXES} if we can.

meta.sys.mk: allow use in META_MODE vs DIRDEPS_BUILD

meta2deps.py: compute a list of dirdep extensions that map to current
	TARGET_SPEC to avoid confusion.

Reviewed by: stevek
2021-12-18 13:37:07 -08:00
Simon J. Gerraty
960b77be8f Update dirdeps.mk et al to latest
Move some local tweaks to local.*.mk

Reviewed by:	bdrewery
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D27300
2020-11-24 21:45:38 +00:00
Simon J. Gerraty
312809fe7f Update dirdeps.mk and gendirdeps.mk
The env space consumed by exporting all libc's .meta files
left little room for command line,
so unexport when done.

Update dirdeps.mk to latest and add
dirdeps-targets.mk to simplify/update targets/Makefile

Makefile changes to go with Makefile.depend changes in D22494

Reviewed by:	 bdrewery
MFC after:	1 week
Sponsored by:   Juniper Networks
Differential Revision:  https://reviews.freebsd.org/D22495
2019-12-11 17:38:15 +00:00
Simon J. Gerraty
a6589ab760 Update dirdeps.mk et al to latest
dirdeps.mk and meta.autodep.mk will now look for
Makefile.depend.options
to handle optional dependencies, the work is all done by
dirdeps-options.mk

Also update to latest meta.stage.mk and gendirdeps.mk

Reviewed by:	bdrewery
Differential Revision:	https://reviews.freebsd.org/D15701
2018-08-02 21:33:45 +00:00
Simon J. Gerraty
2dd9e369ef Fix typo in comment. 2017-03-07 01:42:30 +00:00
Simon J. Gerraty
6d4f05fd11 Update dirdeps/meta bits from latest bmake. 2017-03-06 23:13:25 +00:00
Eitan Adler
95f289d5ea remove the the duplicate words from share/ 2017-03-05 18:00:52 +00:00
Simon J. Gerraty
b47b9f6bd8 Update meta* from bmake-20161212 2016-12-23 02:57:00 +00:00
Simon J. Gerraty
0806d0ef5e Update to latest dirdeps.mk
Take advantage of new bmake feature to only consider Makefile.depend
as invalidating DIRDEPS_CACHE.

When bootstrapping allow more filtering via .MAKE.DEPENDFILE_BOOTSTRAP_SED

Move some comments back to where they make sense.

meta.sys.mk: add META_COOKIE_TOUCH and META_NOPHONY to better handle some
targets in meta mode vs non-meta mode.
Also use .MAKE.META.IGNORE_PATHS to ignore mtime of makefiles - which do
not matter in meta mode.
2016-09-09 01:21:35 +00:00
Simon J. Gerraty
30e2910007 Allow -f dirdeps.mk some/dir with no TARGET_MACHINE spec
Use $MACHINE if target does not specify.

Reviewed by:	bdrewery
2016-04-18 22:00:26 +00:00
Simon J. Gerraty
51c71d3e03 Update dirdeps.mk et al
dirdeps.mk: move logic to handle -f dirdeps.mk to inside check
for first read of dirdeps.mk

Also fix handling of WITHOUT_DIRDEPS_BELOW

gendirdeps.mk: pass M2D_EXCLUDES to meta2deps

meta.autodep.mk: if we build with nofilemon, leave a cookie to
prevent updating dependencies until cleaned.

Reviewed by:	bdrewery
2016-04-18 20:56:21 +00:00
Simon J. Gerraty
3bebe7293b Update to bmake-20160315
Archive member handling works again
meta mode, treat missing reads as for writes.

Update dirdeps.mk - much improved startup time.
Update meta.stage.mk - avoid ln when chmod required.
2016-03-18 20:03:09 +00:00
Simon J. Gerraty
be19d90b61 Merge bmake-20160307 2016-03-11 01:35:39 +00:00
Simon J. Gerraty
dba62d8dcf Default MK_META_MODE from MK_DIRDEPS_BUILD
This allows most of the build to simply consider MK_META_MODE

Update to latest dirdeps.mk so we can do:

make -f dirdeps.mk bin/cat.i386

Reviewed by:	bdrewery
2015-11-16 22:50:23 +00:00
Simon J. Gerraty
ccfb965433 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
Simon J. Gerraty
6251c65a82 Latest dirdeps.mk sets DEP_RELDIR for itself.
This helps guard against bugs in manually edited Makefile.depend
files, and avoids the need to call realpath from the Makefile.depend file.
2015-06-08 23:34:04 +00:00
Simon J. Gerraty
71edef51db Latest dirdeps.mk and meta.stage.mk
Add support for dirdeps cache
and allow full path as key for STAGE_AS_*
2015-05-26 21:03:41 +00:00
Simon J. Gerraty
51486565d8 Use latest version 2014-11-20 22:42:40 +00:00
Simon J. Gerraty
10ea6face3 Update to latest versions. 2014-05-05 17:58:00 +00:00
Simon J. Gerraty
707ae8d2e7 When TARGET_SPEC_VARS is non-trivial, we need to apply the same filtering
when setting _machines as we do to _build_dirs.
2013-10-12 23:40:17 +00:00
Simon J. Gerraty
876336c858 Sync latest versions 2013-04-14 01:21:20 +00:00
Simon J. Gerraty
a4b2fbdde2 Don't forget DEP_TARGET_SPEC 2013-03-17 03:07:13 +00:00
Simon J. Gerraty
6c5406e48c Improve DIRDEP filtering.
Allow DEP_SKIP_DIR and DEP_DIRDEPS_FILTER to vary by DEP_MACHINE.
2013-03-17 01:51:23 +00:00
Simon J. Gerraty
4ed4429c63 Latest *dirdeps.mk and meta2deps 2013-02-16 01:16:53 +00:00
Simon J. Gerraty
fbc1b149eb Latest dirdeps etc from Juniper Networks. 2012-11-08 21:14:57 +00:00
Marcel Moolenaar
7750ad47a9 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