-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (33 loc) · 1001 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
SHELL:=/bin/zsh
NAME=main
GREEN=002
BLUE=004
define compile_tex
pdflatex -synctex=1 -draftmode -interaction=batchmode -shell-escape $(1).tex ; \
biber $(1) ; \
pdflatex -synctex=1 -draftmode -interaction=batchmode -shell-escape $(1).tex ; \
pdflatex -synctex=1 -interaction=batchmode -shell-escape $(1).tex ; \
echo ""
endef
define pretty_print
@printf "\e[38;05;$(1)m[$(2)]: $(3)\e[m\n"
endef
.PHONY: clean FORCE_MAKE
all: $(NAME).pdf
open: $(NAME).pdf
open:
evince $(NAME).pdf
watch:
when-changed src $(NAME).tex -c $(MAKE)
%.pdf: %.tex FORCE_MAKE
$(call pretty_print,$(BLUE),make,compiling...)
$(call compile_tex,$(basename $<))
$(call pretty_print,$(GREEN),make,✓ done!)
clean:
$(call pretty_print,$(BLUE),make,cleaning up...)
@echo ""
@cat ./.make/art/maid.ascii
@echo "\n"
rm -rf $(NAME).{acn,glo,ist,run.xml,upa,upb,bcf,aux,bbl,blg,lof,log,lot,synctex.gz,toc,fls,fdb_latexmk,'synctex.gz(busy)'} _minted-main
@echo ""
$(call pretty_print,$(GREEN),make,✓ done!)