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.

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