1 # $NetBSD: opt-no-action.mk,v 1.4 2020/11/09 20:50:56 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.
9 # This command cannot be prevented from being run since it is used at parse
10 # time, and any later variable assignments may depend on its result.
11 != echo 'command during parsing' 1>&2; echo
16 # Both of these commands are printed, but only the '+' command is run.
18 @echo '$@: hidden command'
19 @+echo '$@: run always'
21 # Both of these commands are printed, but only the '+' command is run.
23 @echo '$@: hidden command'
24 @+echo '$@: run always'
26 # None of these commands is printed, but both are run, because this target
27 # depends on the special source ".MAKE".
29 @echo '$@: hidden command'
30 @+echo '$@: run always'
32 # Both of these commands are printed, but only the '+' command is run.
34 @echo '$@: hidden command'
35 @+echo '$@: run always'