-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathmakefile
109 lines (86 loc) · 2.67 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
.PHONY: help
help: makefile
@tail -n +4 makefile | grep ".PHONY"
.PHONY: test
test:
gcc -Wall cbits/test.c cbits/simplecv.c cbits/perspectivetransform.c -o test_bin && ./test_bin
gcc -Wall cbits/simplecv.c cbits/perspectivetransform.c cbits/apply_test.c -o apply_test && ./apply_test
stack test
# TODO: Don't show icon in dock (https://stackoverflow.com/a/25462666/1850340)
Perspec.app: ~/.local/bin/perspec
platypus \
--name Perspec \
--app-icon images/icon.icns \
--interface-type 'None' \
--app-version 0.2.0.0-$$(date -u "+%Y-%m-%dT%H:%M") \
--author "Adrian Sieber" \
--bundled-file ~/.local/bin/perspec \
--bundled-file app-aux-files/Credits.html \
--bundled-file scripts \
--bundle-identifier com.adriansieber.Perspec \
--droppable \
--optimize-nib \
--overwrite \
--quit-after-execution \
--suffixes 'png|jpg|jpeg|bmp|gif|tiff|tif' \
--interpreter '/bin/dash' \
app-aux-files/perspec-gui.sh \
$@
# TODO: Fix crash after dropping image
# TODO: Implement drag & drop for dock icon (WIP at macos-app-wrapper)
PerspecSimple.app: ~/.local/bin/perspec
mkdir -p $@
mkdir -p $@/Contents
mkdir -p $@/Contents/MacOS
cp $< $@/Contents/MacOS/PerspecSimple
mkdir -p $@/Contents/Resources
cp app-aux-files/Info.plist $@/Contents
cp images/icon.icns $@/Contents/Resources/AppIcon.icns
cp app-aux-files/Credits.html $@/Contents/Resources
cp $< $@/Contents/Resources
PerspecWithMagick.app: ~/.local/bin/perspec imagemagick
platypus \
--name PerspecWithMagick \
--app-icon images/icon.icns \
--interface-type 'Text Window' \
--app-version 0.2.0.0-$$(date -u "+%Y-%m-%dT%H:%M") \
--author "Adrian Sieber" \
--bundled-file ~/.local/bin/perspec \
--bundled-file app-aux-files/Credits.html \
--bundled-file imagemagick \
--bundled-file scripts \
--bundle-identifier com.adriansieber.PerspecWithMagick \
--droppable \
--optimize-nib \
--overwrite \
--quit-after-execution \
--suffixes 'png|jpg|jpeg|bmp|gif|tiff|tif' \
--interpreter '/bin/dash' \
app-aux-files/perspec.sh \
$@
# For macOS
imagemagick:
curl -L \
https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-x86_64-apple-darwin20.1.0.tar.gz \
-o imagemagick.tar.gz
tar -xzf imagemagick.tar.gz
rm -rf imagemagick
mv ImageMagick-7.* imagemagick
~/.local/bin/perspec: app source images/banner.bmp
stack install
.PHONY: perspec
perspec: ~/.local/bin/perspec
images/banner.bmp: images/banner.png
magick $< $@
.PHONY: install
install: Perspec.app
rm -rf /Applications/Perspec.app
cp -R Perspec.app /Applications/Perspec.app
.PHONY: clean
clean:
-rm -rf \
~/.local/bin/perspec \
.stack-work \
imagemagick \
imagemagick.tar.gz \
Perspec.app \