freebsd-src/unit-tests/opt.mk
Simon J. Gerraty 51d8a8b4ac Import bmake-20230414
Relevant/interesting changes:

	* make.1: document seemingly unexplained Error code 6.
	o compat.c: CompatDeleteTarget skip .PHONY targets to be
	consistent with JobDeleteTarget.
	o job.c: fix memory leak in handling sysv :from=to modifiers
	o unit tests for .MAKE.META.IGNORE_{FILTER,PATHS,PATTERNS}
	o var.c: fix parsing of unevaluated subexpressions with
	unbalanced '{}'
	o cond.c: reduce complexity of evaluating expressions
2023-04-24 16:44:30 -07:00

29 lines
922 B
Makefile

# $NetBSD: opt.mk,v 1.7 2023/02/25 00:07:08 rillig Exp $
#
# Tests for the command line options.
.MAKEFLAGS: -d0 # make stdout line-buffered
all: .IGNORE
# The options from the top-level make are passed to the sub-makes via
# the environment variable MAKEFLAGS. This is where the " -r -k -d 0"
# comes from. See MainParseOption.
${MAKE} -r -f /dev/null -V MAKEFLAGS
@echo
# Just to see how the custom argument parsing code reacts to a syntax
# error. The colon is used in the options string, marking an option
# that takes arguments. It is not an option by itself, though.
${MAKE} -:
@echo
# See whether a '--' stops handling of command line options, like in
# standard getopt programs. Yes, it does, and it treats the
# second '-f' as a target to be created.
${MAKE} -r -f /dev/null -- -VAR=value -f /dev/null
@echo
# This is the normal way to print the usage of a command.
${MAKE} -?
@echo