summaryrefslogtreecommitdiff
path: root/targets
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2019-12-11 17:38:15 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2019-12-11 17:38:15 +0000
commit312809fe7fefbc8d5caa2b59089a5d9266378057 (patch)
treed27e6f766ba2a6b544e5529b800f0313971983b2 /targets
parent2c9a9dfc187d171de6b92654d71b977f067ed641 (diff)
downloadsrc-test-312809fe7fefbc8d5caa2b59089a5d9266378057.tar.gz
src-test-312809fe7fefbc8d5caa2b59089a5d9266378057.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 Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22495
Notes
Notes: svn path=/head/; revision=355618
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 8040953c6d1a6..7dcec18125a52 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 2dc3b8155824c..9ef94473f6471 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