1# $NetBSD: depsrc-usebefore-double-colon.mk,v 1.1 2020/08/22 08:29:13 rillig Exp $
2#
3# Tests for the special source .USEBEFORE in dependency declarations,
4# combined with the double-colon dependency operator.
5
6all: action
7
8# The dependency operator :: allows commands to be added later to the same
9# target.
10double-colon:: .USEBEFORE
11	@echo double-colon early 1
12
13# This command is ignored, which kind of makes sense since this dependency
14# declaration has no .USEBEFORE source.
15double-colon::
16	@echo double-colon early 2
17
18# XXX: This command is ignored even though it has a .USEBEFORE source.
19# This is unexpected.
20double-colon:: .USEBEFORE
21	@echo double-colon early 3
22
23# At this point, the commands from the .USEBEFORE targets are copied to
24# the "action" target.
25action: double-colon
26
27# This command is not added to the "action" target since it comes too late.
28# The commands had been copied in the previous line already.
29double-colon::
30	@echo double-colon late
31