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