From d352671447f09659ea88a5e15d441ae59c503d4a Mon Sep 17 00:00:00 2001 From: Mohit Agarwal Date: Thu, 12 Dec 2024 18:04:34 +0000 Subject: Building Make system. & Minor corrections. --- Makefile | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 25da930..088fd81 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,25 @@ SOURCES=$(wildcard *.md) +TARGETS=$(SOURCES:%.md=target/%.tex) -the-fresh-loaf.pdf: $(SOURCES) - pandoc --pdf-engine=xelatex $^ -o $@ +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/ -- cgit v1.2.3