opt.mk revision 1.4
1# $NetBSD: opt.mk,v 1.4 2020/11/15 06:06:19 sjg Exp $
2#
3# Tests for the command line options.
4
5# TODO: Implementation
6
7.MAKEFLAGS: -d0			# make stdout line-buffered
8
9all: .IGNORE
10	# Just to see how the custom argument parsing code reacts to a syntax
11	# error.  The colon is used in the options string, marking an option
12	# that takes arguments.  It is not an option by itself, though.
13	${MAKE} -:
14	@echo
15
16	# See whether a '--' stops handling of command line options, like in
17	# standard getopt programs.  Yes, it does, and it treats the
18	# second '-f' as a target to be created.
19	${MAKE} -r -f /dev/null -- -VAR=value -f /dev/null
20	@echo
21
22	# This is the normal way to print the usage of a command.
23	${MAKE} -?
24	@echo
25