Home | History | Annotate | Line # | Download | only in unit-tests
depsrc-usebefore-double-colon.mk revision 1.1
      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 
      6 all: action
      7 
      8 # The dependency operator :: allows commands to be added later to the same
      9 # target.
     10 double-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.
     15 double-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.
     20 double-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.
     25 action: 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.
     29 double-colon::
     30 	@echo double-colon late
     31