aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rw-r--r--mk/ChangeLog31
-rw-r--r--mk/dirdeps.mk55
-rw-r--r--mk/install-mk4
-rw-r--r--mk/lib.mk3
-rw-r--r--mk/meta.sys.mk15
-rw-r--r--mk/prog.mk3
6 files changed, 85 insertions, 26 deletions
diff --git a/mk/ChangeLog b/mk/ChangeLog
index de94df7d9aec..483928dc345b 100644
--- a/mk/ChangeLog
+++ b/mk/ChangeLog
@@ -1,3 +1,34 @@
+2016-08-15 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20160815
+
+ * dirdeps.mk (.MAKE.META.IGNORE_FILTER): set filter to only
+ consider Makefile.depend* when checking if DIRDEPS_CACHE is up-to-date.
+
+2016-08-13 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * meta.sys.mk (.MAKE.META.IGNORE_PATHS):
+ in meta mode we can ignore the mtime of makefiles
+
+2016-08-02 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * install-mk (MK_VERSION): 20160802
+
+ * lib.mk (libinstall): depends on beforinstall
+
+ * prog.mk (proginstall): depends on beforinstall
+ patch from Lauri Tirkkonen
+
+ * dirdeps.mk (bootstrap): When bootstrapping; creat
+ .MAKE.DEPENDFILE_DEFAULT and allow additional filtering via
+ .MAKE.DEPENDFILE_BOOTSTRAP_SED
+
+ * dirdeps.mk: move some comments to where they make sense.
+
+2016-07-27 Simon J. Gerraty <sjg@bad.crufty.net>
+
+ * dirdeps.mk (DIRDEPS_CACHE): no dirname.
+
2016-06-02 Simon J. Gerraty <sjg@bad.crufty.net>
* install-mk (MK_VERSION): 20160602
diff --git a/mk/dirdeps.mk b/mk/dirdeps.mk
index 0e5784183fa1..5b0de3d5657a 100644
--- a/mk/dirdeps.mk
+++ b/mk/dirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.67 2016/04/18 21:50:47 sjg Exp $
+# $Id: dirdeps.mk,v 1.73 2016/08/15 19:28:13 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -116,12 +116,17 @@ _DIRDEP_USE_LEVEL?= 0
.if ${.MAKE.LEVEL} == ${_DIRDEP_USE_LEVEL}
# only the first instance is interested in all this
-# First off, we want to know what ${MACHINE} to build for.
-# This can be complicated if we are using a mixture of ${MACHINE} specific
-# and non-specific Makefile.depend*
-
.if !target(_DIRDEP_USE)
+# do some setup we only need once
+_CURDIR ?= ${.CURDIR}
+_OBJDIR ?= ${.OBJDIR}
+
+now_utc = ${%s:L:gmtime}
+.if !defined(start_utc)
+start_utc := ${now_utc}
+.endif
+
.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != ""
# This little trick let's us do
#
@@ -144,15 +149,6 @@ MK_DIRDEPS_CACHE = no
# make sure we get the behavior we expect
.MAKE.SAVE_DOLLARS = no
-# do some setup we only need once
-_CURDIR ?= ${.CURDIR}
-_OBJDIR ?= ${.OBJDIR}
-
-now_utc = ${%s:L:gmtime}
-.if !defined(start_utc)
-start_utc := ${now_utc}
-.endif
-
# make sure these are empty to start with
_DEP_TARGET_SPEC =
@@ -223,6 +219,10 @@ N_notmachine := ${.MAKE.DEPENDFILE_PREFERENCE:E:N*${MACHINE}*:${M_ListToSkip}}
.endif # !target(_DIRDEP_USE)
+# First off, we want to know what ${MACHINE} to build for.
+# This can be complicated if we are using a mixture of ${MACHINE} specific
+# and non-specific Makefile.depend*
+
# if we were included recursively _DEP_TARGET_SPEC should be valid.
.if empty(_DEP_TARGET_SPEC)
# we may or may not have included a dependfile yet
@@ -385,7 +385,7 @@ BUILD_DIRDEPS ?= yes
.if !defined(NO_DIRDEPS) && !defined(NO_DIRDEPS_BELOW)
.if ${MK_DIRDEPS_CACHE} == "yes"
# this is where we will cache all our work
-DIRDEPS_CACHE?= ${_OBJDIR}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
+DIRDEPS_CACHE?= ${_OBJDIR:tA}/dirdeps.cache${.TARGETS:Nall:O:u:ts-:S,/,_,g:S,^,.,:N.}
# just ensure this exists
build-dirdeps:
@@ -397,6 +397,9 @@ M_oneperline = @x@\\${.newline} $$x@
# we do this via sub-make
BUILD_DIRDEPS = no
+# ignore anything but these
+.MAKE.META.IGNORE_FILTER = M*/${.MAKE.DEPENDFILE_PREFIX}*
+
dirdeps: dirdeps-cached
dirdeps-cached: ${DIRDEPS_CACHE} .MAKE
@echo "${TRACER}Using ${DIRDEPS_CACHE}"
@@ -669,7 +672,10 @@ _DEP_RELDIR := ${RELDIR}
make(bootstrap-recurse) || \
make(bootstrap-empty))
-.if exists(${.CURDIR}/${.MAKE.DEPENDFILE:T})
+# if we are bootstrapping create the default
+_want = ${.CURDIR}/${.MAKE.DEPENDFILE_DEFAULT:T}
+
+.if exists(${_want})
# stop here
${.TARGETS:Mboot*}:
.elif !make(bootstrap-empty)
@@ -679,12 +685,19 @@ _src != cd ${.CURDIR} && for m in ${.MAKE.DEPENDFILE_PREFERENCE:T:S,${MACHINE},*
.error cannot find any of ${.MAKE.DEPENDFILE_PREFERENCE:T}${.newline}Use: bootstrap-empty
.endif
-_src?= ${.MAKE.DEPENDFILE:T}
+_src?= ${.MAKE.DEPENDFILE}
+
+.MAKE.DEPENDFILE_BOOTSTRAP_SED+= -e 's,${_src:E},${MACHINE},g'
# just create Makefile.depend* for this dir
bootstrap-this: .NOTMAIN
- @echo Bootstrapping ${RELDIR}/${.MAKE.DEPENDFILE:T} from ${_src:T}
- (cd ${.CURDIR} && sed 's,${_src:E},${MACHINE},g' ${_src} > ${.MAKE.DEPENDFILE:T})
+ @echo Bootstrapping ${RELDIR}/${_want:T} from ${_src:T}; \
+ echo You need to build ${RELDIR} to correctly populate it.
+.if ${_src:T} != ${.MAKE.DEPENDFILE_PREFIX:T}
+ (cd ${.CURDIR} && sed ${.MAKE.DEPENDFILE_BOOTSTRAP_SED} ${_src} > ${_want})
+.else
+ cp ${.CURDIR}/${_src} ${_want}
+.endif
# create Makefile.depend* for this dir and its dependencies
bootstrap: bootstrap-recurse
@@ -704,8 +717,8 @@ bootstrap-recurse: .NOTMAIN .MAKE
# create an empty Makefile.depend* to get the ball rolling.
bootstrap-empty: .NOTMAIN .NOMETA
- @echo Creating empty ${RELDIR}/${.MAKE.DEPENDFILE:T}; \
+ @echo Creating empty ${RELDIR}/${_want:T}; \
echo You need to build ${RELDIR} to correctly populate it.
- @{ echo DIRDEPS=; echo ".include <dirdeps.mk>"; } > ${.CURDIR}/${.MAKE.DEPENDFILE:T}
+ @{ echo DIRDEPS=; echo ".include <dirdeps.mk>"; } > ${_want}
.endif
diff --git a/mk/install-mk b/mk/install-mk
index 74b09394941c..79b35e8b6592 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.128 2016/06/03 17:22:32 sjg Exp $
+# $Id: install-mk,v 1.130 2016/08/15 19:28:13 sjg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
@@ -70,7 +70,7 @@
# sjg@crufty.net
#
-MK_VERSION=20160602
+MK_VERSION=20160815
OWNER=
GROUP=
MODE=444
diff --git a/mk/lib.mk b/mk/lib.mk
index 23612665359f..6c25937fa9f0 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -1,4 +1,4 @@
-# $Id: lib.mk,v 1.53 2016/03/22 20:45:14 sjg Exp $
+# $Id: lib.mk,v 1.54 2016/08/02 20:52:17 sjg Exp $
.if !target(__${.PARSEFILE}__)
__${.PARSEFILE}__:
@@ -564,6 +564,7 @@ libinstall:
install: maninstall _SUBDIRUSE
maninstall: afterinstall
afterinstall: realinstall
+libinstall: beforeinstall
realinstall: beforeinstall
.endif
diff --git a/mk/meta.sys.mk b/mk/meta.sys.mk
index dde2c48575a1..47cd8f5bdcc7 100644
--- a/mk/meta.sys.mk
+++ b/mk/meta.sys.mk
@@ -1,4 +1,4 @@
-# $Id: meta.sys.mk,v 1.28 2016/04/05 15:58:37 sjg Exp $
+# $Id: meta.sys.mk,v 1.29 2016/08/13 17:51:45 sjg Exp $
#
# @(#) Copyright (c) 2010, Simon J. Gerraty
@@ -25,6 +25,10 @@
# absoulte path to what we are reading.
_PARSEDIR = ${.PARSEDIR:tA}
+.if !defined(SYS_MK_DIR)
+SYS_MK_DIR := ${_PARSEDIR}
+.endif
+
META_MODE += meta verbose
.MAKE.MODE ?= ${META_MODE}
@@ -119,6 +123,15 @@ MKDEP_MK = meta.autodep.mk
# re-running needlessly
META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
META_NOPHONY=
+
+# some targets involve old pre-built targets
+# ignore mtime of shell
+# and mtime of makefiles does not matter in meta mode
+.MAKE.META.IGNORE_PATHS += \
+ ${MAKEFILE} \
+ ${SHELL} \
+ ${SYS_MK_DIR}
+
.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no"
.if ${.MAKEFLAGS:Uno:M-k} != ""
# make this more obvious
diff --git a/mk/prog.mk b/mk/prog.mk
index db77da298066..2a4160af1422 100644
--- a/mk/prog.mk
+++ b/mk/prog.mk
@@ -1,4 +1,4 @@
-# $Id: prog.mk,v 1.26 2016/03/22 20:45:14 sjg Exp $
+# $Id: prog.mk,v 1.27 2016/08/02 20:52:17 sjg Exp $
.if !target(__${.PARSEFILE}__)
__${.PARSEFILE}__:
@@ -191,6 +191,7 @@ install_links:
maninstall: afterinstall
afterinstall: realinstall
+proginstall: beforeinstall
realinstall: beforeinstall
.endif