-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (55 loc) · 2.23 KB
/
Makefile
File metadata and controls
77 lines (55 loc) · 2.23 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
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
all: files
SERVER = pwmarcz.pl
TEXTURES = img/sticks.auto.png img/tiles.auto.png img/tiles-labels.auto.png img/center.auto.png img/winds.auto.png img/dice.auto.png
ICONS = img/icon-16.auto.png img/icon-32.auto.png img/icon-96.auto.png
.PHONY: parcel
parcel: files
./node_modules/.bin/parcel --no-hmr index.html about.html
.PHONY: server
server:
cd server && yarn start
.PHONY: files
files: img/models.auto.glb $(ICONS)
img/tiles.auto.png: img/tiles.svg
inkscape $< --actions 'select-by-id:layer2; object-set-attribute:style, display:none' \
--export-filename=$@ --export-width=512 --export-background=#ffffff --export-background-opacity=1
img/tiles-labels.auto.png: img/tiles.svg
inkscape $< --export-filename=$@ --export-width=512 --export-background=#ffffff --export-background-opacity=1
img/sticks.auto.png: img/sticks.svg
inkscape $< --export-filename=$@ --export-width=256 --export-height=512
img/center.auto.png: img/center.svg
inkscape $< --export-filename=$@ --export-width=512 --export-height=512
img/winds.auto.png: img/winds.svg
inkscape $< --export-filename=$@ --export-width=128 --export-height=64
img/dice.auto.png: img/dice.svg
inkscape $< --export-filename=$@ --export-width=384 --export-height=64
img/icon-%.auto.png: img/icon.svg
inkscape $< --export-filename=$@ --export-width=$*
img/models.auto.glb: img/models.blend $(TEXTURES)
blender $< --background --python export.py -- $@
.PHONY: build
build: files check
rm -rf build
./node_modules/.bin/parcel build *.html --public-url . --cache-dir .cache/build/ --dist-dir build/
.PHONY: build-server
build-server:
cd server && yarn build
.PHONY: staging
staging: build
rsync -rva --checksum --delete build/ $(SERVER):autotable/dist-staging/
.PHONY: release
release: build
git push -f origin @:refs/heads/release/client
rsync -rva --checksum --delete build/ $(SERVER):autotable/dist/
.PHONY: release-server
release-server: build-server
git push -f origin @:refs/heads/release/server
rsync -rva --checksum --delete --exclude node_modules/ server/ $(SERVER):autotable/server/
ssh $(SERVER) 'cd autotable/server && yarn'
ssh $(SERVER) 'sudo systemctl restart autotable-server.service'
.PHONY: test
test:
cd server && yarn test
.PHONY: check
check:
./node_modules/.bin/tsc --noEmit