Home | History | Annotate | Line # | Download | only in unit-tests
depsrc-use.mk revision 1.5
      1 # $NetBSD: depsrc-use.mk,v 1.5 2021/12/28 14:22:51 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 # Before make.h 1.280 from 2021-12-28, a .USEBEFORE target was accidentally
      7 # regarded as a candidate for the main target.  On the other hand, a .USE
      8 # target was not.
      9 not-a-main-candidate: .USE
     10 
     11 all: action directly
     12 
     13 first: .USE
     14 	@echo first 1		# Using ${.TARGET} here would expand to "action"
     15 	@echo first 2
     16 
     17 second: .USE
     18 	@echo second 1
     19 	@echo second 2
     20 
     21 # It's possible but uncommon to have a .USE target with no commands.
     22 # This may happen as the result of expanding a .for loop.
     23 empty: .USE
     24 
     25 # It's possible but uncommon to directly make a .USEBEFORE target.
     26 directly: .USE
     27 	@echo directly
     28 
     29 action: first second empty
     30