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.

215 lines
6.9KB

  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. # ----------------------------------------------------------------------------------------------------------------------------
  21. # Libs
  22. LIBS = $(MODULEDIR)/carla_engine_plugin.a
  23. LIBS += $(MODULEDIR)/carla_plugin.a
  24. LIBS += $(MODULEDIR)/jackbridge.a
  25. LIBS += $(MODULEDIR)/juce_audio_basics.a
  26. LIBS += $(MODULEDIR)/juce_audio_formats.a
  27. LIBS += $(MODULEDIR)/juce_core.a
  28. LIBS += $(MODULEDIR)/lilv.a
  29. LIBS += $(MODULEDIR)/native-plugins.a
  30. LIBS += $(MODULEDIR)/rtmempool.a
  31. ifeq ($(HAVE_DGL),true)
  32. LIBS += $(MODULEDIR)/dgl.a
  33. endif
  34. ifeq ($(MACOS_OR_WIN32),true)
  35. LIBS += $(MODULEDIR)/juce_audio_processors.a
  36. LIBS += $(MODULEDIR)/juce_data_structures.a
  37. LIBS += $(MODULEDIR)/juce_events.a
  38. LIBS += $(MODULEDIR)/juce_graphics.a
  39. LIBS += $(MODULEDIR)/juce_gui_basics.a
  40. endif
  41. ifeq ($(MACOS),true)
  42. LIBS += $(MODULEDIR)/juce_gui_extra.a
  43. endif
  44. # ----------------------------------------------------------------------------------------------------------------------------
  45. # Link flags
  46. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  47. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  48. LINK_FLAGS += $(JUCE_AUDIO_FORMATS_LIBS)
  49. LINK_FLAGS += $(JUCE_CORE_LIBS)
  50. LINK_FLAGS += $(LILV_LIBS)
  51. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  52. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  53. ifeq ($(MACOS_OR_WIN32),true)
  54. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  55. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  56. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  57. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  58. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  59. endif
  60. ifeq ($(MACOS),true)
  61. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  62. endif
  63. ifeq ($(HAVE_LIBLO),true)
  64. LINK_FLAGS += $(LIBLO_LIBS)
  65. endif
  66. ifeq ($(HAVE_LIBMAGIC),true)
  67. LINK_FLAGS += -lmagic
  68. endif
  69. ifeq ($(HAVE_FLUIDSYNTH),true)
  70. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  71. endif
  72. ifeq ($(HAVE_LINUXSAMPLER),true)
  73. LINK_FLAGS += $(LINUXSAMPLER_LIBS)
  74. endif
  75. ifeq ($(HAVE_X11),true)
  76. LINK_FLAGS += $(X11_LIBS)
  77. endif
  78. # ----------------------------------------------------------------------------------------------------------------------------
  79. TARGETS = \
  80. $(BINDIR)/carla.lv2/carla$(LIB_EXT) \
  81. $(BINDIR)/carla.lv2/manifest.ttl
  82. ifeq ($(LINUX),true)
  83. ifeq ($(HAVE_X11),true)
  84. ifeq ($(DEFAULT_QT),4)
  85. TARGETS += \
  86. $(BINDIR)/CarlaRack$(LIB_EXT) \
  87. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  88. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  89. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT)
  90. endif
  91. endif
  92. endif
  93. # ----------------------------------------------------------------------------------------------------------------------------
  94. all: $(TARGETS)
  95. # ----------------------------------------------------------------------------------------------------------------------------
  96. clean:
  97. rm -f $(OBJDIR)/*.o $(TARGETS)
  98. rm -f $(BINDIR)/carla.lv2/*.*
  99. debug:
  100. $(MAKE) DEBUG=true
  101. # ----------------------------------------------------------------------------------------------------------------------------
  102. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  103. -@mkdir -p $(BINDIR)/carla.lv2
  104. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  105. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  106. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  107. -@mkdir -p $(BINDIR)
  108. @echo "Linking CarlaRack$(LIB_EXT)"
  109. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  110. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  111. -@mkdir -p $(BINDIR)
  112. @echo "Linking CarlaRackFX$(LIB_EXT)"
  113. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  114. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  115. -@mkdir -p $(BINDIR)
  116. @echo "Linking CarlaPatchbay$(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. # ----------------------------------------------------------------------------------------------------------------------------
  144. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  145. -@mkdir -p $(BINDIR)/carla.lv2
  146. @echo "Linking carla-lv2-export$(APP_EXT)"
  147. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  148. @echo "Generating LV2 ttl data"
  149. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  150. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  151. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  152. -@mkdir -p $(BINDIR)
  153. @echo "Linking carla-lv2-export$(APP_EXT)"
  154. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  155. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  156. -@mkdir -p $(OBJDIR)
  157. @echo "Compiling $<"
  158. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  159. # ----------------------------------------------------------------------------------------------------------------------------
  160. -include $(OBJDIR)/carla-lv2.cpp.d
  161. -include $(OBJDIR)/carla-lv2-export.cpp.d
  162. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  163. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  164. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  165. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  166. # ----------------------------------------------------------------------------------------------------------------------------