# How to write makefiles and useful notes on understanding them ## Manual [gnu](https://www.gnu.org/software/make/manual/html_node/index.html) ## [Variables](https://www.gnu.org/software/make/manual/html_node/Setting.html) := expanded variable, right-hand side can contain variables ?= only set if it doesn't have a value != execute a shell script on the right-hand side and assign its result to the left-hand side ## Targets $@ is target $< is first dependency $^ is all dependencies ## Dependencies Use compiled -MMD switch to create rules (.d files) Include .d files for targets using -include (include if available)