mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-12-29 00:05:58 +00:00
81f3e4babd
- Fix Savannah bug #24655. - Fix Savannah bug #24588. - Fix Savannah bug #24277. - Fix Savannah bug #25697. - Fix Savannah bug #25694. - Fix Savannah bug #25460. - Fix Savannah bug #26207. - Fix Savannah bug #25712. - Fix Savannah bug #26593. - Fix various doc issues.
45 lines
873 B
Perl
45 lines
873 B
Perl
# -*-perl-*-
|
|
|
|
$description = "Test the override directive on variable assignments.";
|
|
|
|
$details = "";
|
|
|
|
# TEST 0: Basic override
|
|
|
|
run_make_test('
|
|
X = start
|
|
override recur = $(X)
|
|
override simple := $(X)
|
|
X = end
|
|
all: ; @echo "$(recur) $(simple)"
|
|
',
|
|
'recur=I simple=J', "end start\n");
|
|
|
|
# TEST 1: Override with append
|
|
|
|
run_make_test('
|
|
X += X1
|
|
override X += X2
|
|
override Y += Y1
|
|
Y += Y2
|
|
all: ; @echo "$(X) $(Y)"
|
|
',
|
|
'', "X1 X2 Y1\n");
|
|
|
|
# TEST 2: Override with append to the command line
|
|
|
|
run_make_test(undef, 'X=C Y=C', "C X2 C Y1\n");
|
|
|
|
# Test override of define/endef
|
|
|
|
run_make_test('
|
|
override define foo
|
|
@echo First comes the definition.
|
|
@echo Then comes the override.
|
|
endef
|
|
all: ; $(foo)
|
|
',
|
|
'foo=Hello', "First comes the definition.\nThen comes the override.\n");
|
|
|
|
|
|
1;
|