• 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
%.P : %.c
        @sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' < $*.d > $@; \
           rm -f $*.d; [ -s $@ ] || rm -f $@

include $(SRCS:.c=.P)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License