From 8b94145e7acbb6ba6acff76102e9b605348ee612 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 15 Sep 2020 15:47:42 +0200 Subject: add Makefile, tikzcard template and generated base, equipment, and magic cards --- latex/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 latex/Makefile (limited to 'latex/Makefile') 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/ -- cgit v1.2.3