aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-02-26 13:42:55 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-02-26 13:47:33 +0300
commit02ede0600099a820fcfdd106f134815ce967c6ab (patch)
tree9a308d18e5be31b362195c1381c3b23b0e5b24fd
parentupdate (diff)
downloadcv-02ede0600099a820fcfdd106f134815ce967c6ab.tar.gz
cv-02ede0600099a820fcfdd106f134815ce967c6ab.zip
Makefile: best practices
-rw-r--r--Makefile32
1 files changed, 23 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index ef551bf..ea5d69e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,31 @@
-MKDIR = mkdir -p
-RMDIR = $(RM) -r
+MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
+.DEFAULT_GOAL := all
+.DELETE_ON_ERROR:
+.SUFFIXES:
+SHELL := bash
+.SHELLFLAGS := -eu -o pipefail -c
-name = cv
+MKDIR := mkdir -p --
+RMDIR := $(RM) -r --
-$(name)/$(name).pdf : $(name).tex $(name)/ img/*
+name := cv
+pdf := $(name)/$(name).pdf
+
+.PHONY: DO
+DO:
+
+.PHONY: all
+all: $(pdf)
+
+$(pdf): $(name).tex img/selfie_face.jpg | $(name)/
pdflatex -interaction=nonstopmode -halt-on-error -output-directory=$(name)/ $<
-$(name)/ :
+%/:
$(MKDIR) $@
-.PHONY : clean clean-all
-
-clean :
+.PHONY: clean
+clean:
-clean-all : clean
+.PHONY: clean-all
+clean-all: clean
$(RMDIR) $(name)/