freebsd-src/unit-tests/sh-leading-hyphen.mk
Simon J. Gerraty 2e36ab2363 Import bmake-20230126
Relevant/interesting changes (see ChangeLog for more):

	o variables like .newline and .MAKE.{GID,PID,PPID,UID}
	should be read-only.
	o .[NO]READONLY: for control of read-only variables
	o .SYSPATH: for controlling the path searched for makefiles
	o allow for white-space between command specifiers @+-
	o add more details to warning 'Extra targets ignored'
	o make.1: sync list of built-in variables with reality
	sort list of built-in variables
	o cond.c: add more details to error message for numeric comparison
	o job.c: fix handling of null bytes in output
	o Allow .break to terminate a .for loop early
	o var.c: fix out-of-bounds errors when parsing
	o fix exit status for '-q' (since 1994)
2023-01-27 16:23:54 -08:00

30 lines
910 B
Makefile

# $NetBSD: sh-leading-hyphen.mk,v 1.4 2023/01/19 19:55:27 rillig Exp $
#
# Tests for shell commands preceded by a '-', to ignore the exit status of
# the command line.
#
# See also:
# .IGNORE
# depsrc-ignore.mk
# opt-ignore.mk
# TODO: Implementation
all:
-true
-false
# An undefined variable expands to an empty string, without warning.
# This is used in practice for prefixing tool names or for DESTDIR.
# The '-' before 'unknown' is interpreted by make as '.IGNORE' flag.
${UNDEF}-unknown-command 'needed for needshell in compat.c'
# Expanding undefined variables may lead to strange error messages
# when the shell interprets single-character options as commands
# instead.
${UNDEF} --unknown-long-option 'needed for needshell in compat.c'
# Since 2023-01-17, the leading '@', '+' and '-' may contain
# whitespace, for compatibility with GNU make.
- - - @echo 'whitespace in leading part'