make(1): add test for the -dl command line option

This commit is contained in:
rillig 2020-10-03 07:52:30 +00:00
parent 81d3fdb276
commit cec214a3c6
2 changed files with 16 additions and 5 deletions

View File

@ -1 +1,3 @@
echo all-word
all-word
exit status 0

View File

@ -1,13 +1,22 @@
# $NetBSD: opt-debug-loud.mk,v 1.1 2020/09/05 06:20:51 rillig Exp $
# $NetBSD: opt-debug-loud.mk,v 1.2 2020/10/03 07:52:30 rillig Exp $
#
# Tests for the -dl command line option, which prints the commands before
# running them, ignoring the command line option for silent mode (-s) as
# well as the .SILENT special source and target, as well as the '@' prefix
# for shell commands.
# TODO: Implementation
.MAKEFLAGS: -dl -s
.SILENT:
# TODO: What about ${:!cmd!}?
# The -dl command line option does not affect commands that are run during
# variable expansion, such as :!cmd! or :sh.
.if ${:!echo word!} != "word"
. error
.endif
all:
@:;
all: .SILENT
# Even though the command line option -s is given, .SILENT is set
# for all targets and for this target in particular, the command
# is still printed. The -dl debugging option is stronger than all
# of these.
@echo all-word