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.

228 lines
7.3KB

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