Make
- GNU Make
- variable assignment
- variable passing
- variable expanding
- command prefix
- function
- recursive
- convention variables
- Search Path
- spaces before the variable value are ignored in variable assignments
- command line variable > makefile assigned variable > environment variable (> means override)
type | syntax | description |
---|---|---|
simply expanded variable | variable := value | righthand side is expanded immediately upon reading the line from the makefile |
recursively expanded variable | vairable = value | the expansion is performed when the variable is used |
conditional assignment variable | variable ?= value | this operator will perform the requested variable assignment only if the variable does not yet have a value |
append assignment variable | variable += value | values on the righthand side of the assignment are appended to the variable without changing the original values in the variable |
- Rules
- tells make to report what actions it would perform without actually running them
make -n
- Dependency
%.P : %.c
$(MAKEDEPEND)
@sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $*.d > $@; \
rm -f $*.d; [ -s $@ ] || rm -f $@
include $(SRCS:.c=.P)
page revision: 88, last edited: 23 Aug 2016 15:00