aboutsummaryrefslogtreecommitdiff
path: root/latex/Makefile
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-09-15 15:47:42 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-09-15 15:47:42 +0200
commit8b94145e7acbb6ba6acff76102e9b605348ee612 (patch)
tree4a8a6dd0deaea0eb6575eee1e54fa351542b943e /latex/Makefile
downloadmuhqs-game-8b94145e7acbb6ba6acff76102e9b605348ee612.tar.gz
muhqs-game-8b94145e7acbb6ba6acff76102e9b605348ee612.zip
add Makefile, tikzcard template and generated base, equipment, and magic cards
Diffstat (limited to 'latex/Makefile')
-rw-r--r--latex/Makefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/latex/Makefile b/latex/Makefile
new file mode 100644
index 00000000..7552b32e
--- /dev/null
+++ b/latex/Makefile
@@ -0,0 +1,44 @@
+.PHONY: all clean
+
+.DEFAULT_GOAL = all
+
+PDFLATEX = lualatex
+PDFTOPPM = pdftoppm
+
+PDFTOPPM_FLAGS = -singlefile -png -r 300
+
+COMMON_TEX_FILES = libs.tex colors.tex tikzcards.tex
+
+CARDS_DIR = cards
+CARD_SOURCES = $(shell find $(CARDS_DIR) -name "*.tex")
+
+VERBOSE = @
+PDF_DIR = ./build
+
+CARD_PDFS = $(notdir $(CARD_SOURCES:.tex=.pdf))
+CARD_PDFS_PREFIXED = $(addprefix $(PDF_DIR)/,$(CARD_PDFS))
+
+CARD_PNGS = $(notdir $(CARD_SOURCES:.tex=.png))
+CARD_PNGS_PREFIXED = $(addprefix $(PDF_DIR)/,$(CARD_PNGS))
+
+MAKEFILE_LIST = Makefile
+
+all: $(PDF_DIR)/cards.pdf $(CARD_PDFS_PREFIXED) $(CARD_PNGS_PREFIXED)
+
+$(PDF_DIR)/cards.pdf: cards.tex $(CARD_SOURCES) $(COMMON_TEX_FILES) $(MAKEFILE_LIST)
+ @echo "building › › $@"
+ @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
+ $(VERBOSE) $(PDFLATEX) --output-directory $(PDF_DIR) $^
+
+$(PDF_DIR)/%.pdf : $(CARDS_DIR)/%.tex $(COMMON_TEX_FILES) $(MAKEFILE_LIST)
+ @echo "card › $@"
+ @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
+ $(VERBOSE) $(PDFLATEX) --output-directory $(PDF_DIR) $(CARDS_DIR)/$*.tex
+
+$(PDF_DIR)/%.png : $(PDF_DIR)/%.pdf $(MAKEFILE_LIST)
+ @echo "png › $@"
+ @if test \( ! \( -d $(@D) \) \) ;then mkdir -p $(@D);fi
+ $(VERBOSE) $(PDFTOPPM) $(PDFTOPPM_FLAGS) $(PDF_DIR)/$*.pdf $(PDF_DIR)/$*
+
+clean:
+ rm -rf build/