2 ms·
Well, = doesn't really behave like traditional variable binding, since you can do stuff like: build = cc -c -o $@ $< file1.o: file1.c $(build)
by klodolph 9y ago
Well, = doesn't really behave like traditional variable binding, since you can do stuff like:
build = cc -c -o $@ $<
file1.o: file1.c
$(build)
file2.o: file2.c
$(build)
(This is meant to illustrate the difference, this isn't a good makefile.)
To reinforce the notion that variables are really functions, you can even supply arguments when you call them:
# reverse is a function
reverse = $(2) $(1)
# eventually expands to 2 1
a = $(call reverse,1,2)