Date: Mon, 18 Apr 2016 20:56:21 +0000 (UTC) From: "Simon J. Gerraty" <sjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298225 - head/share/mk Message-ID: <201604182056.u3IKuL4P007924@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sjg Date: Mon Apr 18 20:56:21 2016 New Revision: 298225 URL: https://svnweb.freebsd.org/changeset/base/298225 Log: 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 Modified: head/share/mk/dirdeps.mk head/share/mk/gendirdeps.mk head/share/mk/meta.autodep.mk Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/dirdeps.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -122,6 +122,23 @@ _DIRDEP_USE_LEVEL?= 0 # and non-specific Makefile.depend* .if !target(_DIRDEP_USE) + +.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" +# This little trick let's us do +# +# mk -f dirdeps.mk some/dir.${TARGET_SPEC} +# +all: +${.TARGETS:Nall}: all +DIRDEPS := ${.TARGETS:M*[/.]*} +# so that -DNO_DIRDEPS works +DEP_RELDIR := ${DIRDEPS:[1]:R} +# this will become DEP_MACHINE below +TARGET_MACHINE := ${DIRDEPS:[1]:E:C/,.*//} +# disable DIRDEPS_CACHE as it does not like this trick +MK_DIRDEPS_CACHE = no +.endif + # make sure we get the behavior we expect .MAKE.SAVE_DOLLARS = no @@ -245,20 +262,6 @@ DEP_${TARGET_SPEC_VARS:[$i]} := ${_tspec DEP_MACHINE := ${_DEP_TARGET_SPEC} .endif -.if ${MAKEFILE:T} == ${.PARSEFILE} && empty(DIRDEPS) && ${.TARGETS:Uall:M*/*} != "" -# This little trick let's us do -# -# mk -f dirdeps.mk some/dir.${TARGET_SPEC} -# -all: -${.TARGETS:Nall}: all -DIRDEPS := ${.TARGETS:M*/*} -# so that -DNO_DIRDEPS works -DEP_RELDIR := ${DIRDEPS:R:[1]} -# disable DIRDEPS_CACHE as it does not like this trick -MK_DIRDEPS_CACHE = no -.endif - # reset each time through _build_all_dirs = @@ -285,7 +288,7 @@ _DEP_RELDIR := ${DEP_RELDIR} # pickup customizations # as below you can use !target(_DIRDEP_USE) to protect things # which should only be done once. -.-include "local.dirdeps.mk" +.-include <local.dirdeps.mk> .if !target(_DIRDEP_USE) # things we skip for host tools @@ -305,7 +308,13 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} -.if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +.if defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) +NO_DIRDEPS = +.elif defined(WITHOUT_DIRDEPS_BELOW) +NO_DIRDEPS_BELOW = +.endif + +.if defined(NO_DIRDEPS) # confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* .elif defined(NO_DIRDEPS_BELOW) @@ -371,7 +380,7 @@ MK_DIRDEPS_CACHE ?= no BUILD_DIRDEPS_CACHE ?= no BUILD_DIRDEPS ?= yes -.if !defined(NO_DIRDEPS) +.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.} @@ -453,7 +462,7 @@ _this_dir := ${SRCTOP}/${DEP_RELDIR} # on rare occasions, there can be a need for extra help _dep_hack := ${_this_dir}/${.MAKE.DEPENDFILE_PREFIX}.inc -.-include "${_dep_hack}" +.-include <${_dep_hack}> .if ${DEP_RELDIR} != ${_DEP_RELDIR} || ${DEP_TARGET_SPEC} != ${TARGET_SPEC} # this should be all Modified: head/share/mk/gendirdeps.mk ============================================================================== --- head/share/mk/gendirdeps.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/gendirdeps.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -83,7 +83,7 @@ META_FILES := ${META_FILES:T:O:u} .export META_FILES # pickup customizations -.-include "local.gendirdeps.mk" +.-include <local.gendirdeps.mk> # these are actually prefixes that we'll skip # they should all be absolute paths @@ -139,7 +139,8 @@ META2DEPS_CMD += -T ${TARGET_OBJ_SPEC} .endif META2DEPS_CMD += \ -R ${RELDIR} -H ${HOST_TARGET} \ - ${M2D_OBJROOTS:O:u:@o@-O $o@} + ${M2D_OBJROOTS:O:u:@o@-O $o@} \ + ${M2D_EXCLUDES:O:u:@o@-X $o@} \ M2D_OBJROOTS += ${OBJTOP} ${_OBJROOT} ${_objroot} @@ -256,6 +257,7 @@ DIRDEPS := ${DIRDEPS:${GENDIRDEPS_FILTER .if ${DEBUG_GENDIRDEPS:Uno:@x@${RELDIR:M$x}@} != "" .info ${RELDIR}: M2D_OBJROOTS=${M2D_OBJROOTS} +.info ${RELDIR}: M2D_EXCLUDES=${M2D_EXCLUDES} .info ${RELDIR}: dir_list='${dir_list}' .info ${RELDIR}: dpadd_dir_list='${dpadd_dir_list}' .info ${RELDIR}: dirdep_list='${dirdep_list}' Modified: head/share/mk/meta.autodep.mk ============================================================================== --- head/share/mk/meta.autodep.mk Mon Apr 18 20:33:44 2016 (r298224) +++ head/share/mk/meta.autodep.mk Mon Apr 18 20:56:21 2016 (r298225) @@ -19,7 +19,7 @@ _this ?= ${.PARSEFILE} .if !target(__${_this}__) __${_this}__: .NOTMAIN -.-include "local.autodep.mk" +.-include <local.autodep.mk> .if defined(SRCS) # it would be nice to be able to query .SUFFIXES @@ -56,6 +56,21 @@ _OBJTOP ?= ${OBJTOP} _OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} +.if ${.MAKE.LEVEL} > 0 || ${BUILD_AT_LEVEL0:Uyes:tl} == "yes" +# do not allow auto update if we ever built this dir without filemon +NO_FILEMON_COOKIE = .nofilemon +CLEANFILES += ${NO_FILEMON_COOKIE} +.if ${.MAKE.MODE:Uno:Mnofilemon} != "" +UPDATE_DEPENDFILE = NO +all: ${NO_FILEMON_COOKIE} +${NO_FILEMON_COOKIE}: .NOMETA + @echo UPDATE_DEPENDFILE=NO > ${.TARGET} +.elif exists(${NO_FILEMON_COOKIE}) +UPDATE_DEPENDFILE = NO +.warning ${RELDIR} built with nofilemon; UPDATE_DEPENDFILE=NO +.endif +.endif + .if ${.MAKE.LEVEL} == 0 .if ${BUILD_AT_LEVEL0:Uyes:tl} == "no" UPDATE_DEPENDFILE = NO
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604182056.u3IKuL4P007924>