-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.make
49 lines (39 loc) · 1.53 KB
/
Makefile.make
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
42
43
44
45
46
47
48
49
BIBER=biber
PDFLATEX=pdflatex -file-line-error -interaction=nonstopmode -output-directory . -jobname $(OUTPUT) $(PROJECT)
BIBTEX=bibtex
RM = rm -rf
REVISION = $(abspath ../build/revision.tex)
UNAME := $(shell uname)
# $(call convert_to_png, input.pdf, output,png)
define convert_to_png_lnx
convert -density 150 $(1) -quality 90 $(2)
endef
define convert_to_png_mac
sips -s format png --out $(2) $(1)
endef
TEX_SRC = $(wildcard *.tex)
TEX_SRC += $(wildcard */*.tex)
all: $(OUTPUT).pdf
$(OUTPUT).pdf : $(TEX_SRC) $(REVISION)
mkdir -p $(dir $(REVISION))
echo "% Autogenerated, do not edit" > $(REVISION)
echo "\\\newcommand{\\\revisiondate}{`git log -1 --format=\"%ad\" --date=iso`}" >> $(REVISION)
echo "\\\newcommand{\\\revision}{`git log -1 --format=\"%h\"`}" >> $(REVISION)
echo "\\\newcommand{\\\compiledate}{`date \"+%Y-%m-%d %H:%M:%S\"`}" >> $(REVISION)
echo "\\\newcommand{\\\hostname}{`hostname`}" >> $(REVISION)
$(PDFLATEX)
# $(BIBTEX) $(OUTPUT)
# $(BIBER) $(OUTPUT).bcf
$(PDFLATEX)
$(PDFLATEX)
docker: *.tex
docker run -v `pwd`:/source noah95/latex /usr/bin/make
$(REVISION):
mkdir -p $(dir $(REVISION))
echo "% Autogenerated, do not edit" > $(REVISION)
echo "\\\newcommand{\\\revisiondate}{`git log -1 --format=\"%ad\" --date=iso`}" >> $(REVISION)
echo "\\\newcommand{\\\revision}{`git log -1 --format=\"%h\"`}" >> $(REVISION)
echo "\\\newcommand{\\\compiledate}{`date \"+%Y-%m-%d %H:%M:%S\"`}" >> $(REVISION)
echo "\\\newcommand{\\\hostname}{`hostname`}" >> $(REVISION)
clean:
$(RM) *.aux *.bbl *.blg *.log *.out *.pdf build