-
-
Notifications
You must be signed in to change notification settings - Fork 148
/
Makefile
86 lines (67 loc) · 2.78 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
80
81
82
83
84
85
86
benchmark:
cd benchmarks && $(MAKE) $@
build-dependencies:
src/install-dependencies.sh
build-macos-icns:
rm -rf img/CrunchIcon.iconset
mkdir img/CrunchIcon.iconset
sips -z 16 16 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/icon_16x16.png
sips -z 32 32 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/[email protected]
sips -z 32 32 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/icon_32x32.png
sips -z 64 64 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/[email protected]
sips -z 128 128 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/icon_128x128.png
sips -z 256 256 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/[email protected]
sips -z 256 256 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/icon_256x256.png
sips -z 512 512 img/Crunch-icon-3.png --out img/CrunchIcon.iconset/[email protected]
cd img && iconutil -c icns CrunchIcon.iconset
build-macos-installer:
# https://github.com/sindresorhus/create-dmg
-rm bin/*.dmg
-cd bin && create-dmg Crunch.app
# create checksum file for the installer
cd bin && mv Crunch*.dmg Crunch-Installer.dmg
cd bin && shasum -a 256 Crunch-Installer.dmg > Crunch-Installer-checksum.txt
clean:
rm benchmarks/img/*-crunch.png
dist:
./dmg-builder.sh
dist-homebrew:
cask-repair crunch
install-executable:
sudo cp src/crunch.py /usr/local/bin/crunch
@echo " "
@echo "[*] crunch executable installed on path /usr/local/bin/crunch"
@echo "[*] Usage: $ crunch [image path 1]...[image path n]"
install-macos-service:
- sudo rm -rf ~/Library/Services/Crunch\ Image\(s\).workflow
sudo cp -R service/Crunch\ Image\(s\).workflow ~/Library/Services/Crunch\ Image\(s\).workflow
@echo " "
@echo "[*] Crunch Image(s) macOS service installed on the path ~/Library/Services/Crunch\ Image\(s\).workflow"
@echo " "
@echo "[*] You can use the Crunch service by right clicking on one or more PNG files, then select Services > Crunch Image(s)"
uninstall-dependencies:
sudo rm -rf ~/pngquant
sudo rm -rf ~/zopfli
@echo " "
@echo "[*] Dependency removal complete."
uninstall-executable:
sudo rm /usr/local/bin/crunch
@echo " "
@echo "[*] crunch executable uninstall complete."
uninstall-macos-service:
sudo rm -rf ~/Library/Services/Crunch\ Image\(s\).workflow
@echo " "
@echo "[*] The Crunch Image(s) macOS service was removed from your system"
test-coverage:
./coverage.sh
test-python:
tox
flake8 src/crunch.py
test-shell:
shellcheck --exclude=2046 src/*.sh
test-valid-png-output:
crunch testfiles/*.png
pngcheck testfiles/*-crunch.png
rm testfiles/*-crunch.png
test: test-python test-shell test-valid-png-output
.PHONY: benchmark build-dependencies install-executable install-macos-service uninstall-executable uninstall-macos-service test test-coverage test-python test-shell test-valid-png-output dist