mirror of
https://github.com/mirror/make.git
synced 2025-01-07 19:00:09 +08:00
f14824878d
If -R is given on the command line it implies -r as well; make this same assumption if -R is provided in MAKEFLAGS set in the makefile. * src/main.c (main): Check no_builtin_variables_flag after reading makefiles. * tests/scripts/options/dash-r: Add a test.
45 lines
986 B
Perl
45 lines
986 B
Perl
# -*-perl-*-
|
|
|
|
$description = "Test removing default rules and variables";
|
|
|
|
$details = "DETAILS";
|
|
|
|
touch('xxx.c');
|
|
|
|
# Simple check
|
|
run_make_test("\n", '-r COMPILE.c=echo xxx.o',
|
|
"#MAKE#: *** No rule to make target 'xxx.o'. Stop.", 512);
|
|
|
|
# Make sure we can set it from within the makefile too
|
|
run_make_test(q!
|
|
COMPILE.c = echo
|
|
MAKEFLAGS += -r
|
|
!,
|
|
'xxx.o',
|
|
"#MAKE#: *** No rule to make target 'xxx.o'. Stop.", 512);
|
|
|
|
unlink('xxx.c');
|
|
|
|
# Simple check for -R
|
|
run_make_test(q!
|
|
all:;$(info CC='$(CC)')
|
|
!,
|
|
'-sR', "CC=''");
|
|
|
|
# Make sure we can set -R from within the makefile too
|
|
run_make_test(q!
|
|
MAKEFLAGS += -R
|
|
all:;$(info CC='$(CC)')
|
|
!,
|
|
'-s', "CC=''");
|
|
|
|
# sv 62356.
|
|
# Setting -R in MAKEFLAGS sets -r.
|
|
run_make_test(q!
|
|
MAKEFLAGS := -R
|
|
.PHONY: hello.c
|
|
all: hello.o
|
|
!, '', "#MAKE#: *** No rule to make target 'hello.o', needed by 'all'. Stop.", 512);
|
|
|
|
1;
|