11.3Srillig# $NetBSD: varname-dot-alltargets.mk,v 1.3 2020/08/25 22:51:54 rillig Exp $
21.1Srillig#
31.2Srillig# Tests for the special .ALLTARGETS variable.
41.1Srillig
51.3Srillig.MAIN: all
61.3Srillig
71.3SrilligTARGETS_1:=	${.ALLTARGETS}
81.3Srillig
91.3Srilligfirst second: source
101.3Srillig
111.3SrilligTARGETS_2:=	${.ALLTARGETS}
121.1Srillig
131.1Srilligall:
141.3Srillig	# Since the tests are run with the -r option, no targets are
151.3Srillig	# defined at the beginning.
161.3Srillig	@echo ${TARGETS_1}
171.3Srillig
181.3Srillig	# Only first and second are "real" targets.
191.3Srillig	# The .ALLTARGETS variable is not about targets though, but
201.3Srillig	# about all nodes, therefore source is also included.
211.3Srillig	@echo ${TARGETS_2}
221.3Srillig
231.3Srillig	# Interestingly, the .END target is also implicitly defined at
241.3Srillig	# this point.
251.3Srillig	@echo ${.ALLTARGETS}
26