aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/makefiles.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/doc/makefiles.md b/doc/makefiles.md
new file mode 100644
index 0000000..cb00c96
--- /dev/null
+++ b/doc/makefiles.md
@@ -0,0 +1,19 @@
+# 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)