Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (35 loc) · 1.52 KB
/
Copy pathMakefile
File metadata and controls
42 lines (35 loc) · 1.52 KB
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
# Packagers' entry points. `make build` needs the dependencies installed (`make deps`, offline with a store);
# `make install` copies the built files, `make install-fonts` the optional
# Noto Sans TC/SC. Both honour DESTDIR and PREFIX.
PREFIX ?= /usr
DESTDIR ?=
DATADIR = $(DESTDIR)$(PREFIX)/share/doona
DOCDIR = $(DESTDIR)$(PREFIX)/share/doc/doona
INSTALL ?= install
.PHONY: deps build check install install-fonts package
deps:
pnpm install --frozen-lockfile --offline || pnpm install --frozen-lockfile
build:
pnpm build
check:
pnpm check
# Everything in dist/ except the fonts and the Vite build manifest, plus the licence and notices. tools/notices.mjs
# adds the licence texts the program needs and THIRD-PARTY-NOTICES.txt, as tools/package.sh does for the archive.
install:
@test -f dist/index.html || { echo 'run make build first' >&2; exit 1; }
find dist \( -path dist/fonts -o -path dist/.vite \) -prune -o -type f -print | while read -r f; do \
$(INSTALL) -Dm644 "$$f" "$(DATADIR)/$${f#dist/}" || exit 1; \
done
$(INSTALL) -Dm644 LICENSE "$(DOCDIR)/LICENSE"
$(INSTALL) -Dm644 NOTICE "$(DOCDIR)/NOTICE"
$(INSTALL) -Dm644 README.md "$(DOCDIR)/README.md"
$(INSTALL) -Dm644 CHANGELOG.md "$(DOCDIR)/CHANGELOG.md"
node tools/notices.mjs "$(DOCDIR)"
install-fonts:
@test -d dist/fonts || { echo 'run make build first' >&2; exit 1; }
find dist/fonts -type f | while read -r f; do \
$(INSTALL) -Dm644 "$$f" "$(DATADIR)/$${f#dist/}" || exit 1; \
done
$(INSTALL) -Dm644 dist/fonts/OFL.txt "$(DOCDIR)/OFL.txt"
package:
tools/package.sh