External plugins for Carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

200 lines
5.8KB

  1. #!/usr/bin/make -f
  2. # Makefile for native-plugins #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. ifeq ($(TESTBUILD),true)
  7. ifeq ($(LINUX),true)
  8. CXXFLAGS += -isystem /opt/kxstudio/include/ntk
  9. endif
  10. endif
  11. ifeq ($(MACOS_OR_WIN32),true)
  12. SKIP_ZYN_SYNTH = true
  13. endif
  14. # HAVE_NTK = $(shell pkg-config --exists ntk ntk_images && echo true)
  15. # HAVE_PROJECTM = $(shell pkg-config --exists libprojectM && echo true)
  16. # ifneq ($(MACOS_OLD),true)
  17. # HAVE_ZYN_DEPS = $(shell pkg-config --exists liblo fftw3 mxml zlib && echo true)
  18. # endif
  19. # ---------------------------------------------------------------------------------------------------------------------
  20. # Check for optional libs (special non-pkgconfig unix tests)
  21. ifeq ($(UNIX),true)
  22. # fltk doesn't have a pkg-config file but has fltk-config instead.
  23. # Also, don't try looking for it if we already have NTK.
  24. ifneq ($(HAVE_NTK),true)
  25. ifeq ($(shell which fltk-config 1>/dev/null 2>/dev/null && echo true),true)
  26. ifeq ($(shell which fluid 1>/dev/null 2>/dev/null && echo true),true)
  27. HAVE_FLTK = true
  28. endif
  29. endif
  30. endif
  31. endif
  32. # ---------------------------------------------------------------------------------------------------------------------
  33. ifeq ($(HAVE_FLTK),true)
  34. HAVE_ZYN_UI_DEPS = true
  35. endif
  36. ifeq ($(HAVE_NTK),true)
  37. HAVE_ZYN_UI_DEPS = true
  38. endif
  39. # ---------------------------------------------------------------------------------------------------------------------
  40. ifeq ($(HAVE_PROJECTM),true)
  41. BASE_FLAGS += -DHAVE_PROJECTM
  42. endif
  43. ifeq ($(HAVE_ZYN_DEPS),true)
  44. ifneq ($(DEBUG),true)
  45. BASE_FLAGS += -DHAVE_ZYN_DEPS
  46. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  47. BASE_FLAGS += -DHAVE_ZYN_UI_DEPS
  48. endif
  49. endif
  50. endif
  51. # ---------------------------------------------------------------------------------------------------------------------
  52. ifeq ($(HAVE_PROJECTM),true)
  53. PROJECTM_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags libprojectM)
  54. PROJECTM_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libprojectM)
  55. endif
  56. # ---------------------------------------------------------------------------------------------------------------------
  57. # Flags for DPF Plugins
  58. DPF_FLAGS = -I$(CWDE)/modules/distrho
  59. ifeq ($(HAVE_DGL),true)
  60. DPF_FLAGS += -I$(CWDE)/modules/dgl
  61. DPF_FLAGS += $(DGL_FLAGS)
  62. endif
  63. # ---------------------------------------------------------------------------------------------------------------------
  64. # Flags for ZynAddSubFX (DSP and UI separated)
  65. ifeq ($(HAVE_ZYN_DEPS),true)
  66. # Common flags
  67. ZYN_BASE_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags liblo mxml)
  68. ZYN_BASE_FLAGS += -Iexternal/zynaddsubfx -Iexternal/zynaddsubfx/rtosc
  69. ifneq ($(WIN32),true)
  70. ZYN_BASE_FLAGS += -DHAVE_ASYNC
  71. endif
  72. ZYN_BASE_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs liblo mxml) -pthread
  73. ZYN_BASE_LIBS += $(LIBDL_LIBS)
  74. # DSP flags
  75. ZYN_DSP_FLAGS = $(ZYN_BASE_FLAGS)
  76. ZYN_DSP_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags fftw3 zlib)
  77. ZYN_DSP_LIBS = $(ZYN_BASE_LIBS)
  78. ZYN_DSP_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs fftw3 zlib)
  79. ifeq ($(SKIP_ZYN_SYNTH),true)
  80. BASE_FLAGS += -DSKIP_ZYN_SYNTH
  81. else
  82. # UI flags
  83. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  84. # Common UI flags
  85. ZYN_UI_FLAGS = $(ZYN_BASE_FLAGS)
  86. ZYN_UI_LIBS = $(ZYN_BASE_LIBS)
  87. # NTK or FLTK UI flags
  88. ifeq ($(HAVE_NTK),true)
  89. FLUID = ntk-fluid
  90. ZYN_UI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags ntk_images ntk) -DNTK_GUI
  91. ZYN_UI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs ntk_images ntk)
  92. else # HAVE_NTK
  93. FLUID = fluid
  94. ZYN_UI_FLAGS += $(shell fltk-config --use-images --cxxflags) -DFLTK_GUI
  95. ZYN_UI_LIBS += $(shell fltk-config --use-images --ldflags)
  96. endif # HAVE_NTK
  97. # UI extra flags
  98. ifeq ($(HAVE_X11),true)
  99. ZYN_UI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags x11)
  100. ZYN_UI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  101. endif
  102. ifeq ($(LINUX),true)
  103. ZYN_UI_LIBS += -lrt
  104. endif
  105. else # HAVE_ZYN_UI_DEPS
  106. ZYN_DSP_FLAGS += -DNO_UI
  107. endif # SKIP_ZYN_SYNTH
  108. endif # HAVE_ZYN_UI_DEPS
  109. endif # HAVE_ZYN_DEPS
  110. # ---------------------------------------------------------------------------------------------------------------------
  111. NATIVE_PLUGINS_LIBS += $(PROJECTM_LIBS)
  112. NATIVE_PLUGINS_LIBS += $(ZYN_DSP_LIBS)
  113. NATIVE_PLUGINS_LIBS += $(ZITA_DSP_LIBS)
  114. # ---------------------------------------------------------------------------------------------------------------------
  115. all:
  116. install_external_plugins:
  117. ifeq ($(HAVE_ZYN_DEPS),true)
  118. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  119. # Create directories (zynaddsubfx)
  120. install -d $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  121. # Install resources (zynaddsubfx)
  122. install -m 644 \
  123. bin/resources/zynaddsubfx/*.png \
  124. $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  125. install -m 755 \
  126. bin/resources/zynaddsubfx-ui \
  127. $(DESTDIR)$(DATADIR)/carla/resources
  128. endif
  129. endif
  130. features_print_external_plugins:
  131. @printf -- "\n"
  132. @printf -- "$(tS)---> External plugins: $(tE)\n"
  133. ifeq ($(HAVE_DGL),true)
  134. @printf -- "DPF Plugins: $(ANS_YES) (with UI)\n"
  135. ifeq ($(HAVE_PROJECTM),true)
  136. @printf -- "DPF ProM: $(ANS_YES)\n"
  137. else
  138. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing libprojectM$(mE)\n"
  139. endif
  140. else
  141. @printf -- "DPF Plugins: $(ANS_YES) (without UI)\n"
  142. ifeq ($(HAVE_PROJECTM),true)
  143. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL$(mE)\n"
  144. else
  145. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL and libprojectM$(mE)\n"
  146. endif
  147. endif
  148. ifeq ($(HAVE_ZYN_DEPS),true)
  149. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  150. ifeq ($(HAVE_NTK),true)
  151. @printf -- "ZynAddSubFX: $(ANS_YES) (with NTK UI)\n"
  152. else
  153. @printf -- "ZynAddSubFX: $(ANS_YES) (with FLTK UI)\n"
  154. endif
  155. else
  156. @printf -- "ZynAddSubFX: $(ANS_YES) (without UI) $(mS)FLTK or NTK missing$(mE)\n"
  157. endif
  158. else
  159. @printf -- "ZynAddSubFX: $(ANS_NO) $(mS)liblo, fftw3, mxml or zlib missing$(mE)\n"
  160. endif
  161. # ---------------------------------------------------------------------------------------------------------------------