Cleanup
[carla.git] / Makefile
blob3d2359ed82e31479419c350ea1e04840b73bc728
1 #!/usr/bin/make -f
2 # Makefile for Carla #
3 # ------------------ #
4 # Created by falkTX
7 CWD=source
8 include source/Makefile.mk
10 # ---------------------------------------------------------------------------------------------------------------------
12 PREFIX := /usr/local
13 BINDIR := $(PREFIX)/bin
14 LIBDIR := $(PREFIX)/lib
15 DATADIR := $(PREFIX)/share
16 INCLUDEDIR := $(PREFIX)/include
17 DESTDIR :=
19 ifeq ($(DEBUG),true)
20 MODULEDIR := $(CURDIR)/build/modules/Debug
21 else
22 MODULEDIR := $(CURDIR)/build/modules/Release
23 endif
25 # see also cmake/CMakeLists.txt, source/common/__init__.py and source/includes/CarlaDefines.h
26 VERSION := 2.6.0-alpha1
28 -include Makefile.user.mk
30 # ---------------------------------------------------------------------------------------------------------------------
32 TARGETS = backend frontend theme
34 ifneq ($(WASM),true)
35 TARGETS += bridges-plugin bridges-ui discovery interposer libjack plugin
36 endif
38 all: $(TARGETS)
40 # ---------------------------------------------------------------------------------------------------------------------
41 # Binaries (native)
43 ifneq ($(STATIC_PLUGIN_TARGET),true)
44 ALL_LIBS += $(MODULEDIR)/carla_engine.a
45 endif
46 ALL_LIBS += $(MODULEDIR)/carla_engine_plugin.a
47 ALL_LIBS += $(MODULEDIR)/carla_plugin.a
48 ALL_LIBS += $(MODULEDIR)/jackbridge.a
49 ifeq ($(STATIC_PLUGIN_TARGET),true)
50 ALL_LIBS += $(MODULEDIR)/jackbridge.min.a
51 endif
52 ALL_LIBS += $(MODULEDIR)/native-plugins.a
53 ALL_LIBS += $(MODULEDIR)/rtmempool.a
55 3RD_LIBS += $(MODULEDIR)/audio_decoder.a
56 3RD_LIBS += $(MODULEDIR)/lilv.a
57 ifneq ($(STATIC_PLUGIN_TARGET),true)
58 3RD_LIBS += $(MODULEDIR)/sfzero.a
59 endif
60 3RD_LIBS += $(MODULEDIR)/water.a
61 3RD_LIBS += $(MODULEDIR)/zita-resampler.a
63 ifeq ($(HAVE_DGL),true)
64 ifneq ($(USING_CUSTOM_DPF),true)
65 3RD_LIBS += $(MODULEDIR)/dgl.a
66 endif
67 endif
69 ifeq ($(HAVE_HYLIA),true)
70 3RD_LIBS += $(MODULEDIR)/hylia.a
71 endif
73 ifeq ($(HAVE_QT4),true)
74 3RD_LIBS += $(MODULEDIR)/theme.qt4.a
75 endif
77 ifeq ($(HAVE_QT5),true)
78 3RD_LIBS += $(MODULEDIR)/theme.qt5.a
79 endif
81 ifeq ($(HAVE_QT6),true)
82 3RD_LIBS += $(MODULEDIR)/theme.qt6.a
83 endif
85 ifeq ($(HAVE_YSFX),true)
86 3RD_LIBS += $(MODULEDIR)/ysfx.a
87 endif
89 ifeq ($(USING_RTAUDIO),true)
90 3RD_LIBS += $(MODULEDIR)/rtaudio.a
91 3RD_LIBS += $(MODULEDIR)/rtmidi.a
92 endif
94 ALL_LIBS += $(3RD_LIBS)
96 3rd: $(3RD_LIBS)
97 @$(MAKE) -C source/theme
98 ifeq ($(HAVE_QT4),true)
99 @$(MAKE) -C source/bridges-ui ui_lv2-qt4
100 endif
102 libs: $(ALL_LIBS)
104 $(MODULEDIR)/carla_engine.a: .FORCE
105 @$(MAKE) -C source/backend/engine
107 $(MODULEDIR)/carla_engine_plugin.a: $(MODULEDIR)/carla_engine.a
108 @$(MAKE) -C source/backend/engine
110 $(MODULEDIR)/carla_plugin.a: .FORCE
111 @$(MAKE) -C source/backend/plugin
113 $(MODULEDIR)/jackbridge.a: .FORCE
114 @$(MAKE) -C source/jackbridge
116 $(MODULEDIR)/jackbridge.%.a: .FORCE
117 @$(MAKE) -C source/jackbridge $*
119 $(MODULEDIR)/native-plugins.a: .FORCE
120 @$(MAKE) -C source/native-plugins
122 $(MODULEDIR)/theme.qt4.a: .FORCE
123 @$(MAKE) -C source/theme qt4
125 $(MODULEDIR)/theme.qt5.a: .FORCE
126 @$(MAKE) -C source/theme qt5
128 $(MODULEDIR)/theme.qt6.a: .FORCE
129 @$(MAKE) -C source/theme qt6
131 $(MODULEDIR)/%.arm32.a: .FORCE
132 ifneq ($(WINDOWS),true)
133 @$(MAKE) -C source/modules/$* arm32
134 else
135 $(error Trying to build ARM binaries with a Windows toolchain, this cannot work)
136 endif
138 $(MODULEDIR)/%.posix32.a: .FORCE
139 ifneq ($(WINDOWS),true)
140 @$(MAKE) -C source/modules/$* posix32
141 else
142 $(error Trying to build POSIX binaries with a Windows toolchain, this cannot work)
143 endif
145 $(MODULEDIR)/%.posix64.a: .FORCE
146 ifneq ($(WINDOWS),true)
147 @$(MAKE) -C source/modules/$* posix64
148 else
149 $(error Trying to build POSIX binaries with a Windows toolchain, this cannot work)
150 endif
152 $(MODULEDIR)/%.win32.a: .FORCE
153 ifeq ($(WINDOWS),true)
154 @$(MAKE) -C source/modules/$* win32
155 else
156 $(error Trying to build Windows binaries with a regular toolchain, this cannot work)
157 endif
159 $(MODULEDIR)/%.win64.a: .FORCE
160 ifeq ($(WINDOWS),true)
161 @$(MAKE) -C source/modules/$* win64
162 else
163 $(error Trying to build Windows binaries with a regular toolchain, this cannot work)
164 endif
166 $(MODULEDIR)/dgl.wine.a: .FORCE
167 @$(MAKE) -C source/modules/dgl wine
169 $(MODULEDIR)/water.files.a: .FORCE
170 @$(MAKE) -C source/modules/water files
172 $(MODULEDIR)/%.a: .FORCE
173 @$(MAKE) -C source/modules/$*
175 # ---------------------------------------------------------------------------------------------------------------------
177 backend: libs
178 @$(MAKE) -C source/backend
180 bridges-plugin: libs
181 @$(MAKE) -C source/bridges-plugin
183 bridges-ui: libs
184 @$(MAKE) -C source/bridges-ui
186 discovery: libs
187 @$(MAKE) -C source/discovery
189 frontend: backend
190 ifeq ($(HAVE_FRONTEND),true)
191 @$(MAKE) -C source/frontend
192 endif
194 interposer:
195 ifeq ($(LINUX),true)
196 @$(MAKE) -C source/interposer
197 endif
199 libjack: libs
200 @$(MAKE) -C source/libjack
202 lv2-bundles-dep: $(MODULEDIR)/audio_decoder.a $(MODULEDIR)/water.a $(MODULEDIR)/zita-resampler.a
203 @$(MAKE) -C source/native-plugins bundles
205 lv2-bundles: lv2-bundles-dep
206 @$(MAKE) -C source/plugin bundles
208 plugin: backend bridges-plugin bridges-ui discovery
209 @$(MAKE) -C source/plugin
211 ifeq ($(WINDOWS),true)
212 plugin-wine:
213 @$(MAKE) -C source/plugin wine
214 else
215 plugin-wine: $(MODULEDIR)/dgl.wine.a
216 @$(MAKE) -C source/plugin wine
217 endif
219 rest: libs
220 @$(MAKE) -C source/rest
222 theme: libs
223 @$(MAKE) -C source/theme
225 # ---------------------------------------------------------------------------------------------------------------------
226 # static targets
228 static-backend: libs
229 @$(MAKE) -C source/backend static
231 static-plugin: static-backend
232 @$(MAKE) -C source/plugin static
234 # ---------------------------------------------------------------------------------------------------------------------
235 # hacks
237 msys2fix:
238 rm -rf source/includes/serd
239 rm -rf source/includes/sord
240 rm -rf source/includes/sratom
241 rm -rf source/includes/lilv
242 cp -r source/modules/lilv/serd-0.24.0/serd source/includes/serd
243 cp -r source/modules/lilv/sord-0.16.0/sord source/includes/sord
244 cp -r source/modules/lilv/sratom-0.6.0/sratom source/includes/sratom
245 cp -r source/modules/lilv/lilv-0.24.0/lilv source/includes/lilv
247 # ---------------------------------------------------------------------------------------------------------------------
248 # Binaries (arm32)
250 LIBS_ARM32 = $(MODULEDIR)/jackbridge.arm32.a
251 LIBS_ARM32 += $(MODULEDIR)/lilv.arm32.a
252 LIBS_ARM32 += $(MODULEDIR)/rtmempool.arm32.a
253 LIBS_ARM32 += $(MODULEDIR)/water.arm32.a
255 arm32: $(LIBS_ARM32)
256 $(MAKE) -C source/bridges-plugin arm32
257 $(MAKE) -C source/discovery arm32
259 # ---------------------------------------------------------------------------------------------------------------------
260 # Binaries (posix32)
262 LIBS_POSIX32 = $(MODULEDIR)/jackbridge.posix32.a
263 LIBS_POSIX32 += $(MODULEDIR)/lilv.posix32.a
264 LIBS_POSIX32 += $(MODULEDIR)/rtmempool.posix32.a
265 LIBS_POSIX32 += $(MODULEDIR)/water.posix32.a
267 posix32: $(LIBS_POSIX32)
268 $(MAKE) -C source/bridges-plugin posix32
269 $(MAKE) -C source/discovery posix32
271 # ---------------------------------------------------------------------------------------------------------------------
272 # Binaries (posix64)
274 LIBS_POSIX64 = $(MODULEDIR)/jackbridge.posix64.a
275 LIBS_POSIX64 += $(MODULEDIR)/lilv.posix64.a
276 LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a
277 LIBS_POSIX64 += $(MODULEDIR)/water.posix64.a
279 posix64: $(LIBS_POSIX64)
280 $(MAKE) -C source/bridges-plugin posix64
281 $(MAKE) -C source/discovery posix64
283 # ---------------------------------------------------------------------------------------------------------------------
284 # Binaries (win32)
286 LIBS_WIN32 += $(MODULEDIR)/lilv.win32.a
287 LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a
288 LIBS_WIN32 += $(MODULEDIR)/water.win32.a
290 LIBS_WINE32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32e.a
291 LIBS_RWIN32 = $(LIBS_WIN32) $(MODULEDIR)/jackbridge.win32.a
293 ifeq ($(CC),x86_64-w64-mingw32-gcc)
294 win32:
295 $(MAKE) AR=i686-w64-mingw32-ar CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ win32-i686
297 win32r:
298 $(MAKE) AR=i686-w64-mingw32-ar CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ win32r-i686
299 else
300 win32: win32-i686
301 win32r: win32r-i686
302 endif
304 win32-i686: $(LIBS_WINE32)
305 $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win32
306 $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win32
308 win32r-i686: $(LIBS_RWIN32)
309 $(MAKE) -C source/bridges-plugin win32
310 $(MAKE) -C source/discovery win32
312 # ---------------------------------------------------------------------------------------------------------------------
313 # Binaries (win64)
315 LIBS_WIN64 += $(MODULEDIR)/lilv.win64.a
316 LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a
317 LIBS_WIN64 += $(MODULEDIR)/water.win64.a
319 LIBS_WINE64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64e.a
320 LIBS_RWIN64 = $(LIBS_WIN64) $(MODULEDIR)/jackbridge.win64.a
322 win64: $(LIBS_WINE64)
323 $(MAKE) BUILDING_FOR_WINE=true -C source/bridges-plugin win64
324 $(MAKE) BUILDING_FOR_WINE=true -C source/discovery win64
326 win64r: $(LIBS_RWIN64)
327 ifeq ($(CC),i686-w64-mingw32-gcc)
328 $(MAKE) CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -C source/bridges-plugin win64
329 $(MAKE) CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ -C source/discovery win64
330 else
331 $(MAKE) -C source/bridges-plugin win64
332 $(MAKE) -C source/discovery win64
333 endif
335 mingw64:
336 $(MAKE) AR=i686-w64-mingw32-ar CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++ win32
337 $(MAKE) AR=x86_64-w64-mingw32-ar CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ win64
339 # ---------------------------------------------------------------------------------------------------------------------
340 # Binaries (wine)
342 wine32:
343 $(MAKE) -C source/jackbridge wine32
344 cp -f $(MODULEDIR)/jackbridge-wine32.dll$(LIB_EXT) $(CURDIR)/bin/jackbridge-wine32.dll
346 wine64:
347 $(MAKE) -C source/jackbridge wine64
348 cp -f $(MODULEDIR)/jackbridge-wine64.dll$(LIB_EXT) $(CURDIR)/bin/jackbridge-wine64.dll
350 # ---------------------------------------------------------------------------------------------------------------------
352 clean:
353 $(MAKE) clean -C source/backend
354 $(MAKE) clean -C source/bridges-plugin
355 $(MAKE) clean -C source/bridges-ui
356 $(MAKE) clean -C source/jackbridge
357 $(MAKE) clean -C source/modules
358 $(MAKE) clean -C source/native-plugins
359 $(MAKE) clean -C source/plugin
360 ifneq ($(STATIC_PLUGIN_TARGET),true)
361 $(MAKE) clean -C source/discovery
362 $(MAKE) clean -C source/frontend
363 $(MAKE) clean -C source/interposer
364 $(MAKE) clean -C source/libjack
365 $(MAKE) clean -C source/tests
366 $(MAKE) clean -C source/theme
367 endif
368 rm -f *~ source/*~
370 distclean: clean
371 rm -f bin/*.exe bin/*.dll bin/*.dylib bin/*.so
372 rm -rf build build-lv2
374 cpp:
375 $(MAKE) CPPMODE=true
377 debug:
378 $(MAKE) DEBUG=true
380 doxygen:
381 $(MAKE) doxygen -C source/backend
383 tests:
384 $(MAKE) -C source/tests
386 stoat:
387 stoat --recursive ./build/ --suppression ./data/stoat-supression.txt --whitelist ./data/stoat-whitelist.txt --graph-view ./data/stoat-callgraph.png
389 # stoat --recursive ./build/ \
390 # --suppression ./data/stoat-supression.txt \
391 # --whitelist ./data/stoat-whitelist.txt \
392 # --graph-view ./data/stoat-callgraph.png
394 # ---------------------------------------------------------------------------------------------------------------------
396 install_main:
397 # Create directories
398 install -d $(DESTDIR)$(BINDIR)
399 install -d $(DESTDIR)$(DATADIR)/carla/resources
400 ifeq ($(LINUX),true)
401 install -d $(DESTDIR)$(LIBDIR)/carla/jack
402 else
403 install -d $(DESTDIR)$(LIBDIR)/carla
404 endif
405 install -d $(DESTDIR)$(LIBDIR)/pkgconfig
406 install -d $(DESTDIR)$(INCLUDEDIR)/carla/includes
407 install -d $(DESTDIR)$(INCLUDEDIR)/carla/utils
408 ifeq ($(LINUX),true)
409 ifeq ($(HAVE_JACK),true)
410 ifeq ($(JACKBRIDGE_DIRECT),true)
411 install -d $(DESTDIR)$(JACK_LIBDIR)
412 endif
413 endif
414 endif
416 ifeq ($(HAVE_FRONTEND),true)
417 # Create directories (frontend)
418 install -d $(DESTDIR)$(LIBDIR)/carla/styles
419 install -d $(DESTDIR)$(PREFIX)/share/appdata
420 install -d $(DESTDIR)$(DATADIR)/applications
421 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
422 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
423 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
424 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
425 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
426 install -d $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
427 install -d $(DESTDIR)$(DATADIR)/mime/packages
428 install -d $(DESTDIR)$(DATADIR)/carla/resources/translations
429 install -d $(DESTDIR)$(DATADIR)/carla/common
430 install -d $(DESTDIR)$(DATADIR)/carla/dialogs
431 install -d $(DESTDIR)$(DATADIR)/carla/modgui
432 install -d $(DESTDIR)$(DATADIR)/carla/patchcanvas
433 install -d $(DESTDIR)$(DATADIR)/carla/utils
434 install -d $(DESTDIR)$(DATADIR)/carla/widgets
435 endif
437 # -------------------------------------------------------------------------------------------------------------
439 # Install script files (non-gui)
440 install -m 755 \
441 data/carla-single \
442 $(DESTDIR)$(BINDIR)
444 # Adjust PREFIX value in script files (non-gui)
445 sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
446 $(DESTDIR)$(BINDIR)/carla-single
448 # Install backend libs
449 install -m 644 \
450 bin/libcarla_*.* \
451 $(DESTDIR)$(LIBDIR)/carla
453 # Install other binaries
454 install -m 755 \
455 bin/*bridge-* \
456 bin/carla-discovery-* \
457 $(DESTDIR)$(LIBDIR)/carla
459 ifeq ($(LINUX),true)
460 ifeq ($(HAVE_JACK),true)
461 ifeq ($(JACKBRIDGE_DIRECT),true)
462 # Install internal jack client
463 ln -sf \
464 $(LIBDIR)/carla/libcarla_standalone2.so \
465 $(DESTDIR)$(JACK_LIBDIR)/carla.so
466 endif
467 endif
469 ifneq ($(JACKBRIDGE_DIRECT),true)
470 # Install custom libjack
471 install -m 755 \
472 bin/jack/libjack.so.0 \
473 $(DESTDIR)$(LIBDIR)/carla/jack
474 endif
475 endif
477 # Install pkg-config files
478 install -m 644 \
479 data/pkgconfig/*.pc \
480 $(DESTDIR)$(LIBDIR)/pkgconfig
482 # Adjust PREFIX, LIBDIR, INCLUDEDIR and VERSION in pkg-config files
483 sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
484 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
485 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
486 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
487 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
489 sed $(SED_ARGS) 's?X-LIBDIR-X?$(LIBDIR)?' \
490 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
491 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
492 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
493 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
495 sed $(SED_ARGS) 's?X-INCLUDEDIR-X?$(INCLUDEDIR)?' \
496 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
497 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
498 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
499 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
501 sed $(SED_ARGS) 's?X-VERSION-X?$(VERSION)?' \
502 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc \
503 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc \
504 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc \
505 $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
507 # Install headers
508 install -m 644 \
509 source/backend/CarlaBackend.h \
510 source/backend/CarlaHost.h \
511 source/backend/CarlaUtils.h \
512 source/backend/CarlaEngine.hpp \
513 source/backend/CarlaPlugin.hpp \
514 source/backend/CarlaPluginPtr.hpp \
515 $(DESTDIR)$(INCLUDEDIR)/carla
517 install -m 644 \
518 source/includes/CarlaDefines.h \
519 source/includes/CarlaMIDI.h \
520 source/includes/CarlaNative.h \
521 source/includes/CarlaNativePlugin.h \
522 $(DESTDIR)$(INCLUDEDIR)/carla/includes
524 install -m 644 \
525 source/utils/CarlaBackendUtils.hpp \
526 source/utils/CarlaBase64Utils.hpp \
527 source/utils/CarlaBinaryUtils.hpp \
528 source/utils/CarlaBridgeDefines.hpp \
529 source/utils/CarlaBridgeUtils.hpp \
530 source/utils/CarlaMacUtils.hpp \
531 source/utils/CarlaMathUtils.hpp \
532 source/utils/CarlaMemUtils.hpp \
533 source/utils/CarlaMutex.hpp \
534 source/utils/CarlaRingBuffer.hpp \
535 source/utils/CarlaProcessUtils.hpp \
536 source/utils/CarlaRunner.hpp \
537 source/utils/CarlaScopeUtils.hpp \
538 source/utils/CarlaSemUtils.hpp \
539 source/utils/CarlaSha1Utils.hpp \
540 source/utils/CarlaShmUtils.hpp \
541 source/utils/CarlaString.hpp \
542 source/utils/CarlaThread.hpp \
543 source/utils/CarlaTimeUtils.hpp \
544 source/utils/CarlaUtils.hpp \
545 $(DESTDIR)$(INCLUDEDIR)/carla/utils
547 # -------------------------------------------------------------------------------------------------------------
549 ifeq ($(HAVE_FRONTEND),true)
550 ifneq ($(CPPMODE),true)
551 # Install script files (gui)
552 install -m 755 \
553 data/carla \
554 data/carla-database \
555 data/carla-jack-multi \
556 data/carla-jack-single \
557 data/carla-jack-patchbayplugin \
558 data/carla-osc-gui \
559 data/carla-patchbay \
560 data/carla-rack \
561 data/carla-settings \
562 $(DESTDIR)$(BINDIR)
564 # Adjust PREFIX value in script files (gui)
565 sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
566 $(DESTDIR)$(BINDIR)/carla \
567 $(DESTDIR)$(BINDIR)/carla-database \
568 $(DESTDIR)$(BINDIR)/carla-jack-multi \
569 $(DESTDIR)$(BINDIR)/carla-jack-single \
570 $(DESTDIR)$(BINDIR)/carla-jack-patchbayplugin \
571 $(DESTDIR)$(BINDIR)/carla-osc-gui \
572 $(DESTDIR)$(BINDIR)/carla-patchbay \
573 $(DESTDIR)$(BINDIR)/carla-rack \
574 $(DESTDIR)$(BINDIR)/carla-settings
576 ifeq ($(HAVE_LIBLO),true)
577 install -m 755 \
578 data/carla-control \
579 $(DESTDIR)$(BINDIR)
581 sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
582 $(DESTDIR)$(BINDIR)/carla-control
583 endif
585 # Install the real modgui bridge
586 install -m 755 \
587 data/carla-bridge-lv2-modgui \
588 $(DESTDIR)$(LIBDIR)/carla
590 sed $(SED_ARGS) 's?X-PREFIX-X?$(PREFIX)?' \
591 $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
593 # Install frontend
594 install -m 644 \
595 source/frontend/carla \
596 source/frontend/carla-control \
597 source/frontend/carla-jack-multi \
598 source/frontend/carla-jack-single \
599 source/frontend/carla-patchbay \
600 source/frontend/carla-rack \
601 source/frontend/*.py \
602 $(DESTDIR)$(DATADIR)/carla/
604 install -m 644 \
605 source/frontend/common/*.py \
606 $(DESTDIR)$(DATADIR)/carla/common/
608 install -m 644 \
609 source/frontend/dialogs/*.py \
610 $(DESTDIR)$(DATADIR)/carla/dialogs/
612 install -m 644 \
613 source/frontend/modgui/*.py \
614 $(DESTDIR)$(DATADIR)/carla/modgui/
616 install -m 644 \
617 source/frontend/patchcanvas/*.py \
618 $(DESTDIR)$(DATADIR)/carla/patchcanvas/
620 install -m 644 \
621 source/frontend/utils/*.py \
622 $(DESTDIR)$(DATADIR)/carla/utils/
624 install -m 644 \
625 source/frontend/widgets/*.py \
626 $(DESTDIR)$(DATADIR)/carla/widgets/
628 # Adjust LIBDIR and DATADIR value in python code
629 sed $(SED_ARGS) 's?X_LIBDIR_X = None?X_LIBDIR_X = "$(LIBDIR)"?' \
630 $(DESTDIR)$(DATADIR)/carla/carla_shared.py
632 sed $(SED_ARGS) 's?X_DATADIR_X = None?X_DATADIR_X = "$(DATADIR)"?' \
633 $(DESTDIR)$(DATADIR)/carla/carla_shared.py
635 # Install resources (gui)
636 install -m 755 \
637 bin/resources/carla-plugin \
638 bin/resources/carla-plugin-patchbay \
639 bin/resources/*-ui \
640 $(DESTDIR)$(DATADIR)/carla/resources
641 endif # CPPMODE
643 ifeq ($(HAVE_THEME),true)
644 # Install theme
645 install -m 644 \
646 bin/styles/* \
647 $(DESTDIR)$(LIBDIR)/carla/styles
648 endif
650 # Install desktop files
651 install -m 644 data/desktop/carla.desktop $(DESTDIR)$(DATADIR)/applications
652 install -m 644 data/desktop/carla-rack.desktop $(DESTDIR)$(DATADIR)/applications
653 install -m 644 data/desktop/carla-patchbay.desktop $(DESTDIR)$(DATADIR)/applications
654 install -m 644 data/desktop/carla-jack-single.desktop $(DESTDIR)$(DATADIR)/applications
655 install -m 644 data/desktop/carla-jack-multi.desktop $(DESTDIR)$(DATADIR)/applications
656 ifeq ($(HAVE_LIBLO),true)
657 install -m 644 data/desktop/carla-control.desktop $(DESTDIR)$(DATADIR)/applications
658 endif
660 # Install app data
661 sed -e 's?X-VERSION-X?$(VERSION)?' \
662 data/appdata.xml.in > $(DESTDIR)$(PREFIX)/share/appdata/studio.kx.carla.appdata.xml
664 # Install mime package
665 install -m 644 data/carla.xml $(DESTDIR)$(DATADIR)/mime/packages
667 # Install icons, 16x16
668 install -m 644 resources/16x16/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
669 install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/16x16/apps
671 # Install icons, 32x32
672 install -m 644 resources/32x32/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
673 install -m 644 resources/32x32/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/32x32/apps
675 # Install icons, 48x48
676 install -m 644 resources/48x48/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
677 install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps
679 # Install icons, 128x128
680 install -m 644 resources/128x128/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
681 install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/128x128/apps
683 # Install icons, 256x256
684 install -m 644 resources/256x256/carla.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
685 install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(DATADIR)/icons/hicolor/256x256/apps
687 # Install icons, scalable
688 install -m 644 resources/scalable/carla.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
689 install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps
691 # Install resources (re-use python files)
692 $(LINK) ../common $(DESTDIR)$(DATADIR)/carla/resources
693 $(LINK) ../dialogs $(DESTDIR)$(DATADIR)/carla/resources
694 $(LINK) ../modgui $(DESTDIR)$(DATADIR)/carla/resources
695 $(LINK) ../patchcanvas $(DESTDIR)$(DATADIR)/carla/resources
696 $(LINK) ../utils $(DESTDIR)$(DATADIR)/carla/resources
697 $(LINK) ../widgets $(DESTDIR)$(DATADIR)/carla/resources
698 $(LINK) ../carla_app.py $(DESTDIR)$(DATADIR)/carla/resources
699 $(LINK) ../carla_backend.py $(DESTDIR)$(DATADIR)/carla/resources
700 $(LINK) ../carla_backend_qt.py $(DESTDIR)$(DATADIR)/carla/resources
701 $(LINK) ../carla_frontend.py $(DESTDIR)$(DATADIR)/carla/resources
702 $(LINK) ../carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
703 $(LINK) ../carla_host_control.py $(DESTDIR)$(DATADIR)/carla/resources
704 $(LINK) ../carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
705 $(LINK) ../carla_skin.py $(DESTDIR)$(DATADIR)/carla/resources
706 $(LINK) ../carla_shared.py $(DESTDIR)$(DATADIR)/carla/resources
707 $(LINK) ../carla_utils.py $(DESTDIR)$(DATADIR)/carla/resources
708 $(LINK) ../carla_widgets.py $(DESTDIR)$(DATADIR)/carla/resources
709 $(LINK) ../externalui.py $(DESTDIR)$(DATADIR)/carla/resources
710 $(LINK) ../qt_compat.py $(DESTDIR)$(DATADIR)/carla/resources
711 $(LINK) ../qt_config.py $(DESTDIR)$(DATADIR)/carla/resources
712 $(LINK) ../resources_rc.py $(DESTDIR)$(DATADIR)/carla/resources
713 $(LINK) ../ui_carla_about.py $(DESTDIR)$(DATADIR)/carla/resources
714 $(LINK) ../ui_carla_edit.py $(DESTDIR)$(DATADIR)/carla/resources
715 $(LINK) ../ui_carla_host.py $(DESTDIR)$(DATADIR)/carla/resources
716 $(LINK) ../ui_carla_parameter.py $(DESTDIR)$(DATADIR)/carla/resources
717 $(LINK) ../ui_carla_plugin_calf.py $(DESTDIR)$(DATADIR)/carla/resources
718 $(LINK) ../ui_carla_plugin_classic.py $(DESTDIR)$(DATADIR)/carla/resources
719 $(LINK) ../ui_carla_plugin_compact.py $(DESTDIR)$(DATADIR)/carla/resources
720 $(LINK) ../ui_carla_plugin_default.py $(DESTDIR)$(DATADIR)/carla/resources
721 $(LINK) ../ui_carla_plugin_presets.py $(DESTDIR)$(DATADIR)/carla/resources
722 $(LINK) ../ui_carla_settings.py $(DESTDIR)$(DATADIR)/carla/resources
723 $(LINK) ../ui_carla_settings_driver.py $(DESTDIR)$(DATADIR)/carla/resources
724 $(LINK) ../ui_inputdialog_value.py $(DESTDIR)$(DATADIR)/carla/resources
725 $(LINK) ../ui_midipattern.py $(DESTDIR)$(DATADIR)/carla/resources
726 $(LINK) ../ui_xycontroller.py $(DESTDIR)$(DATADIR)/carla/resources
728 # Install translations
729 $(foreach l,$(I18N_LANGUAGES),install -m 644 \
730 source/frontend/translations/carla_$(l).qm \
731 $(DESTDIR)$(DATADIR)/carla/resources/translations/;)
733 # Link resources for internal plugin
734 rm -rf $(DESTDIR)$(LIBDIR)/carla/resources
735 $(LINK) ../../share/carla/resources $(DESTDIR)$(LIBDIR)/carla/resources
736 endif # HAVE_FRONTEND
738 # -------------------------------------------------------------------------------------------------------------
740 ifeq ($(CAN_GENERATE_LV2_TTL),true)
741 # Install lv2 plugin
742 install -d $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
744 install -m 644 \
745 bin/carla.lv2/carla.* \
746 bin/carla.lv2/*.ttl \
747 $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
749 # Link binaries for lv2 plugin
750 @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
751 $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/$$i; \
752 done
753 rm -f $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/libcarla_standalone2.*
755 ifeq ($(LINUX),true)
756 # Link jack app bridge
757 rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
758 $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/jack
759 endif
760 endif # CAN_GENERATE_LV2_TTL
762 ifeq ($(HAVE_FRONTEND),true)
763 # Link resources for lv2 plugin
764 rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
765 $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/resources
767 # Link styles for lv2 plugin
768 rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
769 $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/styles
770 endif
772 # -------------------------------------------------------------------------------------------------------------
774 ifneq ($(HAIKU),true)
775 ifeq ($(HAVE_FRONTEND),true)
776 # Install vst plugin
777 install -d $(DESTDIR)$(LIBDIR)/vst/carla.vst
779 install -m 644 \
780 bin/CarlaRack*.* \
781 bin/CarlaPatchbay*.* \
782 $(DESTDIR)$(LIBDIR)/vst/carla.vst
784 # Link binaries for vst plugin
785 @for i in `find $(DESTDIR)$(LIBDIR)/carla/ -maxdepth 1 -type f -exec basename {} ';'`; do \
786 $(LINK) ../../carla/$$i $(DESTDIR)$(LIBDIR)/vst/carla.vst/$$i; \
787 done
788 rm -f $(DESTDIR)$(LIBDIR)/vst/carla.vst/libcarla_standalone2.*
790 # Link jack app bridge
791 rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
792 $(LINK) ../../carla/jack $(DESTDIR)$(LIBDIR)/vst/carla.vst/jack
794 # Link resources for vst plugin
795 rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
796 $(LINK) ../../../share/carla/resources $(DESTDIR)$(LIBDIR)/vst/carla.vst/resources
798 # Link styles for vst plugin
799 rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
800 $(LINK) ../../carla/styles $(DESTDIR)$(LIBDIR)/vst/carla.vst/styles
801 endif
802 endif
804 # -------------------------------------------------------------------------------------------------------------
806 ifneq ($(HAVE_FRONTEND),true)
807 # Remove gui files for non-gui build
808 rm $(DESTDIR)$(LIBDIR)/carla/carla-bridge-lv2-modgui
809 ifeq ($(CAN_GENERATE_LV2_TTL),true)
810 rm $(DESTDIR)$(LIBDIR)/lv2/carla.lv2/carla-bridge-lv2-modgui
811 endif
812 endif
814 # ---------------------------------------------------------------------------------------------------------------------
816 ifneq ($(EXTERNAL_PLUGINS),true)
817 install_external_plugins:
818 endif
820 install: install_main install_external_plugins
822 # ---------------------------------------------------------------------------------------------------------------------
824 uninstall:
825 rm -f $(DESTDIR)$(BINDIR)/carla*
826 rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-host-plugin.pc
827 rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-native-plugin.pc
828 rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-standalone.pc
829 rm -f $(DESTDIR)$(LIBDIR)/pkgconfig/carla-utils.pc
830 rm -f $(DESTDIR)$(DATADIR)/applications/carla.desktop
831 rm -f $(DESTDIR)$(DATADIR)/applications/carla-control.desktop
832 rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla.png
833 rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/*/apps/carla-control.png
834 rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla.svg
835 rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/carla-control.svg
836 rm -f $(DESTDIR)$(DATADIR)/mime/packages/carla.xml
837 rm -rf $(DESTDIR)$(LIBDIR)/carla
838 rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla.lv2
839 rm -rf $(DESTDIR)$(LIBDIR)/lv2/carla-native.lv2
840 rm -rf $(DESTDIR)$(LIBDIR)/vst/carla.vst
841 rm -rf $(DESTDIR)$(DATADIR)/carla
842 rm -rf $(DESTDIR)$(INCLUDEDIR)/carla
844 # ----------------------------------------------------------------------------------------------------------------------------
846 ifeq ($(MACOS),true)
847 ifneq ($(MACOS_OLD),true)
848 HAVE_DIST = true
849 endif
850 endif
852 ifeq ($(WINDOWS),true)
853 HAVE_DIST = true
854 endif
856 ifeq ($(HAVE_DIST),true)
857 include Makefile.dist.mk
858 else
859 dist:
860 endif
862 include Makefile.print.mk
864 # ---------------------------------------------------------------------------------------------------------------------
866 .FORCE:
867 .PHONY: .FORCE
869 # ---------------------------------------------------------------------------------------------------------------------