-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
52 lines (41 loc) · 1.34 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
inventory_json := inventory.json
apps := $(shell jq -r '"app-" + keys[]' $(inventory_json))
# Don't autoremove any intermediate files; they should be cached.
.SECONDARY:
.PHONY: clean
all: $(apps)
clean:
rm -rf dist
$(apps): app-% : \
dist/icon/16x16/%.png \
dist/icon/36x36/%.png
build/platforms/android:
mkdir -p $@
build/platforms/android/%.json: | build/platforms/android
if [ -s 'static/android/$*.json' ]; then \
cp 'static/android/$*.json' $@ \
; \
else \
jq -r '.["$*"].platforms.android.package' $(inventory_json) | \
xargs -I {} curl -sS -4 "https://play.google.com/store/apps/details?id={}&hl=en" | \
grep -Eo 'class="cover-image" src="([^"]+)"' | cut -c25- | awk '{print "{\"icon\":"$$0"}"}' | jq -S . > $@ \
; \
fi
build/platforms/android/%.png: build/platforms/android/%.json | build/platforms/android
if [ -s 'static/android/$*.png' ]; then \
cp 'static/android/$*.png' $@ \
; \
else \
jq -r '.icon' $< | xargs -I {} curl -sS -4 -o $@ {} \
; \
fi
dist/icon/16x16:
mkdir -p $@
dist/icon/16x16/%.png: build/platforms/android/%.png | dist/icon/16x16
gm convert $< -resize 16x16 $@
pngcrush -q -brute $@ [email protected] && mv [email protected] $@
dist/icon/36x36:
mkdir -p $@
dist/icon/36x36/%.png: build/platforms/android/%.png | dist/icon/36x36
gm convert $< -resize 36x36 $@
pngcrush -q -brute $@ [email protected] && mv [email protected] $@