-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
42 lines (28 loc) · 921 Bytes
/
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
# greasetools is required, you can get it from:
# https://github.com/EliasGrande/GreaseTools
# src
usersrc = ./src/cereal-ogame-stats.user.js
# constants
VERSION := $(shell greasetools meta-key version $(usersrc))
BROWSER = firefox
# dist
distdir = ./dist/releases
userdist = $(distdir)/latest.user.js
metadist = $(distdir)/latest.meta.js
versiondist = $(distdir)/$(VERSION).user.js
.PHONY: dist test install clean
dist: $(userdist) $(metadist) $(versiondist)
$(userdist): $(usersrc)
greasetools compress -o $(userdist) $(usersrc)
$(metadist): $(usersrc)
greasetools meta-block -o $(metadist) $(usersrc)
$(versiondist): $(userdist)
echo "$(VERSION)" | grep -qE '^[0-9]+(\.[0-9]+)*$$'
cp $(userdist) $(versiondist)
git add $(versiondist)
test:
greasetools install -b $(BROWSER) $(usersrc)
install: $(userdist)
greasetools install -b $(BROWSER) $(userdist)
clean:
greasetools clean-trash -r