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.

323 lines
9.6KB

  1. #!/usr/bin/make -f
  2. # Makefile for carla-frontend #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. CWD=..
  7. include $(CWD)/Makefile.mk
  8. # ---------------------------------------------------------------------------------------------------------------------
  9. BINDIR := $(CWD)/../bin
  10. RESDIR := $(CWD)/../resources
  11. ifeq ($(DEBUG),true)
  12. OBJDIR := $(CWD)/../build/frontend/Debug
  13. MODULEDIR := $(CWD)/../build/modules/Debug
  14. else
  15. OBJDIR := $(CWD)/../build/frontend/Release
  16. MODULEDIR := $(CWD)/../build/modules/Release
  17. endif
  18. # ---------------------------------------------------------------------------------------------------------------------
  19. BUILD_CXX_FLAGS += -I. -I$(CWD) -I$(CWD)/backend -I$(CWD)/includes -I$(CWD)/modules -I$(CWD)/utils
  20. BUILD_CXX_FLAGS += -DCARLA_SKIP_HOST_COMMON
  21. BUILD_CXX_FLAGS += -Wno-unused-parameter
  22. BUILD_CXX_FLAGS += -Wno-unused-variable
  23. BUILD_CXX_FLAGS += $(FLUIDSYNTH_FLAGS)
  24. BUILD_CXX_FLAGS += $(QT5_FLAGS)
  25. # ---------------------------------------------------------------------------------------------------------------------
  26. # Resources
  27. ifeq ($(CPPMODE),true)
  28. RES = \
  29. resources_rc.cpp
  30. else
  31. RES = \
  32. resources_rc.py \
  33. $(BINDIR)/resources/modgui \
  34. $(BINDIR)/resources/patchcanvas \
  35. $(BINDIR)/resources/widgets \
  36. $(BINDIR)/resources/bigmeter-ui \
  37. $(BINDIR)/resources/carla-plugin \
  38. $(BINDIR)/resources/carla-plugin-patchbay \
  39. $(BINDIR)/resources/carla_app.py \
  40. $(BINDIR)/resources/carla_backend.py \
  41. $(BINDIR)/resources/carla_backend_qt.py \
  42. $(BINDIR)/resources/carla_control.py \
  43. $(BINDIR)/resources/carla_database.py \
  44. $(BINDIR)/resources/carla_host.py \
  45. $(BINDIR)/resources/carla_modgui.py \
  46. $(BINDIR)/resources/carla_settings.py \
  47. $(BINDIR)/resources/carla_skin.py \
  48. $(BINDIR)/resources/carla_shared.py \
  49. $(BINDIR)/resources/carla_utils.py \
  50. $(BINDIR)/resources/carla_widgets.py \
  51. $(BINDIR)/resources/externalui.py \
  52. $(BINDIR)/resources/midipattern-ui \
  53. $(BINDIR)/resources/notes-ui \
  54. $(BINDIR)/resources/resources_rc.py \
  55. $(BINDIR)/resources/ui_carla_about.py \
  56. $(BINDIR)/resources/ui_carla_about_juce.py \
  57. $(BINDIR)/resources/ui_carla_add_jack.py \
  58. $(BINDIR)/resources/ui_carla_database.py \
  59. $(BINDIR)/resources/ui_carla_edit.py \
  60. $(BINDIR)/resources/ui_carla_host.py \
  61. $(BINDIR)/resources/ui_carla_osc_connect.py \
  62. $(BINDIR)/resources/ui_carla_parameter.py \
  63. $(BINDIR)/resources/ui_carla_plugin_calf.py \
  64. $(BINDIR)/resources/ui_carla_plugin_classic.py \
  65. $(BINDIR)/resources/ui_carla_plugin_compact.py \
  66. $(BINDIR)/resources/ui_carla_plugin_default.py \
  67. $(BINDIR)/resources/ui_carla_plugin_presets.py \
  68. $(BINDIR)/resources/ui_carla_refresh.py \
  69. $(BINDIR)/resources/ui_carla_settings.py \
  70. $(BINDIR)/resources/ui_carla_settings_driver.py \
  71. $(BINDIR)/resources/ui_inputdialog_value.py \
  72. $(BINDIR)/resources/ui_midipattern.py
  73. endif
  74. ifneq ($(SKIP_ZYN_SYNTH),true)
  75. ifeq ($(HAVE_ZYN_UI_DEPS),true)
  76. RES += \
  77. $(BINDIR)/resources/zynaddsubfx \
  78. $(BINDIR)/resources/zynaddsubfx-ui
  79. endif
  80. endif
  81. # ---------------------------------------------------------------------------------------------------------------------
  82. # UI code
  83. ifeq ($(CPPMODE),true)
  84. UIs = \
  85. ui_carla_about.hpp \
  86. ui_carla_about_juce.hpp \
  87. ui_carla_add_jack.hpp \
  88. ui_carla_database.hpp \
  89. ui_carla_edit.hpp \
  90. ui_carla_host.hpp \
  91. ui_carla_osc_connect.hpp \
  92. ui_carla_parameter.hpp \
  93. ui_carla_plugin_calf.hpp \
  94. ui_carla_plugin_classic.hpp \
  95. ui_carla_plugin_compact.hpp \
  96. ui_carla_plugin_default.hpp \
  97. ui_carla_plugin_presets.hpp \
  98. ui_carla_refresh.hpp \
  99. ui_carla_settings.hpp \
  100. ui_carla_settings_driver.hpp \
  101. ui_inputdialog_value.hpp \
  102. ui_midipattern.hpp
  103. else
  104. UIs = \
  105. ui_carla_about.py \
  106. ui_carla_about_juce.py \
  107. ui_carla_add_jack.py \
  108. ui_carla_database.py \
  109. ui_carla_edit.py \
  110. ui_carla_host.py \
  111. ui_carla_osc_connect.py \
  112. ui_carla_parameter.py \
  113. ui_carla_plugin_calf.py \
  114. ui_carla_plugin_classic.py \
  115. ui_carla_plugin_compact.py \
  116. ui_carla_plugin_default.py \
  117. ui_carla_plugin_presets.py \
  118. ui_carla_refresh.py \
  119. ui_carla_settings.py \
  120. ui_carla_settings_driver.py \
  121. ui_inputdialog_value.py \
  122. ui_midipattern.py
  123. endif
  124. # ---------------------------------------------------------------------------------------------------------------------
  125. LIBS = $(MODULEDIR)/carla_engine.a
  126. LIBS += $(MODULEDIR)/carla_plugin.a
  127. LIBS += $(MODULEDIR)/jackbridge.a
  128. LIBS += $(MODULEDIR)/audio_decoder.a
  129. LIBS += $(MODULEDIR)/lilv.a
  130. LIBS += $(MODULEDIR)/native-plugins.a
  131. LIBS += $(MODULEDIR)/rtmempool.a
  132. LIBS += $(MODULEDIR)/sfzero.a
  133. LIBS += $(MODULEDIR)/water.a
  134. ifeq ($(HAVE_DGL),true)
  135. LIBS += $(MODULEDIR)/dgl.a
  136. endif
  137. ifeq ($(HAVE_HYLIA),true)
  138. LIBS += $(MODULEDIR)/hylia.a
  139. endif
  140. ifeq ($(USING_JUCE),true)
  141. LIBS += $(MODULEDIR)/juce_audio_basics.a
  142. LIBS += $(MODULEDIR)/juce_audio_devices.a
  143. LIBS += $(MODULEDIR)/juce_audio_processors.a
  144. LIBS += $(MODULEDIR)/juce_core.a
  145. LIBS += $(MODULEDIR)/juce_data_structures.a
  146. LIBS += $(MODULEDIR)/juce_events.a
  147. LIBS += $(MODULEDIR)/juce_graphics.a
  148. LIBS += $(MODULEDIR)/juce_gui_basics.a
  149. ifeq ($(MACOS),true)
  150. LIBS += $(MODULEDIR)/juce_gui_extra.a
  151. endif
  152. else
  153. LIBS += $(MODULEDIR)/rtaudio.a
  154. LIBS += $(MODULEDIR)/rtmidi.a
  155. endif
  156. # ---------------------------------------------------------------------------------------------------------------------
  157. LINK_FLAGS += $(QT5_LIBS)
  158. LINK_FLAGS += $(HYLIA_LIBS)
  159. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  160. LINK_FLAGS += $(LILV_LIBS)
  161. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  162. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  163. LINK_FLAGS += $(WATER_LIBS)
  164. LINK_FLAGS += $(LIBLO_LIBS)
  165. LINK_FLAGS += $(MAGIC_LIBS)
  166. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  167. LINK_FLAGS += $(X11_LIBS)
  168. ifeq ($(USING_JUCE),true)
  169. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  170. LINK_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS)
  171. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  172. LINK_FLAGS += $(JUCE_CORE_LIBS)
  173. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  174. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  175. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  176. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  177. ifeq ($(MACOS),true)
  178. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  179. endif
  180. else
  181. LINK_FLAGS += $(RTAUDIO_LIBS)
  182. LINK_FLAGS += $(RTMIDI_LIBS)
  183. endif
  184. ifeq ($(JACKBRIDGE_DIRECT),true)
  185. LINK_FLAGS += $(JACK_LIBS)
  186. endif
  187. # ---------------------------------------------------------------------------------------------------------------------
  188. OBJS = \
  189. $(OBJDIR)/carla_app.cpp.o \
  190. $(OBJDIR)/carla_database.cpp.o \
  191. $(OBJDIR)/carla_host.cpp.o \
  192. $(OBJDIR)/carla_settings.cpp.o \
  193. $(OBJDIR)/carla_skin.cpp.o \
  194. $(OBJDIR)/carla_shared.cpp.o \
  195. $(OBJDIR)/carla_widgets.cpp.o \
  196. $(OBJDIR)/patchcanvas/theme.cpp.o \
  197. $(OBJDIR)/moc_carla_database.cpp.o \
  198. $(OBJDIR)/moc_carla_host.cpp.o \
  199. $(OBJDIR)/moc_carla_settings.cpp.o \
  200. $(OBJDIR)/moc_carla_widgets.cpp.o \
  201. $(OBJDIR)/resources_rc.cpp.o \
  202. $(OBJDIR)/CarlaStandalone.cpp.o \
  203. $(OBJDIR)/CarlaStandaloneNSM.cpp.o \
  204. $(OBJDIR)/Information.cpp.o
  205. # ---------------------------------------------------------------------------------------------------------------------
  206. TARGETS = $(RES) $(UIs)
  207. ifeq ($(CPPMODE),true)
  208. TARGETS += $(BINDIR)/carla
  209. TARGETS += $(BINDIR)/carla-database
  210. TARGETS += $(BINDIR)/carla-settings
  211. endif
  212. # ---------------------------------------------------------------------------------------------------------------------
  213. all: $(TARGETS)
  214. # ---------------------------------------------------------------------------------------------------------------------
  215. $(BINDIR)/carla: $(OBJS) $(OBJDIR)/carla.cpp.o
  216. -@mkdir -p $(BINDIR)
  217. @echo "Linking carla"
  218. $(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  219. $(BINDIR)/carla-%: $(OBJS) $(OBJDIR)/carla_%_app.cpp.o
  220. -@mkdir -p $(BINDIR)
  221. @echo "Linking carla_$*"
  222. $(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  223. # ---------------------------------------------------------------------------------------------------------------------
  224. moc_%.cpp: %.hpp
  225. $(MOC_QT5) $< -o $@
  226. ui_%.hpp: $(RESDIR)/ui/%.ui
  227. $(UIC_QT5) $< -o $@
  228. ui_%.py: $(RESDIR)/ui/%.ui
  229. $(PYUIC) $< -o $@
  230. resources_rc.cpp: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
  231. $(RCC_QT5) $< -o $@
  232. resources_rc.py: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
  233. $(PYRCC) $< -o $@
  234. $(BINDIR)/resources/%: %
  235. -@mkdir -p $(BINDIR)/resources
  236. $(LINK) $(CURDIR)/$* $(BINDIR)/resources/
  237. $(BINDIR)/resources/zynaddsubfx: ../native-plugins/resources/zynaddsubfx
  238. -@mkdir -p $(BINDIR)/resources
  239. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  240. $(BINDIR)/resources/zynaddsubfx-ui: ../native-plugins/resources/zynaddsubfx-ui
  241. -@mkdir -p $(BINDIR)/resources
  242. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  243. # ---------------------------------------------------------------------------------------------------------------------
  244. $(OBJDIR)/%.cpp.o: %.cpp $(UIs)
  245. -@mkdir -p $(OBJDIR)/patchcanvas
  246. @echo "Compiling $<"
  247. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  248. $(OBJDIR)/Information.cpp.o: $(CWD)/backend/utils/Information.cpp
  249. -@mkdir -p $(OBJDIR)
  250. @echo "Compiling $<"
  251. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  252. $(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp
  253. -@mkdir -p $(OBJDIR)
  254. @echo "Compiling $<"
  255. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  256. $(OBJDIR)/CarlaStandaloneNSM.cpp.o: $(CWD)/backend/CarlaStandaloneNSM.cpp
  257. -@mkdir -p $(OBJDIR)
  258. @echo "Compiling $<"
  259. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  260. # ---------------------------------------------------------------------------------------------------------------------
  261. clean:
  262. rm -rf $(UIs) $(RES) __pycache__ *.pyc
  263. debug:
  264. $(MAKE) DEBUG=true
  265. # ---------------------------------------------------------------------------------------------------------------------
  266. -include $(OBJS:%.o=%.d)
  267. -include $(OBJDIR)/carla.cpp.d
  268. -include $(OBJDIR)/carla_database_app.cpp.d
  269. -include $(OBJDIR)/carla_settings_app.cpp.d
  270. # ---------------------------------------------------------------------------------------------------------------------