-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (39 loc) · 1.36 KB
/
Makefile
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
46
47
48
49
50
GLEAM := $(shell which gleam)
VERSION := $(shell cat gleam.toml | grep "version =" | cut -d '=' -f 2 | tr -d ' ' | tr -d '"')
TERMUX_PREFIX ?= /data/data/com.termux/files
RUN_SCRIPT := scripts/gleamfonts
DIST_TAR := gleamfonts-$(VERSION).tgz
ENTRYPOINT := build/erlang-shipment/entrypoint.sh
export ESQLITE_USE_SYSTEM ?= 1
all: package
package: erlang-shipment
build: deps
$(GLEAM) build -t erlang
test: deps
$(GLEAM) test -t erlang
deps:
$(GLEAM) deps download
clean:
$(GLEAM) clean
rm -f $(DIST_TAR)
rm -f ./tmp
check-format:
$(GLEAM) format --check src test
format:
$(GLEAM) format src test
erlang-shipment: $(SRCS)
$(GLEAM) export erlang-shipment
install: package
sed -i 's|#!/bin/sh|#!$(TERMUX_PREFIX)/usr/bin/sh|' $(ENTRYPOINT)
mkdir -p $(TERMUX_PREFIX)/usr/opt/gleamfonts
cp -r build/erlang-shipment/* $(TERMUX_PREFIX)/usr/opt/gleamfonts/
install -m 0775 $(RUN_SCRIPT) $(TERMUX_PREFIX)/usr/bin/gleamfonts
dist: package
sed -i 's|#!/bin/sh|#!$(TERMUX_PREFIX)/usr/bin/sh|' $(ENTRYPOINT)
mkdir -p tmp/gleamfonts-$(VERSION)/usr/opt/gleamfonts
mkdir -p tmp/gleamfonts-$(VERSION)/usr/bin
cp -r build/erlang-shipment/* tmp/gleamfonts-$(VERSION)/usr/opt/gleamfonts/
install -m 0775 $(RUN_SCRIPT) tmp/gleamfonts-$(VERSION)/usr/bin/gleamfonts
install -m 0644 LICENSE tmp/gleamfonts-$(VERSION)/LICENSE
tar -czf $(DIST_TAR) -C tmp gleamfonts-$(VERSION)
rm -fr tmp