xref: /freebsd/contrib/bmake/unit-tests/opt-query.mk (revision ec0ea6efa1ad229d75c394c1a9b9cac33af2b1d3)
1# $NetBSD: opt-query.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
2#
3# Tests for the -q command line option.
4#
5# The -q option only looks at the dependencies between the targets.
6# None of the commands in the targets are run, not even those that are
7# prefixed with '+'.
8
9.MAKEFLAGS: -q
10
11# This command cannot be prevented from being run since it is used at parse
12# time, and any later variable assignments may depend on its result.
13!=	echo 'command during parsing' 1>&2; echo
14
15# None of these commands are run.
16.BEGIN:
17	@echo '$@: hidden command'
18	@+echo '$@: run always'
19
20# None of these commands are run.
21all:
22	@echo '$@: hidden command'
23	@+echo '$@: run always'
24
25# The exit status 1 is because the "all" target has to be made, that is,
26# it is not up-to-date.
27