Home | History | Annotate | Line # | Download | only in unit-tests
depsrc-use.mk revision 1.6
      1  1.6  rillig # $NetBSD: depsrc-use.mk,v 1.6 2022/04/18 14:38:24 rillig Exp $
      2  1.1  rillig #
      3  1.3  rillig # Tests for the special source .USE in dependency declarations,
      4  1.3  rillig # which allows to append common commands to other targets.
      5  1.6  rillig #
      6  1.6  rillig # See also:
      7  1.6  rillig #	.USEBEFORE
      8  1.6  rillig #	depsrc-usebefore.mk
      9  1.1  rillig 
     10  1.5  rillig # Before make.h 1.280 from 2021-12-28, a .USEBEFORE target was accidentally
     11  1.5  rillig # regarded as a candidate for the main target.  On the other hand, a .USE
     12  1.5  rillig # target was not.
     13  1.5  rillig not-a-main-candidate: .USE
     14  1.5  rillig 
     15  1.3  rillig all: action directly
     16  1.1  rillig 
     17  1.6  rillig first: .USE first-first first-second
     18  1.4  rillig 	@echo first 1		# Using ${.TARGET} here would expand to "action"
     19  1.4  rillig 	@echo first 2
     20  1.6  rillig first-first: .USE
     21  1.6  rillig 	@echo first-first 1
     22  1.6  rillig 	@echo first-first 2
     23  1.6  rillig first-second: .USE
     24  1.6  rillig 	@echo first-second 1
     25  1.6  rillig 	@echo first-second 2
     26  1.3  rillig 
     27  1.3  rillig second: .USE
     28  1.4  rillig 	@echo second 1
     29  1.4  rillig 	@echo second 2
     30  1.3  rillig 
     31  1.3  rillig # It's possible but uncommon to have a .USE target with no commands.
     32  1.3  rillig # This may happen as the result of expanding a .for loop.
     33  1.3  rillig empty: .USE
     34  1.3  rillig 
     35  1.6  rillig # It's possible but uncommon to directly make a .USE target.
     36  1.3  rillig directly: .USE
     37  1.3  rillig 	@echo directly
     38  1.3  rillig 
     39  1.3  rillig action: first second empty
     40