-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
59 lines (46 loc) · 1.67 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
VERSION = 0.9
DESTDIR = lua-visual-debug
DOCDEST = $(DESTDIR)/doc
CP = cp -X
DATE_ISO = $(shell date +"%F")
DATE_TEX = $(shell date +"%Y\/%m\/%d")
all:
@echo "make: dist doc zip clean"
dist: doc
mkdir -p $(DESTDIR)
mkdir -p $(DOCDEST)
$(CP) README.md $(DOCDEST)
$(CP) lua-visual-debug.sty $(DESTDIR)
$(CP) lua-visual-debug.lua $(DESTDIR)
$(CP) tmp/lvdebug-doc.tex tmp/lvdebug-doc.pdf $(DOCDEST)
$(CP) sample.pdf sample.tex sample-plain.pdf sample-plain.tex $(DOCDEST)
$(CP) *png $(DOCDEST)
perl -pi -e 's/(lvdebugpkgversion)\{.*\}/$$1\{$(VERSION)\}/' $(DESTDIR)/lua-visual-debug.sty
perl -pi -e 's/(lvdebugpkgdate)\{.*\}/$$1\{$(DATE_TEX)\}/' $(DESTDIR)/lua-visual-debug.sty
perl -pi -e 's/(^-- Version:).*/$$1 $(VERSION)/' $(DESTDIR)/lua-visual-debug.lua
perl -pi -e 's/(Package version:).*/$$1 $(VERSION)/' $(DOCDEST)/README.md
rm -f $(DESTDIR)/README.md
( cd $(DESTDIR) ; ln -s doc/README.md )
doc: texsample latexsample
mkdir -p tmp
rm -rf tmp/*
cp lvdebug-doc.tex tmp
perl -pi -e 's/(pkgversion)\{.*\}/$$1\{$(VERSION)\}/' tmp/lvdebug-doc.tex
cp *png sample-plain.tex sample.tex sample-plain-crop.pdf sample-crop.pdf tmp
( cd tmp ; lualatex lvdebug-doc.tex)
( cd tmp ; lualatex lvdebug-doc.tex)
zip: clean dist
-rm lvdebug-$(VERSION).tgz
tar czvf lvdebug-$(VERSION).tgz $(DESTDIR)/*
clean:
-rm -rf tmp $(DESTDIR)
-rm sample-plain.pdf sample-plain-crop.pdf sample.pdf sample-crop.pdf
find . -name ".DS_Store" -exec rm {} \;
sample-plain.pdf: sample-plain.tex
luatex sample-plain.tex
pdfcrop --margins "1 1 1 1" sample-plain.pdf
sample.pdf: sample.tex
lualatex sample.tex
pdfcrop --margins "1 1 1 1" sample.pdf
texsample: sample-plain.pdf
latexsample: sample.pdf