-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathMakefile
79 lines (60 loc) · 1.3 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
VENV_DIR = ./venv
VENV = . $(VENV_DIR)/bin/activate;
BUILD_DIR = build
GLYPHS_FILE = Lilex.glyphs
OTF_DIR = $(BUILD_DIR)/otf
TTF_DIR = $(BUILD_DIR)/ttf
VTTF_DIR = $(BUILD_DIR)/variable_ttf
VTTF_FILE = $(VTTF_DIR)/Lilex-VF.ttf
OS := $(shell uname)
define build_font
$(VENV) python scripts/lilex.py build $(1)
endef
configure: requirements.txt
rm -rf $(VENV_DIR)
make $(VENV_DIR)
configure_preview: preview/*.yaml preview/*.json
cd preview; pnpm install
.PHONY: lint
lint:
$(VENV) ruff scripts/
$(VENV) pylint scripts/
.PHONY: generate
generate:
$(VENV) python scripts/lilex.py generate
.PHONY: build
build:
$(call build_font)
.PHONY: build_preview
build_preview:
cd preview; pnpm run build
.PHONY: run_preview
run_preview:
cd preview; pnpm run dev
.PHONY: bundle
bundle:
rm -rf "$(BUILD_DIR)"
make build
cd "$(BUILD_DIR)"; zip -r Lilex.zip ./*
.PHONY: ttf
ttf:
$(call build_font,ttf)
.PHONY: otf
otf:
$(call build_font,otf)
.PHONY: variable
variable:
$(call build_font,variable)
install:
make install_$(OS)
install_Darwin:
rm -rf ~/Library/Fonts/Lilex
cp -r build/otf ~/Library/Fonts/Lilex
install_Linux:
mkdir -p ~/.fonts
rm -rf ~/.fonts/Lilex
$(VENV_DIR): requirements.txt
rm -rf "$(VENV_DIR)"
python3 -m venv "$(VENV_DIR)"
$(VENV) pip install wheel
$(VENV) pip install -r requirements.txt