From effa60f205a3479ff9ce0f49d280289d49847bd0 Mon Sep 17 00:00:00 2001 From: "Posquit0.BJ" Date: Wed, 23 Nov 2016 21:40:02 +0900 Subject: [PATCH] Rewrite Makefile commands --- Makefile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7a5c9ff..ae1a12a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,22 @@ .PHONY: examples -examples: $(foreach x,coverletter cv resume,examples/$x.pdf) +CC = xelatex +EXAMPLES_DIR = examples +RESUME_DIR = examples/resume +CV_DIR = examples/cv +RESUME_SRCS = $(shell find $(RESUME_DIR) -name '*.tex') +CV_SRCS = $(shell find $(CV_DIR) -name '*.tex') -%.pdf: %.tex - xelatex -output-directory=$(dir $@) $< +examples: $(foreach x, coverletter cv resume, $x.pdf) + +resume.pdf: $(EXAMPLES_DIR)/resume.tex $(RESUME_SRCS) + $(CC) -output-directory=$(EXAMPLES_DIR) $< + +cv.pdf: $(EXAMPLES_DIR)/cv.tex $(CV_SRCS) + $(CC) -output-directory=$(EXAMPLES_DIR) $< + +coverletter.pdf: $(EXAMPLES_DIR)/coverletter.tex + $(CC) -output-directory=$(EXAMPLES_DIR) $< + +clean: + rm -rf $(EXAMPLES_DIR)/*.pdf