Home | History | Annotate | Line # | Download | only in unit-tests
depsrc-usebefore.mk revision 1.4
      1 # $NetBSD: depsrc-usebefore.mk,v 1.4 2020/08/22 07:49:44 rillig Exp $
      2 #
      3 # Tests for the special source .USEBEFORE in dependency declarations,
      4 # which allows to prepend common commands to other targets.
      5 
      6 all: action directly
      7 
      8 first: .USEBEFORE
      9 	@echo first		# Using ${.TARGET} here would expand to "action"
     10 
     11 second: .USEBEFORE
     12 	@echo second
     13 
     14 # It's possible but uncommon to have a .USEBEFORE target with no commands.
     15 # This may happen as the result of expanding a .for loop.
     16 empty: .USEBEFORE
     17 
     18 # It's possible but uncommon to directly make a .USEBEFORE target.
     19 directly: .USEBEFORE
     20 	@echo directly
     21 
     22 action: second first empty
     23