forked from falkTX/Cadence
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
272 lines (223 loc) · 11.3 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
#!/usr/bin/make -f
# Makefile for Cadence #
# ---------------------- #
# Created by falkTX
# Modified (post 2023) by Nedko Arnaudov
CODETREENAME="ladi-cadence"
VERSION="1.9.4"
PREFIX = /usr/local
DESTDIR =
LINK = ln -s
PYUIC ?= pyuic5
PYRCC ?= pyrcc5
PYLUPDATE ?= pylupdate5
LRELEASE ?= lrelease
# Detect X11 rules dir
ifeq "$(wildcard /etc/X11/Xsession.d/ )" ""
X11_RC_DIR = $(DESTDIR)/etc/X11/xinit/xinitrc.d/
else
X11_RC_DIR = $(DESTDIR)/etc/X11/Xsession.d/
endif
# -----------------------------------------------------------------------------------------------------------------------------------------
# Internationalization
I18N_LANGUAGES :=
# -----------------------------------------------------------------------------------------------------------------------------------------
all: CPP RES UI locale
# -----------------------------------------------------------------------------------------------------------------------------------------
# C++ code
CPP: jackmeter xycontroller
jackmeter:
$(MAKE) -C c++/jackmeter
xycontroller:
$(MAKE) -C c++/xycontroller
# -----------------------------------------------------------------------------------------------------------------------------------------
# Resources
RES: src/resources_rc.py
src/resources_rc.py: resources/resources.qrc
$(PYRCC) $< -o $@
# -----------------------------------------------------------------------------------------------------------------------------------------
# Translations
locale: locale/cadence_en.qm locale/cadence_fr.qm
locale/%.qm: locale/%.ts
$(LRELEASE) $< -qm $@
# -----------------------------------------------------------------------------------------------------------------------------------------
# UI code
UI: cadence catarina catia claudia tools
cadence: src/ui_cadence.py \
src/ui_cadence_tb_jack.py src/ui_cadence_tb_alsa.py src/ui_cadence_tb_a2j.py src/ui_cadence_tb_pa.py \
src/ui_cadence_rwait.py
catarina: src/ui_catarina.py \
src/ui_catarina_addgroup.py src/ui_catarina_removegroup.py src/ui_catarina_renamegroup.py \
src/ui_catarina_addport.py src/ui_catarina_removeport.py src/ui_catarina_renameport.py \
src/ui_catarina_connectports.py src/ui_catarina_disconnectports.py
catia: src/ui_catia.py
claudia: src/ui_claudia.py \
src/ui_claudia_studioname.py src/ui_claudia_studiolist.py \
src/ui_claudia_createroom.py src/ui_claudia_projectname.py src/ui_claudia_projectproperties.py \
src/ui_claudia_runcustom.py src/ui_claudia_launcher.py src/ui_claudia_launcher_app.py
tools: \
src/ui_logs.py src/ui_render.py \
src/ui_settings_app.py src/ui_settings_jack.py
src/ui_%.py: resources/ui/%.ui
$(PYUIC) $< -o $@
# -----------------------------------------------------------------------------------------------------------------------------------------
clean:
$(MAKE) clean -C c++/jackmeter
$(MAKE) clean -C c++/xycontroller
rm -f *~ src/*~ src/*.pyc src/ui_*.py src/resources_rc.py resources/locale/*.qm
# -----------------------------------------------------------------------------------------------------------------------------------------
debug:
$(MAKE) DEBUG=true
# -----------------------------------------------------------------------------------------------------------------------------------------
install:
# Create directories
install -d $(DESTDIR)/etc/xdg/autostart/
install -d $(DESTDIR)$(PREFIX)/bin/
install -d $(DESTDIR)$(PREFIX)/share/applications/
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
install -d $(DESTDIR)$(PREFIX)/share/cadence/
install -d $(DESTDIR)$(PREFIX)/share/cadence/src/
install -d $(DESTDIR)$(PREFIX)/share/cadence/pulse2jack/
install -d $(DESTDIR)$(PREFIX)/share/cadence/pulse2loopback/
install -d $(DESTDIR)$(PREFIX)/share/cadence/icons/
install -d $(DESTDIR)$(PREFIX)/share/cadence/templates/
install -d $(DESTDIR)$(PREFIX)/share/cadence/locale/
install -d $(X11_RC_DIR)
# Install script files and binaries
install -m 755 \
data/cadence \
data/cadence-aloop-daemon \
data/cadence-jacksettings \
data/cadence-logs \
data/cadence-pulse2jack \
data/cadence-pulse2loopback \
data/cadence-render \
data/cadence-session-start \
data/catarina \
data/catia \
data/claudia \
data/claudia-launcher \
c++/jackmeter/cadence-jackmeter \
c++/xycontroller/cadence-xycontroller \
$(DESTDIR)$(PREFIX)/bin/
# Install desktop files
install -m 644 data/autostart/*.desktop $(DESTDIR)/etc/xdg/autostart/
install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/
# Install icons, 16x16
install -m 644 resources/16x16/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
install -m 644 resources/16x16/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
install -m 644 resources/16x16/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
install -m 644 resources/16x16/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
install -m 644 resources/16x16/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
# Install icons, 48x48
install -m 644 resources/48x48/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
install -m 644 resources/48x48/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
install -m 644 resources/48x48/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
install -m 644 resources/48x48/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
install -m 644 resources/48x48/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
# Install icons, 128x128
install -m 644 resources/128x128/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
install -m 644 resources/128x128/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
install -m 644 resources/128x128/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
install -m 644 resources/128x128/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
install -m 644 resources/128x128/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/
# Install icons, 256x256
install -m 644 resources/256x256/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
install -m 644 resources/256x256/catarina.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
install -m 644 resources/256x256/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
install -m 644 resources/256x256/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
install -m 644 resources/256x256/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
# Install icons, scalable
install -m 644 resources/scalable/cadence.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
install -m 644 resources/scalable/catarina.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
install -m 644 resources/scalable/catia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
install -m 644 resources/scalable/claudia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
install -m 644 resources/scalable/claudia-launcher.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/
# Install main code
install -m 644 src/*.py $(DESTDIR)$(PREFIX)/share/cadence/src/
# Install translations
install -m 644 locale/*.qm $(DESTDIR)$(PREFIX)/share/cadence/locale/
# compile python files
python3 -m compileall $(DESTDIR)$(PREFIX)/share/cadence/src/
# Install addtional stuff for Cadence
install -m 644 data/pulse2jack/* $(DESTDIR)$(PREFIX)/share/cadence/pulse2jack/
install -m 644 data/pulse2loopback/* $(DESTDIR)$(PREFIX)/share/cadence/pulse2loopback/
install -m 755 data/61-cadence-session-inject.sh $(X11_RC_DIR)
# Install addtional stuff for Claudia
cp -r data/icons/* $(DESTDIR)$(PREFIX)/share/cadence/icons/
cp -r data/templates/* $(DESTDIR)$(PREFIX)/share/cadence/templates/
# Adjust PREFIX value in script files
sed -i "s?X-PREFIX-X?$(PREFIX)?" \
$(DESTDIR)$(PREFIX)/bin/cadence \
$(DESTDIR)$(PREFIX)/bin/cadence-aloop-daemon \
$(DESTDIR)$(PREFIX)/bin/cadence-jacksettings \
$(DESTDIR)$(PREFIX)/bin/cadence-logs \
$(DESTDIR)$(PREFIX)/bin/cadence-pulse2jack \
$(DESTDIR)$(PREFIX)/bin/cadence-pulse2loopback \
$(DESTDIR)$(PREFIX)/bin/cadence-render \
$(DESTDIR)$(PREFIX)/bin/cadence-session-start \
$(DESTDIR)$(PREFIX)/bin/catarina \
$(DESTDIR)$(PREFIX)/bin/catia \
$(DESTDIR)$(PREFIX)/bin/claudia \
$(DESTDIR)$(PREFIX)/bin/claudia-launcher \
$(X11_RC_DIR)/61-cadence-session-inject.sh
# Delete old scripts
rm -f $(X11_RC_DIR)/21cadence-session-inject
rm -f $(X11_RC_DIR)/61cadence-session-inject
rm -f $(X11_RC_DIR)/70cadence-plugin-paths
rm -f $(X11_RC_DIR)/99cadence-session-start
# -----------------------------------------------------------------------------------------------------------------------------------------
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/cadence*
rm -f $(DESTDIR)$(PREFIX)/bin/catarina
rm -f $(DESTDIR)$(PREFIX)/bin/catia
rm -f $(DESTDIR)$(PREFIX)/bin/claudia*
rm -f $(DESTDIR)$(PREFIX)/share/applications/cadence.desktop
rm -f $(DESTDIR)$(PREFIX)/share/applications/catarina.desktop
rm -f $(DESTDIR)$(PREFIX)/share/applications/catia.desktop
rm -f $(DESTDIR)$(PREFIX)/share/applications/claudia.desktop
rm -f $(DESTDIR)$(PREFIX)/share/applications/claudia-launcher.desktop
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/cadence.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/catarina.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/catia.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/claudia.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/claudia-launcher.png
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/cadence.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/catarina.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/catia.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/claudia.svg
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/claudia-launcher.svg
rm -f $(DESTDIR)/etc/xdg/autostart/cadence-session-start.desktop
rm -f $(X11_RC_DIR)/61-cadence-session-inject.sh
rm -rf $(DESTDIR)$(PREFIX)/share/cadence/
# Delete old scripts
rm -f $(X11_RC_DIR)/21cadence-session-inject
rm -f $(X11_RC_DIR)/61cadence-session-inject
rm -f $(X11_RC_DIR)/70cadence-plugin-paths
rm -f $(X11_RC_DIR)/99cadence-session-start
TARBALL_NAME := $(CODETREENAME)-$(VERSION)
dist:
git clean -xfd
git describe --tags
rm -rvf $(TARBALL_NAME)
mkdir -v $(TARBALL_NAME)
cp -v AUTHORS.adoc $(TARBALL_NAME)
cp -v COPYING $(TARBALL_NAME)
cp -v INSTALL.md $(TARBALL_NAME)
cp -v MAINTAINERS.adoc $(TARBALL_NAME)
cp -v Makefile $(TARBALL_NAME)
cp -v NEWS.adoc $(TARBALL_NAME)
cp -v README.md $(TARBALL_NAME)
# cp -v TODO
cp -rv c++ $(TARBALL_NAME)
cp -rv data $(TARBALL_NAME)
cp -rv resources $(TARBALL_NAME)
cp -rv src $(TARBALL_NAME)
tar cJf $(TARBALL_NAME).tar.xz $(TARBALL_NAME)
gpg -b $(TARBALL_NAME).tar.xz
gpg --verify $(TARBALL_NAME).tar.xz.sig
rm -rvf $(TARBALL_NAME)