aboutsummaryrefslogtreecommitdiff
path: root/targets
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2019-12-19 04:49:34 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2019-12-19 04:49:34 +0000
commit0dd6117e9dba3b55f75cd2e329a09fa14a974ac3 (patch)
tree9dc526857ac091dcd4f4291f2ba13c066c570747 /targets
parentcc8e053f271fd87b30411dd9ad03f6047bac840e (diff)
downloadsrc-0dd6117e9dba3b55f75cd2e329a09fa14a974ac3.tar.gz
src-0dd6117e9dba3b55f75cd2e329a09fa14a974ac3.zip
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 MFC of r355618 Reviewed by: bdrewery Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22495
Notes
Notes: svn path=/stable/12/; revision=355905
Diffstat (limited to 'targets')
-rw-r--r--targets/Makefile71
-rw-r--r--targets/Makefile.inc5
2 files changed, 6 insertions, 70 deletions
diff --git a/targets/Makefile b/targets/Makefile
index 8040953c6d1a..7dcec18125a5 100644
--- a/targets/Makefile
+++ b/targets/Makefile
@@ -38,74 +38,6 @@
DIRDEPS_FILTER = Mtargets/*
.endif
-# in theory, this is what we want
-target_dirs = targets targets/pseudo
-# these tweak how we do it
-target_prefix = pkg- build-
-DIRDEPS := ${.TARGETS:Nall:${target_prefix:@p@S,^$p,,@:ts:}:@t@${target_dirs:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@}
-
-all_machine_list = ${ALL_MACHINE_LIST} host common
-
-.if ${DIRDEPS:Mtargets/pseudo/*} != ""
-# all bets are off
-PKG_MACHINE_LIST = ${all_machine_list}
-.endif
-
-.if make(check-commit)
-# a special case
-DIRDEPS = targets/pseudo/check-commit
-.if defined(ALL_MACHINES)
-CHECK_MACHINE_LIST = all
-.undef ALL_MACHINES
-.endif
-SHIPDIR = no
-
-.else
-
-.if defined(ALL_MACHINES)
-DIRDEPS := ${DIRDEPS:O:u:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@}
-.undef ALL_MACHINES
-PKG_MACHINE_LIST ?= ${DIRDEPS:E:O:u}
-.elif empty(REQUESTED_MACHINE)
-# the above may be insufficient.
-# some packages only support one machine which may not be ${MACHINE}
-# some support multiple, in which case unless ALL_MACHINES is defined
-# we only want ${MACHINE}
-plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@}
-.if ${plain} != ${DIRDEPS}
-qual := ${DIRDEPS:${plain:${M_ListToSkip}}:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@}
-DIRDEPS := ${plain} ${qual}
-PKG_MACHINE_LIST ?= ${MACHINE} ${qual:E:O:u}
-.endif
-.else
-# check that a .MAKE.DEPENDFILE exists
-DIRDEPS := ${.MAKE.DEPENDFILE_PREFERENCE:T:@m@${DIRDEPS:@d@${exists(${SRCTOP}/$d/$m):?$d:}@}@:O:u}
-.endif
-.if !empty(PKG_MACHINE_LIST)
-.if ${PKG_MACHINE_LIST:Mdepend} != ""
-PKG_MACHINE_LIST = ${ALL_MACHINE_LIST}
-.endif
-PKG_MACHINE_LIST := ${PKG_MACHINE_LIST}
-.endif
-.endif
-
-# we don't use DIRDEPS_FILTER, since we only want it to
-# apply to this initial list
-.if !empty(REQUESTED_MACHINE) && !empty(DIRDEPS)
-# this is a variant of the logic above, we want plain
-# but need to filter the qualified DIRDEPS to REQUESTED_MACHINE
-plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@}
-.if !empty(plain) && ${plain} != ${DIRDEPS}
-qual := ${DIRDEPS:${plain:${M_ListToSkip}}:M*.${REQUESTED_MACHINE}}
-.if empty(qual)
-qual := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE:T}):?$d.${.MAKE.DEPENDFILE:E}:}@}
-.endif
-DIRDEPS := ${plain} ${qual}
-.endif
-.if empty(DIRDEPS)
-.error ${REQUESTED_MACHINE} is not appropriate for ${.TARGETS}
-.endif
-.endif
.if !empty(build_options)
build_options := ${build_options:O:u}
@@ -115,6 +47,9 @@ $v = yes
.export ${build_options}
.endif
+# this does the work
+.include <dirdeps-targets.mk>
+
.if !empty(DIRDEPS)
# This is printed as we read the makefile
# so provides a useful clue as to when we really started.
diff --git a/targets/Makefile.inc b/targets/Makefile.inc
index 2dc3b8155824..9ef94473f647 100644
--- a/targets/Makefile.inc
+++ b/targets/Makefile.inc
@@ -20,11 +20,12 @@ PKG_METHOD = no
.endif
.endif
+.MAIN: all
+
# The makefile in subdirs should set this to something useful
# the default should do nothing.
PKG_METHOD ?= none
-
-.MAIN: all
+none:
.if ${build-*:${M_L_TARGETS}} != ""
# just build the bits, skip packaging