diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-02-26 13:42:55 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-02-26 13:47:33 +0300 |
commit | 02ede0600099a820fcfdd106f134815ce967c6ab (patch) | |
tree | 9a308d18e5be31b362195c1381c3b23b0e5b24fd /Makefile | |
parent | update (diff) | |
download | cv-02ede0600099a820fcfdd106f134815ce967c6ab.tar.gz cv-02ede0600099a820fcfdd106f134815ce967c6ab.zip |
Makefile: best practices
Diffstat (limited to '')
-rw-r--r-- | Makefile | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -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)/ |