~jzck/physics-notes

ref: 9242517d2b1b0b8f55214a872e2a8eff82278577 physics-notes/Makefile -rw-r--r-- 870 bytes
9242517dJack Halford modifications 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.RECIPEPREFIX = >

MD	=	$(shell ls -1 md/*.md)
GRAPH	=	$(subst md/,graph/,$(MD:.md=))
SEEALSO	=	$(subst md/,see_also/,$(MD))
HTML	=	$(subst md/,html/,$(MD:.md=.html))

all: $(HTML) html/graph.svg $(SEEALSO)

html/%.html: md/%.md see_also/%.md | html/colors.css html
> @pandoc	--filter tools/pf-filter.py \
		-H tools/header.html \
		--template tools/template.html \
		--mathjax -f markdown \
		tools/latex-includes.yaml \
		$^ -o $@ &
> @printf '$@\n'
html/graph.svg: $(GRAPH) | html
> dot -Tsvg -o $@ <(./tools/generate-graph.sh)
html/colors.css: | html
> ./tools/get bg_css >$@

see_also/%.md: graph/% | see_also
> @tools/get see_also $(^F)>$@

graph/%: md/%.md | graph
> @tools/get graph $(^F)>$@

html see_also graph:
> @mkdir -p $@

clean:
> rm -rf html graph see_also

re: clean all

.PHONY: clean all re