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.

288 lines
9.7KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-plugin #
  3. # ------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. BINDIR := $(CWD)/../bin
  10. ifeq ($(DEBUG),true)
  11. OBJDIR := $(CWD)/../build/plugin/Debug
  12. MODULEDIR := $(CWD)/../build/modules/Debug
  13. else
  14. OBJDIR := $(CWD)/../build/plugin/Release
  15. MODULEDIR := $(CWD)/../build/modules/Release
  16. endif
  17. # ---------------------------------------------------------------------------------------------------------------------
  18. BUILD_CXX_FLAGS += -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  19. BUILD_CXX_FLAGS += $(NATIVE_PLUGINS_FLAGS)
  20. ifeq ($(HAVE_LIBLO),true)
  21. BUILD_CXX_FLAGS += $(LIBLO_FLAGS)
  22. endif
  23. ifeq ($(HAVE_FLUIDSYNTH),true)
  24. BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS)
  25. endif
  26. ifeq ($(HAVE_X11),true)
  27. BUILD_CXX_FLAGS += $(X11_FLAGS)
  28. endif
  29. # ---------------------------------------------------------------------------------------------------------------------
  30. # Libs
  31. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  32. LIBS += $(MODULEDIR)/carla_plugin.a
  33. LIBS += $(MODULEDIR)/jackbridge.a
  34. LIBS += $(MODULEDIR)/lilv.a
  35. LIBS += $(MODULEDIR)/rtmempool.a
  36. LIBS += $(MODULEDIR)/water.a
  37. LIBS += $(MODULEDIR)/audio_decoder.a
  38. LIBS += $(MODULEDIR)/native-plugins.a
  39. LIBS += $(MODULEDIR)/sfzero.a
  40. ifeq ($(HAVE_DGL),true)
  41. LIBS += $(MODULEDIR)/dgl.a
  42. endif
  43. ifeq ($(HAVE_HYLIA),true)
  44. LIBS += $(MODULEDIR)/hylia.a
  45. endif
  46. # ---------------------------------------------------------------------------------------------------------------------
  47. # Link flags
  48. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  49. LINK_FLAGS += $(LILV_LIBS)
  50. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  51. LINK_FLAGS += $(WATER_LIBS)
  52. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  53. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  54. LINK_FLAGS += $(LIBLO_LIBS)
  55. LINK_FLAGS += $(MAGIC_LIBS)
  56. LINK_FLAGS += $(X11_LIBS)
  57. ifeq ($(MACOS),true)
  58. SYMBOLS_NATIVE = -Wl,-exported_symbol,_carla_get_native_rack_plugin
  59. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_native_patchbay_plugin
  60. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_filename
  61. SYMBOLS_NATIVE += -Wl,-exported_symbol,_carla_get_library_folder
  62. SYMBOLS_LV2 = -Wl,-exported_symbol,_lv2_descriptor
  63. ifeq ($(HAVE_PYQT),true)
  64. SYMBOLS_LV2 += -Wl,-exported_symbol,_lv2ui_descriptor
  65. SYMBOLS_LV2_UI = -Wl,-exported_symbol,_lv2ui_descriptor
  66. endif
  67. SYMBOLS_VST = # TODO
  68. endif
  69. # ---------------------------------------------------------------------------------------------------------------------
  70. # ...
  71. LIBS_ui = $(MODULEDIR)/water.a
  72. # ---------------------------------------------------------------------------------------------------------------------
  73. TARGETS = \
  74. $(BINDIR)/carla-native-plugin$(APP_EXT) \
  75. $(BINDIR)/libcarla_native-plugin$(LIB_EXT)
  76. TARGETS += \
  77. $(BINDIR)/carla.lv2/carla$(LIB_EXT)
  78. ifeq ($(HAVE_PYQT),true)
  79. TARGETS += \
  80. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT)
  81. endif
  82. ifneq ($(CROSS_COMPILING),true)
  83. TARGETS += \
  84. $(BINDIR)/carla.lv2/manifest.ttl
  85. endif
  86. ifeq ($(LINUX),true)
  87. ifeq ($(HAVE_X11),true)
  88. ifeq ($(HAVE_PYQT),true)
  89. TARGETS += \
  90. $(BINDIR)/CarlaRack$(LIB_EXT) \
  91. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  92. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  93. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  94. $(BINDIR)/CarlaPatchbay32$(LIB_EXT) \
  95. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT) \
  96. $(BINDIR)/CarlaVstShell$(LIB_EXT)
  97. endif
  98. endif
  99. endif
  100. # ---------------------------------------------------------------------------------------------------------------------
  101. all: $(TARGETS)
  102. # ---------------------------------------------------------------------------------------------------------------------
  103. clean:
  104. rm -f $(OBJDIR)/*.o $(TARGETS)
  105. rm -f $(BINDIR)/carla.lv2/*.*
  106. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  107. debug:
  108. $(MAKE) DEBUG=true
  109. # ---------------------------------------------------------------------------------------------------------------------
  110. $(BINDIR)/carla-native-plugin$(APP_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS)
  111. -@mkdir -p $(BINDIR)
  112. @echo "Linking carla-native-plugin$(APP_EXT)"
  113. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  114. $(BINDIR)/libcarla_native-plugin$(LIB_EXT): $(OBJDIR)/carla-native-plugin.cpp.o $(LIBS)
  115. -@mkdir -p $(BINDIR)
  116. @echo "Linking libcarla-native-plugin$(LIB_EXT)"
  117. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(SYMBOLS_NATIVE) $(LINK_FLAGS) -o $@
  118. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  119. -@mkdir -p $(BINDIR)/carla.lv2
  120. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  121. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2) $(LINK_FLAGS) -o $@
  122. $(BINDIR)/carla.lv2/carla-ui$(LIB_EXT): $(OBJDIR)/carla-lv2-ui.cpp.o $(LIBS_ui)
  123. -@mkdir -p $(BINDIR)/carla.lv2
  124. @echo "Linking carla.lv2/carla-ui$(LIB_EXT)"
  125. @$(CXX) $< $(LIBS_START) $(LIBS_ui) $(LIBS_END) $(SHARED) $(SYMBOLS_LV2_UI) $(LINK_FLAGS) -o $@
  126. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  127. -@mkdir -p $(BINDIR)
  128. @echo "Linking CarlaRack$(LIB_EXT)"
  129. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  130. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  131. -@mkdir -p $(BINDIR)
  132. @echo "Linking CarlaRackFX$(LIB_EXT)"
  133. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  134. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  135. -@mkdir -p $(BINDIR)
  136. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  137. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  138. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(LIBS)
  139. -@mkdir -p $(BINDIR)
  140. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  141. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  142. $(BINDIR)/CarlaPatchbay32$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o $(LIBS)
  143. -@mkdir -p $(BINDIR)
  144. @echo "Linking CarlaPatchbay32$(LIB_EXT)"
  145. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  146. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(LIBS)
  147. -@mkdir -p $(BINDIR)
  148. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  149. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  150. $(BINDIR)/CarlaVstShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shell.o $(LIBS)
  151. -@mkdir -p $(BINDIR)
  152. @echo "Linking CarlaRackVstShell$(LIB_EXT)"
  153. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  154. # ---------------------------------------------------------------------------------------------------------------------
  155. $(OBJDIR)/carla-native-plugin.cpp.o: carla-native-plugin.cpp
  156. -@mkdir -p $(OBJDIR)
  157. @echo "Compiling $<"
  158. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  159. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  160. -@mkdir -p $(OBJDIR)
  161. @echo "Compiling $<"
  162. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  163. $(OBJDIR)/carla-lv2-ui.cpp.o: carla-lv2-ui.cpp
  164. -@mkdir -p $(OBJDIR)
  165. @echo "Compiling $<"
  166. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  167. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  168. -@mkdir -p $(OBJDIR)
  169. @echo "Compiling $< (RackFX)"
  170. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  171. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  172. -@mkdir -p $(OBJDIR)
  173. @echo "Compiling $< (RackSynth)"
  174. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  175. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  176. -@mkdir -p $(OBJDIR)
  177. @echo "Compiling $< (PatchbayFX)"
  178. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  179. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  180. -@mkdir -p $(OBJDIR)
  181. @echo "Compiling $< (PatchbaySynth)"
  182. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  183. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  184. -@mkdir -p $(OBJDIR)
  185. @echo "Compiling $< (PatchbaySynth 16ch)"
  186. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH=1 -c -o $@
  187. $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp
  188. -@mkdir -p $(OBJDIR)
  189. @echo "Compiling $< (PatchbaySynth 32ch)"
  190. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH=1 -c -o $@
  191. $(OBJDIR)/carla-vst.cpp.shell.o: carla-vst.cpp
  192. -@mkdir -p $(OBJDIR)
  193. @echo "Compiling $< (VstShell)"
  194. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_VST_SHELL=1 -c -o $@
  195. # ---------------------------------------------------------------------------------------------------------------------
  196. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  197. -@mkdir -p $(BINDIR)/carla.lv2
  198. @echo "Linking carla-lv2-export$(APP_EXT)"
  199. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  200. @echo "Generating LV2 ttl data"
  201. ifeq ($(BUILDING_FOR_WINDOWS),true)
  202. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  203. else
  204. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  205. endif
  206. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  207. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  208. -@mkdir -p $(BINDIR)
  209. @echo "Linking carla-lv2-export$(APP_EXT)"
  210. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  211. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  212. -@mkdir -p $(OBJDIR)
  213. @echo "Compiling $<"
  214. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  215. # ---------------------------------------------------------------------------------------------------------------------
  216. -include $(OBJDIR)/carla-lv2.cpp.d
  217. -include $(OBJDIR)/carla-lv2-export.cpp.d
  218. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  219. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  220. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  221. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  222. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  223. -include $(OBJDIR)/carla-vst.cpp.shell.d
  224. # ---------------------------------------------------------------------------------------------------------------------