Audio plugin host https://kx.studio/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.

364 lines
12KB

  1. #!/usr/bin/make -f
  2. # Makefile for native-plugins #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. MODULENAME=native-plugins
  8. include ../modules/Makefile.mk
  9. # ----------------------------------------------------------------------------------------------------------------------------
  10. BUILD_C_FLAGS += -I..
  11. BUILD_CXX_FLAGS += -I.. -isystem $(CWD)/modules -I$(CWD)/modules/distrho
  12. # ----------------------------------------------------------------------------------------------------------------------------
  13. # Flags for Zita UIs
  14. ifeq ($(EXPERIMENTAL_PLUGINS),true)
  15. ZITA_DSP_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Wno-unused-parameter
  16. ZITA_DSP_CXX_FLAGS += $(shell pkg-config --cflags fftw3f)
  17. ZITA_UI_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Wno-ignored-qualifiers -Wno-unused-parameter -Wno-unused-result
  18. ZITA_UI_CXX_FLAGS += $(shell pkg-config --cflags cairo libpng12 freetype2 x11 xft zlib)
  19. ZITA_UI_LINK_FLAGS = $(LINK_FLAGS) -lclxclient -lclthreads
  20. ZITA_UI_LINK_FLAGS += $(shell pkg-config --libs cairo libpng12 freetype2 x11 xft zlib)
  21. ZITA_UI_LINK_FLAGS += -ldl -lpthread -lrt
  22. endif # EXPERIMENTAL_PLUGINS
  23. # ----------------------------------------------------------------------------------------------------------------------------
  24. # Flags for ZynAddSubFX
  25. ifeq ($(HAVE_ZYN_DEPS),true)
  26. ZYN_CXX_FLAGS = $(BUILD_CXX_FLAGS) -Izynaddsubfx -Izynaddsubfx/rtosc
  27. ZYN_CXX_FLAGS += $(shell pkg-config --cflags fftw3 mxml zlib)
  28. ZYN_LD_FLAGS = $(LINK_FLAGS)
  29. ZYN_LD_FLAGS += $(shell pkg-config --libs liblo)
  30. ZYN_LD_FLAGS += -ldl -lpthread
  31. ifneq ($(WIN32),true)
  32. ZYN_CXX_FLAGS += -DHAVE_ASYNC
  33. endif
  34. ifeq ($(HAVE_X11),true)
  35. ZYN_CXX_FLAGS += $(shell pkg-config --cflags x11)
  36. ZYN_LD_FLAGS += $(shell pkg-config --libs x11)
  37. endif
  38. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  39. ifeq ($(HAVE_NTK),true)
  40. FLUID = ntk-fluid
  41. ZYN_CXX_FLAGS += -DNTK_GUI
  42. ZYN_CXX_FLAGS += $(shell pkg-config --cflags ntk_images ntk)
  43. ZYN_LD_FLAGS += $(shell pkg-config --libs ntk_images ntk)
  44. else # HAVE_NTK
  45. FLUID = fluid
  46. ZYN_CXX_FLAGS += -DFLTK_GUI
  47. ZYN_CXX_FLAGS += $(shell fltk-config --use-images --cxxflags)
  48. ZYN_LD_FLAGS += $(shell fltk-config --use-images --ldflags)
  49. endif # HAVE_NTK
  50. ifeq ($(LINUX),true)
  51. ZYN_LD_FLAGS += -lrt
  52. else
  53. ZYN_LD_FLAGS += $(MODULEDIR)/juce_core.a
  54. endif
  55. else # HAVE_ZYN_UI_DEPS
  56. ZYN_CXX_FLAGS += -DNO_UI
  57. endif # HAVE_ZYN_UI_DEPS
  58. endif # HAVE_ZYN_DEPS
  59. # ----------------------------------------------------------------------------------------------------------------------------
  60. # Set targets
  61. TARGETS = $(MODULEDIR)/$(MODULENAME).a
  62. # ----------------------------------------------------------------------------------------------------------------------------
  63. # Set objects
  64. OBJS = \
  65. $(OBJDIR)/_all.c.o \
  66. $(OBJDIR)/_data.cpp.o
  67. # ----------------------------------------------------------------------------------------------------------------------------
  68. # Simple plugins
  69. OBJS += \
  70. $(OBJDIR)/bypass.c.o \
  71. $(OBJDIR)/lfo.c.o \
  72. $(OBJDIR)/midi-channel-filter.c.o \
  73. $(OBJDIR)/midi-gain.c.o \
  74. $(OBJDIR)/midi-join.c.o \
  75. $(OBJDIR)/midi-split.c.o \
  76. $(OBJDIR)/midi-through.c.o \
  77. $(OBJDIR)/midi-transpose.c.o
  78. OBJS += \
  79. $(OBJDIR)/audio-file.cpp.o \
  80. $(OBJDIR)/bigmeter.cpp.o \
  81. $(OBJDIR)/midi-file.cpp.o \
  82. $(OBJDIR)/midi-pattern.cpp.o \
  83. $(OBJDIR)/notes.cpp.o
  84. # ----------------------------------------------------------------------------------------------------------------------------
  85. # DISTRHO plugins
  86. OBJS += \
  87. $(OBJDIR)/distrho-3bandeq.cpp.o \
  88. $(OBJDIR)/distrho-3bandsplitter.cpp.o \
  89. $(OBJDIR)/distrho-kars.cpp.o \
  90. $(OBJDIR)/distrho-nekobi.cpp.o \
  91. $(OBJDIR)/distrho-pingpongpan.cpp.o
  92. ifeq ($(HAVE_DGL),true)
  93. ifeq ($(HAVE_PROJECTM),true)
  94. OBJS += $(OBJDIR)/distrho-prom.cpp.o
  95. endif
  96. endif
  97. # ----------------------------------------------------------------------------------------------------------------------------
  98. # DISTRHO plugins (Juice)
  99. OBJS += \
  100. $(OBJDIR)/distrho-vectorjuice.cpp.o \
  101. $(OBJDIR)/distrho-wobblejuice.cpp.o
  102. # ----------------------------------------------------------------------------------------------------------------------------
  103. # ZynAddSubFX
  104. ifeq ($(HAVE_ZYN_DEPS),true)
  105. OBJS += \
  106. $(OBJDIR)/zynaddsubfx-fx.cpp.o \
  107. $(OBJDIR)/zynaddsubfx-synth.cpp.o \
  108. $(OBJDIR)/zynaddsubfx-src.cpp.o
  109. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  110. TARGETS += resources/zynaddsubfx-ui$(APP_EXT)
  111. ZYN_UI_FILES_CPP = \
  112. zynaddsubfx/UI/ADnoteUI.cpp \
  113. zynaddsubfx/UI/BankUI.cpp \
  114. zynaddsubfx/UI/ConfigUI.cpp \
  115. zynaddsubfx/UI/EffUI.cpp \
  116. zynaddsubfx/UI/EnvelopeUI.cpp \
  117. zynaddsubfx/UI/FilterUI.cpp \
  118. zynaddsubfx/UI/LFOUI.cpp \
  119. zynaddsubfx/UI/MasterUI.cpp \
  120. zynaddsubfx/UI/MicrotonalUI.cpp \
  121. zynaddsubfx/UI/OscilGenUI.cpp \
  122. zynaddsubfx/UI/PADnoteUI.cpp \
  123. zynaddsubfx/UI/PartUI.cpp \
  124. zynaddsubfx/UI/PresetsUI.cpp \
  125. zynaddsubfx/UI/ResonanceUI.cpp \
  126. zynaddsubfx/UI/SUBnoteUI.cpp \
  127. zynaddsubfx/UI/VirKeyboard.cpp
  128. ZYN_UI_FILES_H = \
  129. zynaddsubfx/UI/ADnoteUI.h \
  130. zynaddsubfx/UI/BankUI.h \
  131. zynaddsubfx/UI/ConfigUI.h \
  132. zynaddsubfx/UI/EffUI.h \
  133. zynaddsubfx/UI/EnvelopeUI.h \
  134. zynaddsubfx/UI/FilterUI.h \
  135. zynaddsubfx/UI/LFOUI.h \
  136. zynaddsubfx/UI/MasterUI.h \
  137. zynaddsubfx/UI/MicrotonalUI.h \
  138. zynaddsubfx/UI/OscilGenUI.h \
  139. zynaddsubfx/UI/PADnoteUI.h \
  140. zynaddsubfx/UI/PartUI.h \
  141. zynaddsubfx/UI/PresetsUI.h \
  142. zynaddsubfx/UI/ResonanceUI.h \
  143. zynaddsubfx/UI/SUBnoteUI.h \
  144. zynaddsubfx/UI/VirKeyboard.h
  145. endif
  146. endif
  147. # ----------------------------------------------------------------------------------------------------------------------------
  148. # Experimental plugins
  149. ifeq ($(EXPERIMENTAL_PLUGINS),true)
  150. OBJS += \
  151. $(OBJDIR)/zita-at1.cpp.o \
  152. $(OBJDIR)/zita-bls1.cpp.o \
  153. $(OBJDIR)/zita-rev1.cpp.o
  154. TARGETS += \
  155. resources/at1-ui$(APP_EXT) \
  156. resources/bls1-ui$(APP_EXT) \
  157. resources/rev1-ui$(APP_EXT)
  158. endif
  159. # ----------------------------------------------------------------------------------------------------------------------------
  160. all: $(TARGETS)
  161. # ----------------------------------------------------------------------------------------------------------------------------
  162. clean:
  163. rm -f $(OBJDIR)/*.o $(MODULEDIR)/$(MODULENAME)*.a $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP) $(TARGETS)
  164. debug:
  165. $(MAKE) DEBUG=true
  166. # ----------------------------------------------------------------------------------------------------------------------------
  167. $(MODULEDIR)/$(MODULENAME).a: $(OBJS)
  168. -@mkdir -p $(MODULEDIR)
  169. @echo "Creating $(MODULENAME).a"
  170. @rm -f $@
  171. @$(AR) crs $@ $^
  172. resources/at1-ui$(APP_EXT): $(OBJDIR)/zita-at1-ui.cpp.o
  173. -@mkdir -p $(OBJDIR)
  174. @echo "Linking at1-ui"
  175. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  176. resources/bls1-ui$(APP_EXT): $(OBJDIR)/zita-bls1-ui.cpp.o
  177. -@mkdir -p $(OBJDIR)
  178. @echo "Linking bls1-ui"
  179. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  180. resources/rev1-ui$(APP_EXT): $(OBJDIR)/zita-rev1-ui.cpp.o
  181. -@mkdir -p $(OBJDIR)
  182. @echo "Linking rev1-ui"
  183. @$(CXX) $^ $(ZITA_UI_LINK_FLAGS) -o $@
  184. resources/zynaddsubfx-ui$(APP_EXT): $(OBJDIR)/zynaddsubfx-ui.cpp.o
  185. -@mkdir -p $(OBJDIR)
  186. @echo "Linking zynaddsubfx-ui"
  187. @$(CXX) $^ $(ZYN_LD_FLAGS) -o $@
  188. # ----------------------------------------------------------------------------------------------------------------------------
  189. zynaddsubfx/UI/%.cpp: zynaddsubfx/UI/%.fl
  190. @echo "Generating $@|h"
  191. @$(FLUID) -c -o zynaddsubfx/UI/$*.cpp -h zynaddsubfx/UI/$*.h $<
  192. zynaddsubfx/UI/%.h: zynaddsubfx/UI/%.fl
  193. @echo "Generating $@|cpp"
  194. @$(FLUID) -c -o zynaddsubfx/UI/$*.cpp -h zynaddsubfx/UI/$*.h $<
  195. # ----------------------------------------------------------------------------------------------------------------------------
  196. $(OBJDIR)/%.c.o: %.c
  197. -@mkdir -p $(OBJDIR)
  198. @echo "Compiling $<"
  199. @$(CC) $< $(BUILD_C_FLAGS) -c -o $@
  200. # ----------------------------------------------------------------------------------------------------------------------------
  201. $(OBJDIR)/_data.cpp.o: _data.cpp
  202. -@mkdir -p $(OBJDIR)
  203. @echo "Compiling $<"
  204. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  205. $(OBJDIR)/audio-file.cpp.o: audio-file.cpp
  206. -@mkdir -p $(OBJDIR)
  207. @echo "Compiling $<"
  208. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  209. $(OBJDIR)/bigmeter.cpp.o: bigmeter.cpp
  210. -@mkdir -p $(OBJDIR)
  211. @echo "Compiling $<"
  212. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  213. $(OBJDIR)/midi-file.cpp.o: midi-file.cpp
  214. -@mkdir -p $(OBJDIR)
  215. @echo "Compiling $<"
  216. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  217. $(OBJDIR)/midi-pattern.cpp.o: midi-pattern.cpp
  218. -@mkdir -p $(OBJDIR)
  219. @echo "Compiling $<"
  220. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  221. $(OBJDIR)/notes.cpp.o: notes.cpp
  222. -@mkdir -p $(OBJDIR)
  223. @echo "Compiling $<"
  224. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  225. # ----------------------------------------------------------------------------------------------------------------------------
  226. $(OBJDIR)/distrho-3bandeq.cpp.o: distrho-3bandeq.cpp
  227. -@mkdir -p $(OBJDIR)
  228. @echo "Compiling $<"
  229. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_3BandEQ -Idistrho-3bandeq -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  230. $(OBJDIR)/distrho-3bandsplitter.cpp.o: distrho-3bandsplitter.cpp
  231. -@mkdir -p $(OBJDIR)
  232. @echo "Compiling $<"
  233. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_3BandSplitter -Idistrho-3bandsplitter -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  234. $(OBJDIR)/distrho-kars.cpp.o: distrho-kars.cpp
  235. -@mkdir -p $(OBJDIR)
  236. @echo "Compiling $<"
  237. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_Kars -Idistrho-kars -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  238. $(OBJDIR)/distrho-nekobi.cpp.o: distrho-nekobi.cpp
  239. -@mkdir -p $(OBJDIR)
  240. # FIXME - fix nekobi strict warnings
  241. @echo "Compiling $<"
  242. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_Nekobi -Idistrho-nekobi -I$(CWD)/modules/dgl -w -c -o $@
  243. $(OBJDIR)/distrho-pingpongpan.cpp.o: distrho-pingpongpan.cpp
  244. -@mkdir -p $(OBJDIR)
  245. @echo "Compiling $<"
  246. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_PingPongPan -Idistrho-pingpongpan -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  247. $(OBJDIR)/distrho-prom.cpp.o: distrho-prom.cpp
  248. -@mkdir -p $(OBJDIR)
  249. @echo "Compiling $<"
  250. @$(CXX) $< $(BUILD_CXX_FLAGS) $(PROJECTM_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_ProM -Idistrho-prom -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  251. # ----------------------------------------------------------------------------------------------------------------------------
  252. $(OBJDIR)/distrho-vectorjuice.cpp.o: distrho-vectorjuice.cpp
  253. -@mkdir -p $(OBJDIR)
  254. @echo "Compiling $<"
  255. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_VectorJuice -Idistrho-vectorjuice -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  256. $(OBJDIR)/distrho-wobblejuice.cpp.o: distrho-wobblejuice.cpp
  257. -@mkdir -p $(OBJDIR)
  258. @echo "Compiling $<"
  259. @$(CXX) $< $(BUILD_CXX_FLAGS) -DDISTRHO_NAMESPACE=DISTRHO_WobbleJuice -Idistrho-wobblejuice -I$(CWD)/modules/dgl -Wno-effc++ -c -o $@
  260. # ----------------------------------------------------------------------------------------------------------------------------
  261. $(OBJDIR)/zynaddsubfx-fx.cpp.o: zynaddsubfx-fx.cpp $(ZYN_UI_FILES_H)
  262. -@mkdir -p $(OBJDIR)
  263. @echo "Compiling $<"
  264. @$(CXX) $< $(ZYN_CXX_FLAGS) -c -o $@
  265. $(OBJDIR)/zynaddsubfx-synth.cpp.o: zynaddsubfx-synth.cpp $(ZYN_UI_FILES_H)
  266. -@mkdir -p $(OBJDIR)
  267. @echo "Compiling $<"
  268. @$(CXX) $< $(ZYN_CXX_FLAGS) -Wno-unused-parameter -c -o $@
  269. $(OBJDIR)/zynaddsubfx-src.cpp.o: zynaddsubfx-src.cpp $(ZYN_UI_FILES_H)
  270. -@mkdir -p $(OBJDIR)
  271. @echo "Compiling $<"
  272. @$(CXX) $< $(ZYN_CXX_FLAGS) -Wno-unused-parameter -Wno-unused-variable -c -o $@
  273. $(OBJDIR)/zynaddsubfx-ui.cpp.o: zynaddsubfx-ui.cpp $(ZYN_UI_FILES_H) $(ZYN_UI_FILES_CPP)
  274. -@mkdir -p $(OBJDIR)
  275. @echo "Compiling $<"
  276. @$(CXX) $< $(ZYN_CXX_FLAGS) -Wno-unused-parameter -Wno-unused-variable -c -o $@
  277. # ----------------------------------------------------------------------------------------------------------------------------
  278. $(OBJDIR)/zita-%-ui.cpp.o: zita-%-ui.cpp
  279. -@mkdir -p $(OBJDIR)
  280. @echo "Compiling $<"
  281. @$(CXX) $< $(ZITA_UI_CXX_FLAGS) -c -o $@
  282. $(OBJDIR)/zita-%.cpp.o: zita-%.cpp
  283. -@mkdir -p $(OBJDIR)
  284. @echo "Compiling $<"
  285. @$(CXX) $< $(ZITA_DSP_CXX_FLAGS) -c -o $@
  286. # ----------------------------------------------------------------------------------------------------------------------------
  287. -include $(OBJS:%.o=%.d)
  288. -include $(OBJDIR)/zita-at1-ui.cpp.d
  289. -include $(OBJDIR)/zita-bls1-ui.cpp.d
  290. -include $(OBJDIR)/zita-rev1-ui.cpp.d
  291. -include $(OBJDIR)/zynaddsubfx-ui.cpp.d
  292. # ----------------------------------------------------------------------------------------------------------------------------