From a9f7fd7f75af6dac20c2981f885b335fc0e15ba0 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 12 Nov 2024 03:58:47 +0100 Subject: [PATCH] add basic makefile examples --- slides/makefiles/makefiles.md | 86 +++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 slides/makefiles/makefiles.md diff --git a/slides/makefiles/makefiles.md b/slides/makefiles/makefiles.md new file mode 100644 index 0000000..56980cc --- /dev/null +++ b/slides/makefiles/makefiles.md @@ -0,0 +1,86 @@ +--- +title: +- Making Makefiles +author: +- Malin + +theme: +- Warsaw +colortheme: +- orchid +--- + +# Intro + +- input, process, output. +- automatic idempotence +- *Gotcha*: directories +- This, that, and these + +*** + +# Variables + +- From your shell. +- New variables. +- Filenames as variables. +- *Gotcha*: no shell variables, only make! + +## Equality + +- Variables with '=', never ':='. +- *Gotcha*: one shell per line. +- Variables as shell output. + + +*** + + +# Phonies, and the Problems with Lies + +- clean (common) +- check (excellent) + +*** + + +## Non-Compiling Checks + +- `make` -n +- *Gotcha*: shell output variables. + +*** + + +# The Fourth Sigil: `%` + +- Standard rules, e.g. ImageMagick, copying, et c. +- *Gotcha*: intermediaries are deleted. + +*** + + +# Bling: make2graph + +- *Gotcha*: completely outdated. + +*** + +# Inclusivity + +- `include dir/Makefile` +- *Gotcha*: directory has not changed +- `$(MAKEFILE_LIST)` + + +# Special Commands + +- dirname +- `DIR = test -d $(dirname $@) || mkdir $(dirname $@)` +- patsubst +- Wildcards (or not?) + +# Maintanance + +- backups +- saving files