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.

Makefile 7.8KB

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