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.

208 lines
5.9KB

  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_WINDOWS),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. ifeq ($(USING_CUSTOM_DPF),true)
  59. DPF_FLAGS = -I$(CUSTOM_DPF_PATH)/distrho
  60. else
  61. DPF_FLAGS = -I$(CWDE)/modules/distrho
  62. endif
  63. ifeq ($(HAVE_DGL),true)
  64. ifeq ($(USING_CUSTOM_DPF),true)
  65. DPF_FLAGS += -I$(CUSTOM_DPF_PATH)/dgl
  66. else
  67. DPF_FLAGS += -I$(CWDE)/modules/dgl
  68. endif
  69. DPF_FLAGS += $(DGL_FLAGS)
  70. endif
  71. # ---------------------------------------------------------------------------------------------------------------------
  72. # Flags for ZynAddSubFX (DSP and UI separated)
  73. ifeq ($(HAVE_ZYN_DEPS),true)
  74. # Common flags
  75. ZYN_BASE_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags liblo mxml)
  76. ZYN_BASE_FLAGS += -Iexternal/zynaddsubfx -Iexternal/zynaddsubfx/rtosc
  77. ifneq ($(WINDOWS),true)
  78. ZYN_BASE_FLAGS += -DHAVE_ASYNC
  79. endif
  80. ZYN_BASE_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs liblo mxml) -pthread
  81. ZYN_BASE_LIBS += $(LIBDL_LIBS)
  82. # DSP flags
  83. ZYN_DSP_FLAGS = $(ZYN_BASE_FLAGS)
  84. ZYN_DSP_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags fftw3 zlib)
  85. ZYN_DSP_LIBS = $(ZYN_BASE_LIBS)
  86. ZYN_DSP_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs fftw3 zlib)
  87. ifeq ($(SKIP_ZYN_SYNTH),true)
  88. BASE_FLAGS += -DSKIP_ZYN_SYNTH
  89. else
  90. # UI flags
  91. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  92. # Common UI flags
  93. ZYN_UI_FLAGS = $(ZYN_BASE_FLAGS)
  94. ZYN_UI_LIBS = $(ZYN_BASE_LIBS)
  95. # NTK or FLTK UI flags
  96. ifeq ($(HAVE_NTK),true)
  97. FLUID = ntk-fluid
  98. ZYN_UI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags ntk_images ntk) -DNTK_GUI
  99. ZYN_UI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs ntk_images ntk)
  100. else # HAVE_NTK
  101. FLUID = fluid
  102. ZYN_UI_FLAGS += $(shell fltk-config --use-images --cxxflags) -DFLTK_GUI
  103. ZYN_UI_LIBS += $(shell fltk-config --use-images --ldflags)
  104. endif # HAVE_NTK
  105. # UI extra flags
  106. ifeq ($(HAVE_X11),true)
  107. ZYN_UI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags x11)
  108. ZYN_UI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  109. endif
  110. ifeq ($(LINUX),true)
  111. ZYN_UI_LIBS += -lrt
  112. endif
  113. else # HAVE_ZYN_UI_DEPS
  114. ZYN_DSP_FLAGS += -DNO_UI
  115. endif # SKIP_ZYN_SYNTH
  116. endif # HAVE_ZYN_UI_DEPS
  117. endif # HAVE_ZYN_DEPS
  118. # ---------------------------------------------------------------------------------------------------------------------
  119. NATIVE_PLUGINS_LIBS += $(PROJECTM_LIBS)
  120. NATIVE_PLUGINS_LIBS += $(ZYN_DSP_LIBS)
  121. NATIVE_PLUGINS_LIBS += $(ZITA_DSP_LIBS)
  122. # ---------------------------------------------------------------------------------------------------------------------
  123. all:
  124. install_external_plugins:
  125. ifeq ($(HAVE_ZYN_DEPS),true)
  126. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  127. # Create directories (zynaddsubfx)
  128. install -d $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  129. # Install resources (zynaddsubfx)
  130. install -m 644 \
  131. bin/resources/zynaddsubfx/*.png \
  132. $(DESTDIR)$(DATADIR)/carla/resources/zynaddsubfx
  133. install -m 755 \
  134. bin/resources/zynaddsubfx-ui \
  135. $(DESTDIR)$(DATADIR)/carla/resources
  136. endif
  137. endif
  138. features_print_external_plugins:
  139. @printf -- "\n"
  140. @printf -- "$(tS)---> External plugins: $(tE)\n"
  141. ifeq ($(HAVE_DGL),true)
  142. @printf -- "DPF Plugins: $(ANS_YES) (with UI)\n"
  143. ifeq ($(HAVE_PROJECTM),true)
  144. @printf -- "DPF ProM: $(ANS_YES)\n"
  145. else
  146. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing libprojectM$(mE)\n"
  147. endif
  148. else
  149. @printf -- "DPF Plugins: $(ANS_YES) (without UI)\n"
  150. ifeq ($(HAVE_PROJECTM),true)
  151. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL$(mE)\n"
  152. else
  153. @printf -- "DPF ProM: $(ANS_NO) $(mS)missing OpenGL and libprojectM$(mE)\n"
  154. endif
  155. endif
  156. ifeq ($(HAVE_ZYN_DEPS),true)
  157. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  158. ifeq ($(HAVE_NTK),true)
  159. @printf -- "ZynAddSubFX: $(ANS_YES) (with NTK UI)\n"
  160. else
  161. @printf -- "ZynAddSubFX: $(ANS_YES) (with FLTK UI)\n"
  162. endif
  163. else
  164. @printf -- "ZynAddSubFX: $(ANS_YES) (without UI) $(mS)FLTK or NTK missing$(mE)\n"
  165. endif
  166. else
  167. @printf -- "ZynAddSubFX: $(ANS_NO) $(mS)liblo, fftw3, mxml or zlib missing$(mE)\n"
  168. endif
  169. # ---------------------------------------------------------------------------------------------------------------------