.PHONY: all
all: html
.PHONY: html
html: design.html
define header
<!DOCTYPE html>
<meta charset="utf-8" />
<title>Design</title>
<style>
html {
font-size: 16px;
font-family: sans-serif;
padding: 2em 1em;
}
body {
max-width: 55em;
margin-left: auto;
margin-right: auto;
line-height: 1.5;
}
img {
display: block;
margin-left: auto;
margin-right: auto;
}
table {
border-collapse: collapse;
margin-left: auto;
margin-right: auto;
}
th, td {
padding: 0.2em 1em;
}
td {
border-top: 1px solid #cccccc;
border-collapse: collapse;
}
</style>
endef
prefix := MAKEFILE_$(shell ls -i Makefile | awk '{ print $$1 }')_
$(eval export $(prefix)HEADER = $$(header))
design.html: design.md
@set -euf; \
set -- cmark --unsafe; \
if command -v pulldown-cmark > /dev/null; then \
set -- pulldown-cmark; \
fi; \
set -- "$$@" $^; \
printf '%s\n' "$$* > $@"; \
exec > $@; \
printf '%s\n' "$$$(prefix)HEADER"; \
"$$@"
.PHONY: clean
clean:
rm -f design.html
.DELETE_ON_ERROR: