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