Wed Nov 18 01:06:59 2020 UTC ()
Always use -r -f /dev/null when not  intending to read a makefile


(sjg)
diff -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt.exp
diff -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt.mk

cvs diff -r1.6 -r1.7 src/usr.bin/make/unit-tests/opt.exp (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/opt.exp 2020/11/15 06:19:34 1.6
+++ src/usr.bin/make/unit-tests/opt.exp 2020/11/18 01:06:59 1.7
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1make -V MAKEFLAGS 1make -r -f /dev/null -V MAKEFLAGS
2 -r -k -d 0  2 -r -k -d 0
3 3
4make -: 4make -:
5usage: make [-BeikNnqrSstWwX] 5usage: make [-BeikNnqrSstWwX]
6 [-C directory] [-D variable] [-d flags] [-f makefile] 6 [-C directory] [-D variable] [-d flags] [-f makefile]
7 [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file] 7 [-I directory] [-J private] [-j max_jobs] [-m directory] [-T file]
8 [-V variable] [-v variable] [variable=value] [target ...] 8 [-V variable] [-v variable] [variable=value] [target ...]
9*** Error code 2 (ignored) 9*** Error code 2 (ignored)
10 10
11make -r -f /dev/null -- -VAR=value -f /dev/null 11make -r -f /dev/null -- -VAR=value -f /dev/null
12make: don't know how to make -f (continuing) 12make: don't know how to make -f (continuing)
13`/dev/null' is up to date. 13`/dev/null' is up to date.
14 14

cvs diff -r1.5 -r1.6 src/usr.bin/make/unit-tests/opt.mk (expand / switch to unified diff)

--- src/usr.bin/make/unit-tests/opt.mk 2020/11/15 06:19:34 1.5
+++ src/usr.bin/make/unit-tests/opt.mk 2020/11/18 01:06:59 1.6
@@ -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
7all: .IGNORE 7all: .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