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.

234 lines
7.8KB

  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_LINUXSAMPLER),true)
  27. BUILD_CXX_FLAGS += $(LINUXSAMPLER_FLAGS)
  28. endif
  29. ifeq ($(HAVE_X11),true)
  30. BUILD_CXX_FLAGS += $(X11_FLAGS)
  31. endif
  32. ifeq ($(CARLA_ZYN_COMPAT),true)
  33. BUILD_CXX_FLAGS += -DCARLA_ZYN_LV2_EXPORTED
  34. endif
  35. # ----------------------------------------------------------------------------------------------------------------------------
  36. # Libs
  37. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  38. LIBS += $(MODULEDIR)/carla_plugin.a
  39. LIBS += $(MODULEDIR)/jackbridge.a
  40. LIBS += $(MODULEDIR)/lilv.a
  41. LIBS += $(MODULEDIR)/rtmempool.a
  42. LIBS += $(MODULEDIR)/water.a
  43. LIBS += $(MODULEDIR)/audio_decoder.a
  44. LIBS += $(MODULEDIR)/native-plugins.all.a
  45. ifeq ($(HAVE_DGL),true)
  46. LIBS += $(MODULEDIR)/dgl.a
  47. endif
  48. ifeq ($(HAVE_HYLIA),true)
  49. LIBS += $(MODULEDIR)/hylia.a
  50. endif
  51. # ----------------------------------------------------------------------------------------------------------------------------
  52. # Link flags
  53. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  54. LINK_FLAGS += $(LILV_LIBS)
  55. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  56. LINK_FLAGS += $(WATER_LIBS)
  57. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  58. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  59. LINK_FLAGS += $(LIBLO_LIBS)
  60. LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  61. LINK_FLAGS += $(MAGIC_LIBS)
  62. LINK_FLAGS += $(X11_LIBS)
  63. ifeq ($(MACOS),true)
  64. # NOTE: this assumes only LV2 version will be built
  65. SHARED += -Wl,-exported_symbol,_lv2_descriptor
  66. SHARED += -Wl,-exported_symbol,_lv2ui_descriptor
  67. endif
  68. # ----------------------------------------------------------------------------------------------------------------------------
  69. TARGETS = \
  70. $(BINDIR)/carla.lv2/carla$(LIB_EXT) \
  71. $(BINDIR)/carla.lv2/manifest.ttl
  72. ifeq ($(LINUX),true)
  73. ifeq ($(HAVE_X11),true)
  74. ifeq ($(HAVE_PYQT),true)
  75. TARGETS += \
  76. $(BINDIR)/CarlaRack$(LIB_EXT) \
  77. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  78. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  79. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  80. $(BINDIR)/CarlaPatchbay32$(LIB_EXT) \
  81. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT)
  82. endif
  83. endif
  84. endif
  85. # ----------------------------------------------------------------------------------------------------------------------------
  86. all: $(TARGETS)
  87. # ----------------------------------------------------------------------------------------------------------------------------
  88. clean:
  89. rm -f $(OBJDIR)/*.o $(TARGETS)
  90. rm -f $(BINDIR)/carla.lv2/*.*
  91. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  92. debug:
  93. $(MAKE) DEBUG=true
  94. # ----------------------------------------------------------------------------------------------------------------------------
  95. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  96. -@mkdir -p $(BINDIR)/carla.lv2
  97. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  98. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  99. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  100. -@mkdir -p $(BINDIR)
  101. @echo "Linking CarlaRack$(LIB_EXT)"
  102. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  103. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  104. -@mkdir -p $(BINDIR)
  105. @echo "Linking CarlaRackFX$(LIB_EXT)"
  106. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  107. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  108. -@mkdir -p $(BINDIR)
  109. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  110. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  111. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(LIBS)
  112. -@mkdir -p $(BINDIR)
  113. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  114. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  115. $(BINDIR)/CarlaPatchbay32$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o $(LIBS)
  116. -@mkdir -p $(BINDIR)
  117. @echo "Linking CarlaPatchbay32$(LIB_EXT)"
  118. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  119. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(LIBS)
  120. -@mkdir -p $(BINDIR)
  121. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  122. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  123. # ----------------------------------------------------------------------------------------------------------------------------
  124. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  125. -@mkdir -p $(OBJDIR)
  126. @echo "Compiling $<"
  127. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  128. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  129. -@mkdir -p $(OBJDIR)
  130. @echo "Compiling $< (RackFX)"
  131. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  132. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  133. -@mkdir -p $(OBJDIR)
  134. @echo "Compiling $< (RackSynth)"
  135. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  136. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  137. -@mkdir -p $(OBJDIR)
  138. @echo "Compiling $< (PatchbayFX)"
  139. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  140. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  141. -@mkdir -p $(OBJDIR)
  142. @echo "Compiling $< (PatchbaySynth)"
  143. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  144. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  145. -@mkdir -p $(OBJDIR)
  146. @echo "Compiling $< (PatchbaySynth 16ch)"
  147. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH -c -o $@
  148. $(OBJDIR)/carla-vst.cpp.patchbay-syn32.o: carla-vst.cpp
  149. -@mkdir -p $(OBJDIR)
  150. @echo "Compiling $< (PatchbaySynth 32ch)"
  151. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_32CH -c -o $@
  152. # ----------------------------------------------------------------------------------------------------------------------------
  153. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  154. -@mkdir -p $(BINDIR)/carla.lv2
  155. @echo "Linking carla-lv2-export$(APP_EXT)"
  156. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  157. @echo "Generating LV2 ttl data"
  158. ifeq ($(BUILDING_FOR_WINDOWS),true)
  159. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  160. else
  161. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  162. endif
  163. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  164. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  165. -@mkdir -p $(BINDIR)
  166. @echo "Linking carla-lv2-export$(APP_EXT)"
  167. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  168. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  169. -@mkdir -p $(OBJDIR)
  170. @echo "Compiling $<"
  171. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  172. # ----------------------------------------------------------------------------------------------------------------------------
  173. -include $(OBJDIR)/carla-lv2.cpp.d
  174. -include $(OBJDIR)/carla-lv2-export.cpp.d
  175. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  176. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  177. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  178. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  179. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  180. # ----------------------------------------------------------------------------------------------------------------------------