1
2FOO = foo
3
4define multi=
5echo hi
6@echo $(FOO)
7endef # this is the end
8
9define simple:=
10@echo $(FOO)
11endef
12
13define posix::=
14@echo $(FOO)
15endef
16
17define posixbsd:::=
18@echo '$(FOO)$$bar'
19endef
20
21append = @echo a
22
23define append+=
24
25@echo b
26endef
27
28define cond?= # this is a conditional
29@echo first
30endef
31
32define cond?=
33@echo second
34endef
35
36FOO = there
37
38all: ; $(multi)
39 $(simple)
40 $(posix)
41 $(posixbsd)
42 $(append)
43 $(cond)