diff options
author | Paul Smith <psmith@gnu.org> | 2012-01-30 00:21:57 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 2012-01-30 00:21:57 +0000 |
commit | ef6461611b8fb7cd4a92168d4c319153462afb5a (patch) | |
tree | 715f4d6f1177ce9bb4e5d2d84bf89575c7906175 /tests/scripts/variables/define | |
parent | fca11f60390cf607f68b497c3909b1fb40251070 (diff) | |
download | gunmake-ef6461611b8fb7cd4a92168d4c319153462afb5a.tar.gz |
Add support for "::=" simple assignment operator.
The next POSIX standard will define "::=" to have the same behavior
as GNU make's ":=", so add support for this new operator.
Diffstat (limited to 'tests/scripts/variables/define')
-rw-r--r-- | tests/scripts/variables/define | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/tests/scripts/variables/define b/tests/scripts/variables/define index f91519e..68d493b 100644 --- a/tests/scripts/variables/define +++ b/tests/scripts/variables/define @@ -30,6 +30,10 @@ define simple := @echo $(FOO) endef +define posix ::= +@echo $(FOO) +endef + append = @echo a define append += @@ -49,10 +53,54 @@ FOO = there all: ; $(multi) $(simple) + $(posix) + $(append) + $(cond) +', + '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); + +# TEST 1a: Various new-style define/endef, with no spaces + +run_make_test(' +FOO = foo + +define multi= +echo hi +@echo $(FOO) +endef # this is the end + +define simple:= +@echo $(FOO) +endef + +define posix::= +@echo $(FOO) +endef + +append = @echo a + +define append+= + +@echo b +endef + +define cond?= # this is a conditional +@echo first +endef + +define cond?= +@echo second +endef + +FOO = there + +all: ; $(multi) + $(simple) + $(posix) $(append) $(cond) ', - '', "echo hi\nhi\nthere\nfoo\na\nb\nfirst\n"); + '', "echo hi\nhi\nthere\nfoo\nfoo\na\nb\nfirst\n"); # TEST 2: define in true section of conditional (containing conditional) |