From 34ef3d1ad8a18ce2309b66e71acd637215b797c8 Mon Sep 17 00:00:00 2001 From: Adar Nimrod <nimrod@shore.co.il> Date: Tue, 1 Sep 2020 11:45:57 +0300 Subject: [PATCH] A prettier Makefile. --- Makefile | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 3c5a359..52737ce 100644 --- a/Makefile +++ b/Makefile @@ -10,27 +10,40 @@ RESUME = resume.rst # Output paper size PAPERSIZE = A4 -.PHONY: all clean publish test +OUTPUTS = resume.html resume.pdf resume.docx resume.odt -all: resume.html resume.pdf resume.docx resume.odt +.PHONY: all +all: $(OUTPUTS) -resume.html: $(RESUME) Makefile - pandoc -s -t html5 --email-obfuscation=none $(RESUME) -o resume.html +resume.html: $(RESUME) + pandoc --standalone \ + --to html5 \ + --email-obfuscation none \ + --output $@ \ + $< -resume.pdf: $(RESUME) Makefile - pandoc --pdf-engine=xelatex $(RESUME) -M 'mainfont: SILEOT.ttf' -V papersize=$(PAPERSIZE) -V documentclass=mycv -o resume.pdf +resume.pdf: $(RESUME) + pandoc --pdf-engine xelatex \ + --metadata 'mainfont=SILEOT.ttf' \ + --variable 'papersize=$(PAPERSIZE)' \ + --variable 'documentclass=mycv' \ + --output $@ \ + $< -resume.docx: $(RESUME) Makefile - pandoc $(RESUME) -V papersize=$(PAPERSIZE) -o resume.docx +resume.docx: $(RESUME) + pandoc --variable 'papersize=$(PAPERSIZE)' --output $@ $< -resume.odt: $(RESUME) Makefile - pandoc $(RESUME) -V papersize=$(PAPERSIZE) -o resume.odt +resume.odt: $(RESUME) + pandoc --variable 'papersize=$(PAPERSIZE)' --output $@ $< +.PHONY: clean clean: git clean -fdX +.PHONY: publish publish: all - rsync -az resume.html resume.pdf resume.odt resume.docx $(SERVER):$(DEST) + rsync -az $(OUTPUTS) $(SERVER):$(DEST) ssh $(SERVER) "ln -sf resume.html $(DEST)/index.html" +.PHONY: test test: clean all -- GitLab