aboutsummaryrefslogtreecommitdiff
path: root/share/mk/local.sys.mk
blob: 2236dfe2f460d51c1c29770450b5730ebaeb7d70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# $FreeBSD$

.if ${MK_DIRDEPS_BUILD} == "yes"
MAKE_PRINT_VAR_ON_ERROR+= \
	.CURDIR \
	.MAKE \
	.OBJDIR \
	.TARGETS \
	DESTDIR \
	LD_LIBRARY_PATH \
	MACHINE \
	MACHINE_ARCH \
	MAKEOBJDIRPREFIX \
	MAKESYSPATH \
	MAKE_VERSION\
	PATH \
	SRCTOP \
	OBJTOP \
	${MAKE_PRINT_VAR_ON_ERROR_XTRAS}

.if ${.MAKE.LEVEL} > 0
MAKE_PRINT_VAR_ON_ERROR += .MAKE.MAKEFILES .PATH
.endif
.endif

.include "src.sys.mk"

.if ${.MAKE.MODE:Mmeta*} != ""
# we can afford to use cookies to prevent some targets
# re-running needlessly
META_COOKIE=		${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}}
META_COOKIE_RM=		@rm -f ${META_COOKIE}
META_COOKIE_TOUCH=	@touch ${META_COOKIE}
# some targets need to be .PHONY - but not in meta mode
META_NOPHONY=
CLEANFILES+=		${META_TARGETS}
_meta_dep_before:	.USEBEFORE
	${META_COOKIE_RM}
_meta_dep_after:	.USE
	${META_COOKIE_TOUCH}
# Attach this to a target to allow it to benefit from meta mode's
# not rerunning a command if it doesn't need to be considering its
# metafile/filemon-tracked dependencies.
META_DEPS=	_meta_dep_before _meta_dep_after .META
.else
META_COOKIE_RM=
META_COOKIE_TOUCH=
META_NOPHONY=	.PHONY
.endif
META_DEPS+=	${META_NOPHONY}