summaryrefslogtreecommitdiff
path: root/support/tikztosvg/Makefile
blob: 1d5779d30aea944ed3ccc784319c8071d7aa4479 (plain)
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
.PHONY: package install

# Packages the application for CTAN
package: tikztosvg.tar.gz

install: man/tikztosvg.1 tikztosvg
	# Install the executable
	install -g 0 -o 0 -m 755 tikztosvg /usr/bin/
	 
	# Install the manpage
	install -g 0 -o 0 -m 644 man/tikztosvg.1 /usr/share/man/man1/

man/tikztosvg.1: man/man.adoc
	asciidoctor -b manpage -o $@ $^

tikztosvg.pdf: README.md 
	pandoc -s -o $@ $^

example/%.svg: example/%.tikz
	sh ./tikztosvg -p xfrac -p relsize -o $@ $^
	
	# Try to compress the image with svgo
	svgo --pretty --enable=sortAttrs $@ || exit 0

# Packages the application for CTAN
tikztosvg.tar.gz: tikztosvg man/tikztosvg.1 tikztosvg.pdf README.md example/example.tikz example/example.svg CHANGELOG.md LICENSE
	tar -cvO --directory=.. --exclude='.*' --exclude='*.tar.gz' tikztosvg \
		| gzip -c /dev/stdin > tikztosvg.tar.gz