-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (27 loc) · 1.26 KB
/
Makefile
File metadata and controls
37 lines (27 loc) · 1.26 KB
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
ALLFIGS := $(shell ls fig/*.fig)
ALLPNGS := $(patsubst fig/%,out/%,$(patsubst %.fig,%.png,$(ALLFIGS)))
TODAY := $(shell git show -s --format=%cd --date=format:"%Y%m%d" HEAD)
MKFILEPATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
$(info $(ALLPNGS))
all: jswitch.pdf jswitch_beamer.pdf
clean:
rm -rf out
out:
mkdir out
jswitch.pdf: src/jswitch.tex out/gitdate.tex $(ALLPNGS) out/jtag_logic.png | out
cd out; pdflatex ../src/jswitch.tex
cd out; pdflatex ../src/jswitch.tex
cp out/jswitch.pdf $(MKFILEPATH)/jswitch_doc_${TODAY}.pdf
mv out/jswitch.pdf $(MKFILEPATH)/jswitch_doc_current.pdf
jswitch_beamer.pdf: src/jswitch_beamer.tex out/gitdate.tex $(ALLPNGS) out/jtag_logic.png | out
cd out; pdflatex ../src/jswitch_beamer.tex; pdflatex ../src/jswitch_beamer.tex; pdflatex ../src/jswitch_beamer.tex
cp out/jswitch_beamer.pdf $(MKFILEPATH)/jswitch_beamer_${TODAY}.pdf
mv out/jswitch_beamer.pdf $(MKFILEPATH)/jswitch_beamer_current.pdf
.PHONY: out/gitdate.tex
out/gitdate.tex: src/gitdate.tex out
$(eval TODAY_NICE := $(shell git show -s --format=%cd --date=format:"%d %B %Y" HEAD))
sed 's/__GITDATE__/$(TODAY_NICE)/' $(PWD)/$< > $(PWD)/$@
out/jtag_logic.png: png/jtag_logic.png | out
cp $< $@
out/%.png: fig/%.fig | out
fig2dev -L png -m 2.0 -S 2 $< $@