1 # $NetBSD: opt-no-action-touch.mk,v 1.1 2021/01/30 12:46:38 rillig Exp $
3 # Tests for combining the command line options -n (no action) and -t (touch).
4 # This combination is unusual and probably doesn't ever happen in practice,
5 # but still make needs to behave as expected. The option -n is stronger than
6 # -t, so instead of being touched, the commands of the targets are printed.
9 # opt-touch-jobs.mk contains the same test without the option -n.
12 .MAKEFLAGS: opt-touch-phony
13 .MAKEFLAGS: opt-touch-join
14 .MAKEFLAGS: opt-touch-use
15 .MAKEFLAGS: opt-touch-make
16 .MAKEFLAGS: opt-touch-regular
18 # .PHONY targets are not touched since they do not represent actual files.
20 opt-touch-phony: .PHONY
23 # .JOIN targets are not touched since they do not represent actual files.
28 # .USE targets are not touched since they do not represent actual files.
33 # The attribute .MAKE is stronger than the command line option -n. Therefore
34 # this target is run as usual. It is not prefixed by '@', therefore it is
35 # printed before being run.
39 # Since the option -n is stronger than the option -t, this target is not
40 # touched either. Without the -n, it would be touched.
44 # Since none of the above targets are actually touched, the following command
45 # does not output anything.
47 @files=$$(ls opt-touch-* 2>/dev/null | grep -v -e '\.'); \
48 [ -z "$$files" ] || { echo "created files: $$files" 1>&2; exit 1; }