mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-25 13:58:32 +00:00
add make-4.3.tar.gz
This commit is contained in:
parent
0a0997a872
commit
19f70a154e
458 changed files with 239669 additions and 0 deletions
45
third_party/make/tests/scripts/features/override
vendored
Normal file
45
third_party/make/tests/scripts/features/override
vendored
Normal file
|
@ -0,0 +1,45 @@
|
|||
# -*-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;
|
Loading…
Add table
Add a link
Reference in a new issue