From 4f8b9c95aa28e22d5f2f740633886c863b63fb04 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Mon, 15 Oct 2018 20:12:05 +0200 Subject: [PATCH] Also copy exercises --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da85835..0565a10 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,8 @@ .PHONY: default clean +COPY_PDF=$(shell find . -name '*.pdf' -not -path './build/*') +COPY_TARGETS=$(COPY_PDF:%.pdf=build/%.pdf) + MD_SOURCES=$(shell find . -name '*.md' -not -path "./templates/*") HTML_TARGETS=$(MD_SOURCES:%.md=build/%.html) PDF_TARGETS=$(MD_SOURCES:%.md=build/%.pdf) @@ -14,7 +17,7 @@ COMPRESS_TARGETS=$(HTML_TARGETS:%=%.gz) COMPRESS_TARGETS+=$(PDF_TARGETS:%=%.gz) COMPRESS_TARGETS+=$(TEX_TARGETS:%=%.gz) -default: $(DOT_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(TEX_TARGETS) +default: $(DOT_TARGETS) $(HTML_TARGETS) $(PDF_TARGETS) $(TEX_TARGETS) $(COPY_TARGETS) compress: default $(COMPRESS_TARGETS) @@ -37,5 +40,9 @@ build/%.pdf: %.tex %.gz: % gzip -k -f -9 $< +build/%.pdf: %.pdf + @mkdir -p $$(dirname $@) + cp $< $@ + clean: rm -r build