Changeset View
Changeset View
Standalone View
Standalone View
head/share/mk/meta.sys.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# $Id: meta.sys.mk,v 1.34 2019/01/24 19:36:25 sjg Exp $ | # $Id: meta.sys.mk,v 1.38 2020/08/19 17:51:53 sjg Exp $ | ||||
# | # | ||||
# @(#) Copyright (c) 2010, Simon J. Gerraty | # @(#) Copyright (c) 2010-2020, Simon J. Gerraty | ||||
# | # | ||||
# This file is provided in the hope that it will | # This file is provided in the hope that it will | ||||
# be of use. There is absolutely NO WARRANTY. | # be of use. There is absolutely NO WARRANTY. | ||||
# Permission to copy, redistribute or otherwise | # Permission to copy, redistribute or otherwise | ||||
# use this file is hereby granted provided that | # use this file is hereby granted provided that | ||||
# the above copyright notice and this notice are | # the above copyright notice and this notice are | ||||
# left intact. | # left intact. | ||||
# | # | ||||
# Please send copies of changes and bug-fixes to: | # Please send copies of changes and bug-fixes to: | ||||
# sjg@crufty.net | # sjg@crufty.net | ||||
# | # | ||||
# include this if you want to enable meta mode | # include this if you want to enable meta mode | ||||
# for maximum benefit, requires filemon(4) driver. | # for maximum benefit, requires filemon(4) driver. | ||||
.if ${MAKE_VERSION:U0} > 20100901 | .if ${MAKE_VERSION:U0} > 20100901 | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
META_COOKIE_TOUCH?= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} | META_COOKIE_TOUCH?= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET:T}} | ||||
META_NOPHONY= | META_NOPHONY= | ||||
META_NOECHO= : | META_NOECHO= : | ||||
# some targets involve old pre-built targets | # some targets involve old pre-built targets | ||||
# ignore mtime of shell | # ignore mtime of shell | ||||
# and mtime of makefiles does not matter in meta mode | # and mtime of makefiles does not matter in meta mode | ||||
.MAKE.META.IGNORE_PATHS += \ | .MAKE.META.IGNORE_PATHS += \ | ||||
${MAKEFILE} \ | ${MAKEFILE} \ | ||||
${MAKE_SHELL} \ | |||||
${SHELL} \ | ${SHELL} \ | ||||
${SYS_MK_DIR} | ${SYS_MK_DIR} \ | ||||
.if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" | .if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" | ||||
.if ${.MAKEFLAGS:Uno:M-k} != "" | .if ${.MAKEFLAGS:Uno:M-k} != "" | ||||
# make this more obvious | # make this more obvious | ||||
.warning Setting UPDATE_DEPENDFILE=NO due to -k | .warning Setting UPDATE_DEPENDFILE=NO due to -k | ||||
UPDATE_DEPENDFILE= NO | UPDATE_DEPENDFILE= NO | ||||
.export UPDATE_DEPENDFILE | .export UPDATE_DEPENDFILE | ||||
.elif !exists(/dev/filemon) | .elif !exists(/dev/filemon) | ||||
.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. | .error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. | ||||
.endif | .endif | ||||
.endif | .endif | ||||
.if ${.MAKE.LEVEL} == 0 | .if ${.MAKE.LEVEL} == 0 | ||||
# make sure dirdeps target exists and do it first | # make sure dirdeps target exists and do it first | ||||
all: dirdeps .WAIT | all: dirdeps .WAIT | ||||
dirdeps: | dirdeps: | ||||
.NOPATH: dirdeps | .NOPATH: dirdeps | ||||
.if defined(ALL_MACHINES) | .if defined(ALL_MACHINES) | ||||
# the first .MAIN: is what counts | # the first .MAIN: is what counts | ||||
# by default dirdeps is all we want at level0 | # by default dirdeps is all we want at level0 | ||||
.MAIN: dirdeps | .MAIN: dirdeps | ||||
# tell dirdeps.mk what we want | |||||
BUILD_AT_LEVEL0 = no | |||||
.endif | |||||
.if ${.TARGETS:Nall} == "" | |||||
# it works best if we do everything via sub-makes | |||||
BUILD_AT_LEVEL0 ?= no | |||||
.endif | .endif | ||||
.endif | .endif | ||||
.else | .else | ||||
META_COOKIE_TOUCH= | META_COOKIE_TOUCH= | ||||
# some targets need to be .PHONY in non-meta mode | # some targets need to be .PHONY in non-meta mode | ||||
META_NOPHONY= .PHONY | META_NOPHONY= .PHONY | ||||
META_NOECHO= echo | META_NOECHO= echo | ||||
.endif | .endif | ||||
.endif | .endif |