-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
223 lines (183 loc) · 6.19 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
MAX_VERSION := 8
CHUCK_PACKAGE := "$(HOME)/Documents/Max\ $(MAX_VERSION)/Packages/chuck-max"
SCRIPTS := source/scripts
BUILD := build
CONFIG = Release
THIRDPARTY = $(BUILD)/thirdparty
LIB = $(THIRDPARTY)/install/lib
CHUCK = $(THIRDPARTY)/install/bin/chuck
DIST = $(BUILD)/dist/chuck-max
ARCH=$(shell uname -m)
DMG=chuck-max-$(VERSION)-$(ARCH).dmg
ENTITLEMENTS = source/scripts/entitlements.plist
VERSION=0.1.2
.PHONY: all native universal full light brew brew2 nomp3 dev setup \
clean reset test test-fauck test-warpbuf test-fluidsynth \
install_deps install_deps_light install_deps_nomp3 \
sign package dmg sign-dmg notarize staple sign-dist \
release dist-release
all: native
native:
@mkdir -p build && \
cd build && \
cmake -GXcode .. && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
universal:
@mkdir -p build && \
cd build && \
cmake -GXcode -DC74_BUILD_FAT=ON .. && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
install_deps:
./source/scripts/install_deps.sh
install_deps_nomp3:
./source/scripts/install_deps_nomp3.sh
install_deps_light:
./source/scripts/install_deps_light.sh
install_faust:
./source/scripts/dep/install_faust.sh
./source/scripts/dep/install_libfaust.sh
brew: install_faust
@mkdir -p build && \
cd build && \
cmake -GXcode .. \
-DENABLE_HOMEBREW=ON \
-DENABLE_EXTRA_FORMATS=ON \
-DENABLE_MP3=ON \
-DENABLE_WARPBUF=ON \
-DENABLE_FAUCK=ON && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
brew2: install_faust
@mkdir -p build && \
cd build && \
cmake -GXcode .. \
-DENABLE_HOMEBREW=ON \
-DENABLE_EXTRA_FORMATS=ON \
-DENABLE_MP3=ON \
-DENABLE_WARPBUF=ON \
-DENABLE_FAUCK=ON \
-DENABLE_FLUIDSYNTH=ON && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
full: install_deps
@mkdir -p build && \
cd build && \
cmake -GXcode .. \
-DENABLE_EXTRA_FORMATS=ON \
-DENABLE_MP3=ON \
-DENABLE_WARPBUF=ON \
-DENABLE_FAUCK=ON && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
nomp3: install_deps_nomp3
@mkdir -p build && \
cd build && \
cmake -GXcode .. \
-DENABLE_EXTRA_FORMATS=ON \
-DENABLE_MP3=OFF \
-DENABLE_WARPBUF=ON \
-DENABLE_FAUCK=ON && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
light: install_deps_light
@mkdir -p build && \
cd build && \
cmake -GXcode .. \
-DENABLE_EXTRA_FORMATS=OFF \
-DENABLE_MP3=OFF \
-DENABLE_WARPBUF=ON \
-DENABLE_FAUCK=ON && \
cmake --build . --config '$(CONFIG)' && \
cmake --install . --config '$(CONFIG)'
strip:
@strip -u -r externals/chuck\~.mxo/Contents/MacOS/chuck\~
@strip -x examples/chugins/*.chug
sign:
@codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force externals/chuck\~.mxo/Contents/MacOS/chuck\~ && \
codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force --options runtime \
--entitlements $(ENTITLEMENTS) externals/chuck\~.mxo && \
codesign --verify externals/chuck\~.mxo && \
codesign --verify externals/chuck\~.mxo/Contents/MacOS/chuck\~ && \
codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force examples/chugins/*.chug && \
codesign --verify examples/chugins/*.chug
package:
@rm -rf $(DIST) && \
mkdir -p $(DIST) && \
cp -af examples $(DIST)/examples && \
cp -af externals $(DIST)/externals && \
cp -rf help $(DIST)/help && \
cp -rf patchers $(DIST)/patchers && \
cp -f package-info.json $(DIST)/package-info.json && \
cp -f LICENSE $(DIST)/LICENSE && \
cp -f CHANGELOG.md $(DIST)/CHANGELOG.md && \
cp -f README.md $(DIST)/README.md && \
rm -f $(DIST)/examples/chuck && \
find $(DIST) -name ".DS_Store" -delete && \
echo "DONE"
sign-dist:
@codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force $(DIST)/externals/chuck\~.mxo/Contents/MacOS/chuck\~ && \
codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force --options runtime \
--entitlements $(ENTITLEMENTS) $(DIST)/externals/chuck\~.mxo && \
codesign --verify $(DIST)/externals/chuck\~.mxo && \
codesign --verify $(DIST)/externals/chuck\~.mxo/Contents/MacOS/chuck\~ && \
codesign --sign 'Developer ID Application: $(DEV_ID)' \
--timestamp --deep --force $(DIST)/examples/chugins/*.chug && \
codesign --verify $(DIST)/examples/chugins/*.chug
dmg:
@hdiutil create -volname CHUCK-MAX -srcfolder $(BUILD)/dist -ov -format UDBZ $(DMG)
sign-dmg:
@codesign --sign "Developer ID Application: $(DEV_ID)" --deep --force --verbose --options runtime "$(DMG)" && \
codesign --verify --verbose $(DMG)
notarize:
@xcrun notarytool submit "$(DMG)" --keychain-profile "$(KEYCHAIN_PROFILE)" --wait
staple:
@xcrun stapler staple "$(DMG)"
release: strip sign package dmg sign-dmg notarize staple
@echo "DONE"
dist-release: sign-dist dmg sign-dmg notarize staple
@echo "DONE"
link:
@cd examples && rm -f chuck && ln -s ../build/$(CONFIG)/chuck .
dev:
@mkdir -p build && cd build && cmake .. && make
clean:
@rm -rf \
build/$(CONFIG) \
build/*.ck \
build/*.cmake \
build/*.xcodeproj \
build/build \
build/CMake* \
build/install* \
build/package \
build/source \
externals
reset:
@rm -rf externals examples/chugins/*.chug
@rm -rf build/CMakeCache.txt build/CMakeFiles build/CMakeScripts build/Release build/build build/sine.ck
@rm -rf build/chuck-max.xcodeproj build/cmake_install.cmake build/install_manifest.txt build/source build/build
@rm -rf build/thirdparty/faust build/thirdparty/install build/thirdparty/libfaust build/dist
setup:
@git submodule init
@git submodule update
@if ! [ -L "$(CHUCK_PACKAGE)" ]; then \
ln -s "$(shell pwd)" "$(CHUCK_PACKAGE)" ; \
echo "... symlink created" ; \
else \
echo "... symlink already exists" ; \
fi
test:
@cd examples && ./chuck --chugin-path:chugins stk/rhodey-song.ck -v3
test-fauck:
@cd examples && ./chuck --chugin-path:chugins fauck/test.ck -v3
test-warpbuf:
@cd examples && ./chuck --chugin-path:chugins warpbuf/warpbuf_basic.ck -v3
test-fluidsynth:
@cd examples && ./chuck --chugin-path:chugins fluidsynth/FluidSynth-play.ck -v3