Home | History | Annotate | Line # | Download | only in unit-tests
opt-no-action.mk revision 1.3
      1  1.3  rillig # $NetBSD: opt-no-action.mk,v 1.3 2020/08/19 05:25:26 rillig Exp $
      2  1.1  rillig #
      3  1.3  rillig # Tests for the -n command line option, which runs almost no commands.
      4  1.3  rillig # It just outputs them, to be inspected by human readers.
      5  1.3  rillig # Only commands that are in a .MAKE target or prefixed by '+' are run.
      6  1.1  rillig 
      7  1.3  rillig # This command cannot be prevented from being run since it is used at parse
      8  1.3  rillig # time, and any later variable assignments may depend on its result.
      9  1.3  rillig !=	echo 'command during parsing' 1>&2; echo
     10  1.1  rillig 
     11  1.3  rillig all: main
     12  1.3  rillig all: run-always
     13  1.3  rillig 
     14  1.3  rillig # Both of these commands are printed, but only the '+' command is run.
     15  1.3  rillig .BEGIN:
     16  1.3  rillig 	@echo '$@: hidden command'
     17  1.3  rillig 	@+echo '$@: run always'
     18  1.3  rillig 
     19  1.3  rillig # Both of these commands are printed, but only the '+' command is run.
     20  1.3  rillig main:
     21  1.3  rillig 	@echo '$@: hidden command'
     22  1.3  rillig 	@+echo '$@: run always'
     23  1.3  rillig 
     24  1.3  rillig # None of these commands is printed, but both are run, because this target
     25  1.3  rillig # depends on the special source ".MAKE".
     26  1.3  rillig run-always: .MAKE
     27  1.3  rillig 	@echo '$@: hidden command'
     28  1.3  rillig 	@+echo '$@: run always'
     29  1.3  rillig 
     30  1.3  rillig # Both of these commands are printed, but only the '+' command is run.
     31  1.3  rillig .END:
     32  1.3  rillig 	@echo '$@: hidden command'
     33  1.3  rillig 	@+echo '$@: run always'
     34