- Phony is evil
- Keep makefiles contain only dependency
- Don't define -DXXX in makefiles (makefile changes output content)
- If do so, output has to depend on makefile itself (evil road...)
- How to pass vars to sub-make ("VAR=val make" vs. "env VAR=val make" vs. "make VAR=val")
- Evaluation order (variables are evaluated at statements like .if, .for, ...)
- .SUFFIXES (inference rule) is GREAT
- Don't treat directories as input/output
- Object directory means nothing
- Use mkdep (generate accurate dependency automatically; avoid hand-write them)
- Use relative paths (from ${.CURDIR}) to refer to sources (to use absolute paths, you have to pass around variables)
- XXX
- Command-line
- Macro (assignment in make files)
- Environmental variable