-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (26 loc) · 831 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
PACKAGES=".:./packages/:"
GENERATED=generated
ifneq ($(MAKECMDGOALS),new)
include .PROJECT
endif
all: $(GENERATED)/$(PROJECT).pdf
new:
@echo -n "Please enter project name: " ; \
read PROJECT ; \
echo "PROJECT=$${PROJECT}" > .PROJECT ; \
cp packages/template.tex $${PROJECT}.tex
pdf: $(GENERATED)/$(PROJECT).aux
env TEXINPUTS=$(PACKAGES) pdflatex -output-directory=$(GENERATED)/ $(PROJECT).tex
view: $(GENERATED)/$(PROJECT).pdf
exo-open $(GENERATED)/$(PROJECT).pdf
$(GENERATED)/$(PROJECT).pdf:
$(MAKE) pdf
$(GENERATED)/$(PROJECT).aux: $(PROJECT).tex
env TEXINPUTS=$(PACKAGES) pdflatex -output-directory=$(GENERATED)/ -draftmode $(PROJECT).tex
clean:
rm -f $(GENERATED)/*.{log,toc,aux,out}
cclean: clean
rm -f $(GENERATED)/*.pdf
.PROJECT:
$(error Please run "make new" first)
.PHONY: clean cclean pdf view new