add basic makefile examples

This commit is contained in:
Malin Freeborn 2024-11-12 03:58:47 +01:00
parent 3adc7ce3a7
commit a9f7fd7f75
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

View File

@ -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