summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2018-12-06 00:13:35 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2018-12-06 00:13:35 +0000
commit14ed4acf373acf4a08f80acf1689d5f967460af0 (patch)
treebeec9a380ea6fe2383a4876e5a908622d6e16edf /mk
parenta5422567f996e7316e1e9471b8b993f146212fcd (diff)
downloadsrc-test2-14ed4acf373acf4a08f80acf1689d5f967460af0.tar.gz
src-test2-14ed4acf373acf4a08f80acf1689d5f967460af0.zip
Notes
Diffstat (limited to 'mk')
-rw-r--r--mk/ChangeLog22
-rw-r--r--mk/dirdeps-options.mk13
-rw-r--r--mk/dirdeps.mk6
-rw-r--r--mk/gendirdeps.mk20
-rw-r--r--mk/install-mk4
-rw-r--r--mk/meta.autodep.mk16
-rw-r--r--mk/meta.stage.mk12
7 files changed, 70 insertions, 23 deletions
diff --git a/mk/ChangeLog b/mk/ChangeLog
index 3bc1976fcfc3..ce8ac5361a4d 100644
--- a/mk/ChangeLog
+++ b/mk/ChangeLog
@@ -1,3 +1,25 @@
+2018-09-19 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * install-mk (MK_VERSION): 20180919
+
+ * dirdeps-options.mk: .undef cannot handle var that expands to
+ more than one var.
+
+2018-07-08 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * meta.stage.mk: allow wildcards in STAGE_FILES.* etc.
+
+2018-06-01 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * meta.autodep.mk: export META_FILES to avoid command line limit
+ * gendirdeps.mk: if we have lots of .meta files put them in
+ an @list
+
+2018-05-28 Simon J Gerraty <sjg@beast.crufty.net>
+
+ * dirdeps-options.mk: use local.dirdeps-options.mk
+ not local.dirdeps-option.mk
+
2018-04-20 Simon J Gerraty <sjg@beast.crufty.net>
* install-mk (MK_VERSION): 20180420
diff --git a/mk/dirdeps-options.mk b/mk/dirdeps-options.mk
index b6164cfa299a..4f74c02e1b8c 100644
--- a/mk/dirdeps-options.mk
+++ b/mk/dirdeps-options.mk
@@ -1,4 +1,4 @@
-# $Id: dirdeps-options.mk,v 1.5 2018/04/18 15:53:57 sjg Exp $
+# $Id: dirdeps-options.mk,v 1.9 2018/09/20 00:07:19 sjg Exp $
#
# @(#) Copyright (c) 2018, Simon J. Gerraty
#
@@ -25,7 +25,7 @@
# If a Makefile.depend.options file exists, it will be included by
# dirdeps.mk and meta.autodep.mk
#
-# We include local.dirdeps-option.mk which may also define DIRDEPS.*
+# We include local.dirdeps-options.mk which may also define DIRDEPS.*
# for options.
#
# Thus a directory, that is affected by an option FOO would have
@@ -35,7 +35,7 @@
# DIRDEPS.FOO.yes
# DIRDEPS.FOO.no
# to whatever applies for that dir, or it can rely on globals
-# set in local.dirdeps-option.mk
+# set in local.dirdeps-options.mk
# Either way, we will .undef DIRDEPS.* when done.
# This should have been set by Makefile.depend.options
@@ -43,7 +43,7 @@
DIRDEPS_OPTIONS ?=
# pickup any DIRDEPS.* we need
-.-include <local.dirdeps-option.mk>
+.-include <local.dirdeps-options.mk>
.if ${.MAKE.LEVEL} == 0
# :U below avoids potential errors when we :=
@@ -52,7 +52,10 @@ DIRDEPS += ${DIRDEPS.$o.${MK_$o:U}:U}
.endfor
DIRDEPS := ${DIRDEPS:O:u}
# avoid cross contamination
-.undef ${DIRDEPS_OPTIONS:tu:@o@DIRDEPS.$o.yes DIRDEPS.$o.no@}
+.for o in ${DIRDEPS_OPTIONS:tu}
+.undef DIRDEPS.$o.yes
+.undef DIRDEPS.$o.no
+.endfor
.else
# whether options are enabled or not,
# we want to filter out the relevant DIRDEPS.*
diff --git a/mk/dirdeps.mk b/mk/dirdeps.mk
index 5df66e58f7ff..a84e0dde44e3 100644
--- a/mk/dirdeps.mk
+++ b/mk/dirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.95 2018/04/23 17:53:56 sjg Exp $
+# $Id: dirdeps.mk,v 1.96 2018/06/20 22:26:39 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -731,6 +731,8 @@ DIRDEPS =
.info loading ${_m} for ${d:E}
.endif
.include <${_m}>
+.else
+.-include <local.dirdeps-missing.mk>
.endif
.endif
.endif
@@ -746,7 +748,7 @@ DIRDEPS =
DEP_RELDIR := ${RELDIR}
_DEP_RELDIR := ${RELDIR}
# Since we are/should be included by .MAKE.DEPENDFILE
-# is is a final opportunity to add/hook global rules.
+# This is a final opportunity to add/hook global rules.
.-include <local.dirdeps-build.mk>
# pickup local dependencies
diff --git a/mk/gendirdeps.mk b/mk/gendirdeps.mk
index d8f900630ac4..e04f8390cae9 100644
--- a/mk/gendirdeps.mk
+++ b/mk/gendirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: gendirdeps.mk,v 1.38 2018/03/10 00:53:52 sjg Exp $
+# $Id: gendirdeps.mk,v 1.39 2018/06/08 01:25:31 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -171,11 +171,27 @@ GENDIRDEPS_SEDCMDS += \
# we canonicalize them to keep things simple
# if we are using a split-fs sandbox, it gets a little messier.
_objtop := ${_OBJTOP:tA}
+
+# some people put *.meta in META_XTRAS to make sure we get here
+_meta_files := ${META_FILES:N\*.meta:O:u}
+# assume a big list
+_meta_files_arg= @meta.list
+.if empty(_meta_files) && ${META_FILES:M\*.meta} != ""
+# XXX this should be considered a bad idea,
+# since we cannot ignore stale .meta
+x != cd ${_OBJDIR} && find . -name '*.meta' -print -o \( -type d ! -name . -prune \) | sed 's,^./,,' > meta.list; echo
+.elif ${_meta_files:[#]} > 500
+.export _meta_files
+x != echo; for m in $$_meta_files; do echo $$m; done > meta.list
+.else
+_meta_files_arg:= ${_meta_files}
+.endif
+
dir_list != cd ${_OBJDIR} && \
${META2DEPS_CMD} MACHINE=${MACHINE} \
SRCTOP=${SRCTOP} RELDIR=${RELDIR} CURDIR=${_CURDIR} \
${META2DEPS_ARGS} \
- ${META_FILES:O:u} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
+ ${_meta_files_arg} | ${META2DEPS_FILTER} ${_skip_gendirdeps} \
sed ${GENDIRDEPS_SEDCMDS}
.if ${dir_list:M*ERROR\:*} != ""
diff --git a/mk/install-mk b/mk/install-mk
index 70233fc23ed8..886c264bd808 100644
--- a/mk/install-mk
+++ b/mk/install-mk
@@ -55,7 +55,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: install-mk,v 1.156 2018/04/22 04:42:47 sjg Exp $
+# $Id: install-mk,v 1.160 2018/09/20 00:07:19 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
@@ -70,7 +70,7 @@
# sjg@crufty.net
#
-MK_VERSION=20180420
+MK_VERSION=20180919
OWNER=
GROUP=
MODE=444
diff --git a/mk/meta.autodep.mk b/mk/meta.autodep.mk
index c33c5d809447..9cb3f14ea0c6 100644
--- a/mk/meta.autodep.mk
+++ b/mk/meta.autodep.mk
@@ -1,4 +1,4 @@
-# $Id: meta.autodep.mk,v 1.48 2018/04/15 06:30:04 sjg Exp $
+# $Id: meta.autodep.mk,v 1.50 2018/06/08 01:25:31 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -20,9 +20,11 @@ __${_this}__: .NOTMAIN
.-include <local.autodep.mk>
+PICO?= .pico
+
.if defined(SRCS)
# it would be nice to be able to query .SUFFIXES
-OBJ_EXTENSIONS+= .o .po .lo .So
+OBJ_EXTENSIONS+= .o .po .lo ${PICO}
# explicit dependencies help short-circuit .SUFFIX searches
SRCS_DEP_FILTER+= N*.[hly]
@@ -178,7 +180,7 @@ DEPEND_SUFFIXES += .c .h .cpp .hpp .cxx .hxx .cc .hh
@case "${.MAKE.META.FILES:T:M*.po.*}" in \
*.po.*) mv $@.${.MAKE.PID} $@;; \
*) { cat $@.${.MAKE.PID}; \
- sed 's,\.So:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
+ sed 's,\${PICO}:,.o:,;s,\.o:,.po:,' $@.${.MAKE.PID}; } | sort -u > $@; \
rm -f $@.${.MAKE.PID};; \
esac
.else
@@ -243,7 +245,7 @@ META_FILES = *.meta
.elif ${OPTIMIZE_OBJECT_META_FILES:Uno:tl} == "no"
META_FILES = ${.MAKE.META.FILES:T:N.depend*:O:u}
.else
-# if we have 1000's of .o.meta, .So.meta etc we need only look at one set
+# if we have 1000's of .o.meta, ${PICO}.meta etc we need only look at one set
# it is left as an exercise for the reader to work out what this does
META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O:u} \
${.MAKE.META.FILES:T:M*.${.MAKE.META.FILES:M*o.meta:R:E:O:u:[1]}.meta:O:u}
@@ -260,6 +262,9 @@ META_FILES = ${.MAKE.META.FILES:T:N.depend*:N*o.meta:O:u} \
.if !empty(GENDIRDEPS_FILTER)
.export GENDIRDEPS_FILTER
.endif
+# export to avoid blowing command line limit
+META_FILES := ${META_XTRAS:U:O:u} ${META_FILES:U:T:O:u:${META_FILE_FILTER:ts:}}
+.export META_FILES
.endif
# we might have .../ in MAKESYSPATH
@@ -270,8 +275,7 @@ ${_DEPENDFILE}: ${_depend} ${.PARSEDIR}/gendirdeps.mk ${META2DEPS} $${.MAKE.MET
SKIP_GENDIRDEPS='${SKIP_GENDIRDEPS:O:u}' \
DPADD='${FORCE_DPADD:O:u}' ${_gendirdeps_mutex} \
MAKESYSPATH=${_makesyspath} \
- ${.MAKE} -f gendirdeps.mk RELDIR=${RELDIR} _DEPENDFILE=${_DEPENDFILE} \
- META_FILES='${META_XTRAS:O:u} ${META_FILES:T:O:u:${META_FILE_FILTER:ts:}}')
+ ${.MAKE} -f gendirdeps.mk RELDIR=${RELDIR} _DEPENDFILE=${_DEPENDFILE})
@test -s $@ && touch $@; :
.endif
diff --git a/mk/meta.stage.mk b/mk/meta.stage.mk
index 5c54f81fb378..320ffcca80a0 100644
--- a/mk/meta.stage.mk
+++ b/mk/meta.stage.mk
@@ -1,4 +1,4 @@
-# $Id: meta.stage.mk,v 1.55 2017/10/27 01:17:09 sjg Exp $
+# $Id: meta.stage.mk,v 1.56 2018/07/08 17:12:54 sjg Exp $
#
# @(#) Copyright (c) 2011-2017, Simon J. Gerraty
#
@@ -141,7 +141,7 @@ _STAGE_AS_BASENAME_USE: .USE .dirdep ${.TARGET:T}
.if !empty(STAGE_INCSDIR)
.if !empty(STAGE_INCS)
-stage_incs: ${STAGE_INCS}
+stage_incs: ${STAGE_INCS:N*\**}
.endif
.if target(stage_incs) || !empty(.ALLTARGETS:Mstage_includes)
STAGE_TARGETS += stage_incs
@@ -156,7 +156,7 @@ stage_incs: .dirdep
.if !empty(STAGE_LIBDIR)
.if !empty(STAGE_LIBS)
-stage_libs: ${STAGE_LIBS}
+stage_libs: ${STAGE_LIBS:N*\**}
.endif
.if target(stage_libs)
STAGE_TARGETS += stage_libs
@@ -191,7 +191,7 @@ CLEANFILES += ${STAGE_SETS:@s@stage*$s@}
# some makefiles need to populate multiple directories
.for s in ${STAGE_SETS:O:u}
.if !empty(STAGE_FILES.$s)
-stage_files.$s: ${STAGE_FILES.$s}
+stage_files.$s: ${STAGE_FILES.$s:N*\**}
.endif
.if target(stage_files.$s) || target(stage_files${s:S,^,.,:N._default})
STAGE_TARGETS += stage_files
@@ -262,7 +262,7 @@ CLEANFILES += ${STAGE_AS_SETS:@s@stage*$s@}
# both operations happen together
.for s in ${STAGE_AS_SETS:O:u}
.if !empty(STAGE_AS.$s)
-stage_as.$s: ${STAGE_AS.$s}
+stage_as.$s: ${STAGE_AS.$s:N*\**}
.endif
.if target(stage_as.$s)
STAGE_TARGETS += stage_as
@@ -277,7 +277,7 @@ stage_as.$s: .dirdep
.endif
.if !empty(STAGE_AS_AND_SYMLINK.$s)
-stage_as_and_symlink.$s: ${STAGE_AS_AND_SYMLINK.$s}
+stage_as_and_symlink.$s: ${STAGE_AS_AND_SYMLINK.$s:N*\**}
.endif
.if target(stage_as_and_symlink.$s)
STAGE_TARGETS += stage_as_and_symlink