X-Git-Url: https://git.ladys.computer/OldStandard/blobdiff_plain/aa5b60e7f6d56f244dc7297d0daf4f5ccb6d17e8..82b1f16122befa2fb11bf3fecb404a7f5ee62503:/makefile diff --git a/makefile b/makefile index 1748e0a..5e3101a 100644 --- a/makefile +++ b/makefile @@ -1,24 +1,59 @@ pkg := oldstandard -ver := $(shell grep '\\edef\\pkgver' $(pkg).tex | grep -Eo '[0-9]?\.[0-9]?') +SHELL = /usr/local/bin/bash +PWD = $(shell pwd) +#ver := $(shell grep '\\edef\\pkgver' $(pkg).tex | grep -Eo '[0-9]{1,}\.[0-9]{1,}[a-z]{,1}') +ver := $(shell grep '\\edef\\pkgver' oldstandard.tex | egrep -o '[0-9]{1,}\.[0-9]{1,}\-?[a-z]?') TEXMFDIR := $(shell kpsewhich -expand-var='$$TEXMFHOME') HOMEDIR := $$HOME +LOCALFONTDIR := $(HOMEDIR)/.local/share/fonts -doc: clean - lualatex --shell-escape $(pkg).tex - biber $(pkg) - lualatex --shell-escape $(pkg).tex - lualatex --shell-escape $(pkg).tex +doc: local + @echo "Building the documentation. Please wait..." + lualatex --shell-escape $(pkg).tex >/dev/null + biber $(pkg) >/dev/null + lualatex --shell-escape $(pkg).tex >/dev/null + lualatex --shell-escape $(pkg).tex >/dev/null + @echo "Building font table..." + lualatex --shell-escape fonttable.tex >/dev/null + lualatex --shell-escape fonttable.tex >/dev/null + @echo "Removing OldStandard .otf files from $(LOCALFONTDIR)..." + rm -f $(LOCALFONTDIR)/OldStandard-*.otf + luaotfload-tool --update + @echo "Done." -all: clean doc +all: doc -package: clean doc - mkdir $(pkg) - cp *.{txt,md,tex,pdf} $(pkg) - cp otf/*.otf $(pkg) - tar czf $(pkg)-$(ver).tar.gz $(pkg) +local: + @rm -f $(LOCALFONTDIR)/OldStandard-*.otf + @echo "Installing latest OldStandard .otf files in $(LOCALFONTDIR)..." + cp otf/OldStandard-*.otf $(LOCALFONTDIR)/ + luaotfload-tool --update + @echo "Installing .fontspec files..." + if [ ! -d "$(TEXMFDIR)/tex/latex/fontspec" ]; then \ + mkdir -p $(TEXMFDIR)/tex/latex/fontspec; \ + fi + cp fontspec/OldStandard.fontspec $(TEXMFDIR)/tex/latex/fontspec + @echo "Done." + +package: doc + mkdir $(pkg)-$(ver) + cp *.{txt,md,lua,tex,pdf} $(pkg)-$(ver) + cp otf/*.otf $(pkg)-$(ver) + cp fontspec/*.fontspec $(pkg)-$(ver) + tar czf $(pkg)-$(ver).tar.gz $(pkg)-$(ver) + @echo "$(pkg)-$(ver).tar.gz has been created." + +hal: clean + zip -Drq $(PWD)/$(pkg)-$(ver).zip * clean: + @echo "Removing OldStandard .otf files from $(LOCALFONTDIR)..." + rm -f $(LOCALFONTDIR)/OldStandard-*.otf + luaotfload-tool --update + @echo "Removing .fontspec files from local texmf dir..." + rm -f $(TEXMFDIR)/tex/latex/fontspec/OldStandard.fontspec git clean -df pandoc README.md -o about.html + @echo "Done." -.PHONY: doc all package clean +.PHONY: doc all local package clean