TIL
Notes on makefile
- 1 minutes read - 108 wordsThere are two types of variable declaration.
- recursively expanded variables -
foo
is assigned withbar
which inturns assigned tough
whose value isHuh?
foo = $(bar)
bar = $(ugh)
ugh = Huh?
all:;echo $(foo)
$ make
$ Huh?
- simply expanded variables -
foo
is assigned withbar
however bar is not defined yet. so it outputs to nothing.
foo := $(bar)
bar := $(ugh)
ugh := Huh?
all:;echo $(foo)
$ make
$
NOTE: To echo
something it needs to be in a target. Here the target name is all
.
If I don’t want to have target and print something I can use warning
.
Reference:
https://ftp.gnu.org/old-gnu/Manuals/make-3.79.1/html_chapter/make_6.html