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.1KB

11 years ago
10 years ago
10 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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)/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. # ----------------------------------------------------------------------------------------------------------------------------
  64. TARGETS = \
  65. $(BINDIR)/carla.lv2/carla$(LIB_EXT) \
  66. $(BINDIR)/carla.lv2/manifest.ttl
  67. ifeq ($(LINUX),true)
  68. ifeq ($(HAVE_X11),true)
  69. ifeq ($(HAVE_PYQT),true)
  70. TARGETS += \
  71. $(BINDIR)/CarlaRack$(LIB_EXT) \
  72. $(BINDIR)/CarlaRackFX$(LIB_EXT) \
  73. $(BINDIR)/CarlaPatchbay$(LIB_EXT) \
  74. $(BINDIR)/CarlaPatchbay16$(LIB_EXT) \
  75. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT)
  76. endif
  77. endif
  78. endif
  79. # ----------------------------------------------------------------------------------------------------------------------------
  80. all: $(TARGETS)
  81. # ----------------------------------------------------------------------------------------------------------------------------
  82. clean:
  83. rm -f $(OBJDIR)/*.o $(TARGETS)
  84. rm -f $(BINDIR)/carla.lv2/*.*
  85. rm -f $(BINDIR)/carla-lv2-export$(APP_EXT)
  86. debug:
  87. $(MAKE) DEBUG=true
  88. # ----------------------------------------------------------------------------------------------------------------------------
  89. $(BINDIR)/carla.lv2/carla$(LIB_EXT): $(OBJDIR)/carla-lv2.cpp.o $(LIBS)
  90. -@mkdir -p $(BINDIR)/carla.lv2
  91. @echo "Linking carla.lv2/carla$(LIB_EXT)"
  92. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  93. $(BINDIR)/CarlaRack$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-syn.o $(LIBS)
  94. -@mkdir -p $(BINDIR)
  95. @echo "Linking CarlaRack$(LIB_EXT)"
  96. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  97. $(BINDIR)/CarlaRackFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.rack-fx.o $(LIBS)
  98. -@mkdir -p $(BINDIR)
  99. @echo "Linking CarlaRackFX$(LIB_EXT)"
  100. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  101. $(BINDIR)/CarlaPatchbay$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn.o $(LIBS)
  102. -@mkdir -p $(BINDIR)
  103. @echo "Linking CarlaPatchbay$(LIB_EXT)"
  104. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  105. $(BINDIR)/CarlaPatchbay16$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o $(LIBS)
  106. -@mkdir -p $(BINDIR)
  107. @echo "Linking CarlaPatchbay16$(LIB_EXT)"
  108. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  109. $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(LIBS)
  110. -@mkdir -p $(BINDIR)
  111. @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
  112. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@
  113. # ----------------------------------------------------------------------------------------------------------------------------
  114. $(OBJDIR)/carla-lv2.cpp.o: carla-lv2.cpp
  115. -@mkdir -p $(OBJDIR)
  116. @echo "Compiling $<"
  117. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  118. $(OBJDIR)/carla-vst.cpp.rack-fx.o: carla-vst.cpp
  119. -@mkdir -p $(OBJDIR)
  120. @echo "Compiling $< (RackFX)"
  121. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  122. $(OBJDIR)/carla-vst.cpp.rack-syn.o: carla-vst.cpp
  123. -@mkdir -p $(OBJDIR)
  124. @echo "Compiling $< (RackSynth)"
  125. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=0 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  126. $(OBJDIR)/carla-vst.cpp.patchbay-fx.o: carla-vst.cpp
  127. -@mkdir -p $(OBJDIR)
  128. @echo "Compiling $< (PatchbayFX)"
  129. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=0 -c -o $@
  130. $(OBJDIR)/carla-vst.cpp.patchbay-syn.o: carla-vst.cpp
  131. -@mkdir -p $(OBJDIR)
  132. @echo "Compiling $< (PatchbaySynth)"
  133. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -c -o $@
  134. $(OBJDIR)/carla-vst.cpp.patchbay-syn16.o: carla-vst.cpp
  135. -@mkdir -p $(OBJDIR)
  136. @echo "Compiling $< (PatchbaySynth 16ch)"
  137. @$(CXX) $< $(BUILD_CXX_FLAGS) -DCARLA_PLUGIN_PATCHBAY=1 -DCARLA_PLUGIN_SYNTH=1 -DCARLA_PLUGIN_16CH -c -o $@
  138. # ----------------------------------------------------------------------------------------------------------------------------
  139. $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  140. -@mkdir -p $(BINDIR)/carla.lv2
  141. @echo "Linking carla-lv2-export$(APP_EXT)"
  142. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $(BINDIR)/carla-lv2-export$(APP_EXT)
  143. @echo "Generating LV2 ttl data"
  144. ifeq ($(BUILDING_FOR_WINDOWS),true)
  145. @cd $(BINDIR) && wine ./carla-lv2-export$(APP_EXT)
  146. else
  147. @cd $(BINDIR) && ./carla-lv2-export$(APP_EXT)
  148. endif
  149. @cd $(BINDIR)/carla.lv2 && ln -sf ../*bridge-* ../carla-discovery-* .
  150. $(BINDIR)/carla-lv2-export$(APP_EXT): $(OBJDIR)/carla-lv2-export.cpp.o $(LIBS)
  151. -@mkdir -p $(BINDIR)
  152. @echo "Linking carla-lv2-export$(APP_EXT)"
  153. @$(CXX) $< $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  154. $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
  155. -@mkdir -p $(OBJDIR)
  156. @echo "Compiling $<"
  157. @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  158. # ----------------------------------------------------------------------------------------------------------------------------
  159. -include $(OBJDIR)/carla-lv2.cpp.d
  160. -include $(OBJDIR)/carla-lv2-export.cpp.d
  161. -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
  162. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn.d
  163. -include $(OBJDIR)/carla-vst.cpp.patchbay-syn16.d
  164. -include $(OBJDIR)/carla-vst.cpp.rack-fx.d
  165. -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
  166. # ----------------------------------------------------------------------------------------------------------------------------