@echo $(FOO)
endef
+define posix ::=
+@echo $(FOO)
+endef
+
append = @echo a
define append +=
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)
endef
all: ; @echo ok
',
- '', "#MAKEFILE#:3: extraneous text after `define' directive\nok\n");
+ '', "#MAKEFILE#:3: extraneous text after 'define' directive\nok\n");
# TEST 7: NEGATIVE: extra text after endef
endef $(NAME)
all: ; @echo ok
',
- '', "#MAKEFILE#:5: extraneous text after `endef' directive\nok\n");
+ '', "#MAKEFILE#:5: extraneous text after 'endef' directive\nok\n");
# TEST 8: NEGATIVE: missing endef
ouch
endef$(NAME)
',
- '', "#MAKEFILE#:4: *** missing `endef', unterminated `define'. Stop.\n", 512);
+ '', "#MAKEFILE#:4: *** missing 'endef', unterminated 'define'. Stop.\n", 512);
# -------------------------
# Make sure that prefix characters apply properly to define/endef values.