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.

236 lines
6.5KB

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