Files
modern-cpp-tutorial/pdf/en-us/Makefile
Changkun Ou 529399ffcd pdf: use printf over echo
echo may introduce inconsistent behaviors over different platforms.  printf is considered better than echo. See: https://unix.stackexchange.com/questions/65803/why-is-printf-better-than-echo

Fixes #188
2021-08-11 12:27:20 +02:00

30 lines
759 B
Makefile

title = 'Modern C++ Tutorial: C++11/14/17/20 On the Fly'
filename = 'modern-cpp-tutorial'
outputname='modern-cpp-tutorial'
revision = $(shell git describe --always --tags)
all: revision pdf
revision:
printf '%% Autogenerated, do not edit\n' > revision.tex
printf '\\newcommand{\\revision}{'$(revision)'}' >> revision.tex
pdf: markdown
@echo "Compiling PDF file..."
pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \
--template=meta/template.tex \
--pdf-engine=`which xelatex`
@echo "Done."
rm *.md revision.tex
markdown:
@echo "Copy markdown files..."
cp -r ../../book/en-us/* .
@echo "Aggregating markdown files..."
python3 aggregator.py
clean:
rm -rf revision.tex *.md
.PHONY: markdown pdf clean