diff options
Diffstat (limited to 'support/tikztosvg/Makefile')
-rw-r--r-- | support/tikztosvg/Makefile | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/support/tikztosvg/Makefile b/support/tikztosvg/Makefile index bae45ce4e3..ce66f807b6 100644 --- a/support/tikztosvg/Makefile +++ b/support/tikztosvg/Makefile @@ -1,35 +1,30 @@ +.PHONY: package install + # Packages the application for CTAN -package: - # Render the manpage - asciidoctor -b manpage -o man/tikztosvg.1 man/man.adoc +package: tikztosvg.tar.gz + +install: man/tikztosvg.1 tikztosvg + # Install the executable + cp tikztosvg ~/.local/bin/ + chmod +x ~/.local/bin/tikztosvg - # Render the README as PDF - asciidoctor -r asciidoctor-pdf -b pdf -o tikztosvg.pdf README.adoc - - # Render the README as Markdown - asciidoctor -b docbook -a leveloffset=+1 -o - README.adoc \ - | pandoc --atx-headers \ - --wrap=preserve \ - -t markdown_github \ - -f docbook - \ - | comby '![:[name]](:[link])' \ - '![:[name]](examples/:[link])' \ - -stdin \ - -stdout \ - -m .md \ - | comby ':imagesdir: :[[value]]' '' -stdin -stdout -m .md \ - | comby ':source-highlighter: :[[value]]' '' -stdin -stdout -m .md \ - > README.md + # Install the manpage + install -g 0 -o 0 -m 0644 man/tikztosvg.1 ~/.local/share/man/man1/ + +man/tikztosvg.1: man/man.adoc + asciidoctor -b manpage -o $@ $^ + +tikztosvg.pdf: README.md + pandoc -s -o $@ $^ + +example/example.svg: example/example.tikz + sh ./tikztosvg -p xfrac -p relsize -o $@ $^ - # Package the repository as a tar file - tar -cvO \ - --directory=.. \ - --exclude='.*' \ - --exclude='*.tar.gz' \ - --exclude='README.adoc' \ - tikztosvg \ - | gzip -c /dev/stdin > tikztosvg.tar.gz + # Try to compress the image with svgo + svgo --pretty --enable=sortAttrs $@ || exit 0 -install: - sh install.sh +# Packages the application for CTAN +tikztosvg.tar.gz: man/tikztosvg.1 tikztosvg.pdf README.md example/example.svg CHANGELOG.md + tar -cvO --directory=.. --exclude='.*' --exclude='*.tar.gz' tikztosvg \ + | gzip -c /dev/stdin > tikztosvg.tar.gz |