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