aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 088fd811d8bfe9ac42cf275a47ed516cb09f74f0 (plain)
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
SOURCES=$(wildcard *.md)
TARGETS=$(SOURCES:%.md=target/%.tex)

default: target/ \
	target/Makefile \
	target/the-fresh-loaf.tex \
	$(TARGETS) include.tex

target/:
	mkdir target
target/the-fresh-loaf.tex: the-fresh-loaf.tex
	cp -ruv the-fresh-loaf.tex target/
target/Makefile: TexMakefile
	cp -ruv TexMakefile target/Makefile
target/%.tex: %.md
	pandoc --top-level-division=chapter $^ -o $@
include.tex:
	rm target/include.tex
	touch target/include.tex
	for f in $(SOURCES:%.md=%);\
		do echo \\include{$$f} >> target/include.tex;\
		done

clean:
	rm -rf target/