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