aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 5c34fdfc43bca75f8d799d360ef87e0baa22a159 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
pkg := oldstandard
ver  := $(shell grep '\\edef\\pkgver' $(pkg).tex | grep -Eo '[0-9]{1,}\.[0-9]{1,}[a-z]{,1}')
TEXMFDIR := $(shell kpsewhich -expand-var='$$TEXMFHOME')
HOMEDIR := $$HOME
LOCALFONTDIR := $(HOMEDIR)/.local/share/fonts

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: doc

local:
	@rm -f $(LOCALFONTDIR)/OldStandard-*.otf
	@echo "Installing latest OldStandard .otf files in $(LOCALFONTDIR)..."
	cp otf/OldStandard-*.otf $(LOCALFONTDIR)/
	luaotfload-tool --update
	@echo "Done."

package: doc
	mkdir $(pkg)-$(ver)
	cp *.{txt,md,lua,tex,pdf} $(pkg)-$(ver)
	cp otf/*.otf $(pkg)-$(ver)
	tar czf $(pkg)-$(ver).tar.gz $(pkg)-$(ver)
	@echo "$(pkg)-$(ver).tar.gz has been created."

clean:
	@echo "Removing OldStandard .otf files from $(LOCALFONTDIR)..."
	rm -f $(LOCALFONTDIR)/OldStandard-*.otf
	luaotfload-tool --update
	git clean -df
	pandoc README.md -o about.html
	@echo "Done."

.PHONY: doc all local package clean