| @@ -1,24 +1,24 @@ | | | @@ -1,24 +1,24 @@ |
1 | # $NetBSD: opt.mk,v 1.5 2020/11/15 06:19:34 rillig Exp $ | | 1 | # $NetBSD: opt.mk,v 1.6 2020/11/18 01:06:59 sjg Exp $ |
2 | # | | 2 | # |
3 | # Tests for the command line options. | | 3 | # Tests for the command line options. |
4 | | | 4 | |
5 | .MAKEFLAGS: -d0 # make stdout line-buffered | | 5 | .MAKEFLAGS: -d0 # make stdout line-buffered |
6 | | | 6 | |
7 | all: .IGNORE | | 7 | all: .IGNORE |
8 | # The options from the top-level make are passed to the sub-makes via | | 8 | # The options from the top-level make are passed to the sub-makes via |
9 | # the environment variable MAKEFLAGS. This is where the " -r -k -d 0" | | 9 | # the environment variable MAKEFLAGS. This is where the " -r -k -d 0" |
10 | # comes from. See MainParseArg. | | 10 | # comes from. See MainParseArg. |
11 | ${MAKE} -V MAKEFLAGS | | 11 | ${MAKE} -r -f /dev/null -V MAKEFLAGS |
12 | @echo | | 12 | @echo |
13 | | | 13 | |
14 | # Just to see how the custom argument parsing code reacts to a syntax | | 14 | # Just to see how the custom argument parsing code reacts to a syntax |
15 | # error. The colon is used in the options string, marking an option | | 15 | # error. The colon is used in the options string, marking an option |
16 | # that takes arguments. It is not an option by itself, though. | | 16 | # that takes arguments. It is not an option by itself, though. |
17 | ${MAKE} -: | | 17 | ${MAKE} -: |
18 | @echo | | 18 | @echo |
19 | | | 19 | |
20 | # See whether a '--' stops handling of command line options, like in | | 20 | # See whether a '--' stops handling of command line options, like in |
21 | # standard getopt programs. Yes, it does, and it treats the | | 21 | # standard getopt programs. Yes, it does, and it treats the |
22 | # second '-f' as a target to be created. | | 22 | # second '-f' as a target to be created. |
23 | ${MAKE} -r -f /dev/null -- -VAR=value -f /dev/null | | 23 | ${MAKE} -r -f /dev/null -- -VAR=value -f /dev/null |
24 | @echo | | 24 | @echo |