aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 027b87aa623e325ac3ebb851b590cc1836829d24 (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 || echo
	touch target/include.tex
	for f in $(SOURCES:%.md=%);\
		do echo \\include{$$f} >> target/include.tex;\
		done

clean:
	rm -rf target/