xref: /freebsd/contrib/bmake/unit-tests/opt-debug-loud.mk (revision d5e0a182cf153f8993a633b93d9220c99a89e760)
1*d5e0a182SSimon J. Gerraty# $NetBSD: opt-debug-loud.mk,v 1.5 2023/12/19 19:33:40 rillig Exp $
2956e45f6SSimon J. Gerraty#
3956e45f6SSimon J. Gerraty# Tests for the -dl command line option, which prints the commands before
4956e45f6SSimon J. Gerraty# running them, ignoring the command line option for silent mode (-s) as
5956e45f6SSimon J. Gerraty# well as the .SILENT special source and target, as well as the '@' prefix
6956e45f6SSimon J. Gerraty# for shell commands.
7956e45f6SSimon J. Gerraty
8956e45f6SSimon J. Gerraty.MAKEFLAGS: -dl -s
9956e45f6SSimon J. Gerraty.SILENT:
10956e45f6SSimon J. Gerraty
11*d5e0a182SSimon J. Gerraty# The -dl command line option does not affect commands that are run when
12*d5e0a182SSimon J. Gerraty# evaluating expressions and their modifiers, such as :!cmd! or :sh.
13956e45f6SSimon J. Gerraty.if ${:!echo word!} != "word"
14956e45f6SSimon J. Gerraty.  error
15956e45f6SSimon J. Gerraty.endif
16956e45f6SSimon J. Gerraty
17956e45f6SSimon J. Gerratyall: .SILENT
18956e45f6SSimon J. Gerraty	# Even though the command line option -s is given, .SILENT is set
19956e45f6SSimon J. Gerraty	# for all targets and for this target in particular, the command
20956e45f6SSimon J. Gerraty	# is still printed.  The -dl debugging option is stronger than all
21956e45f6SSimon J. Gerraty	# of these.
22956e45f6SSimon J. Gerraty	@echo all-word
23