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.

331 lines
9.8KB

  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. ifeq ($(USING_JUCE_AUDIO_DEVICES),true)
  143. LIBS += $(MODULEDIR)/juce_audio_devices.a
  144. endif
  145. LIBS += $(MODULEDIR)/juce_audio_processors.a
  146. LIBS += $(MODULEDIR)/juce_core.a
  147. LIBS += $(MODULEDIR)/juce_data_structures.a
  148. LIBS += $(MODULEDIR)/juce_events.a
  149. LIBS += $(MODULEDIR)/juce_graphics.a
  150. LIBS += $(MODULEDIR)/juce_gui_basics.a
  151. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  152. LIBS += $(MODULEDIR)/juce_gui_extra.a
  153. endif
  154. endif
  155. ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
  156. LIBS += $(MODULEDIR)/rtaudio.a
  157. LIBS += $(MODULEDIR)/rtmidi.a
  158. endif
  159. # ---------------------------------------------------------------------------------------------------------------------
  160. LINK_FLAGS += $(QT5_LIBS)
  161. LINK_FLAGS += $(HYLIA_LIBS)
  162. LINK_FLAGS += $(JACKBRIDGE_LIBS)
  163. LINK_FLAGS += $(LILV_LIBS)
  164. LINK_FLAGS += $(NATIVE_PLUGINS_LIBS)
  165. LINK_FLAGS += $(RTMEMPOOL_LIBS)
  166. LINK_FLAGS += $(WATER_LIBS)
  167. LINK_FLAGS += $(LIBLO_LIBS)
  168. LINK_FLAGS += $(MAGIC_LIBS)
  169. LINK_FLAGS += $(FLUIDSYNTH_LIBS)
  170. LINK_FLAGS += $(X11_LIBS)
  171. ifeq ($(USING_JUCE),true)
  172. LINK_FLAGS += $(JUCE_AUDIO_BASICS_LIBS)
  173. ifeq ($(USING_JUCE_AUDIO_DEVICES),true)
  174. LINK_FLAGS += $(JUCE_AUDIO_DEVICES_LIBS)
  175. endif
  176. LINK_FLAGS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  177. LINK_FLAGS += $(JUCE_CORE_LIBS)
  178. LINK_FLAGS += $(JUCE_DATA_STRUCTURES_LIBS)
  179. LINK_FLAGS += $(JUCE_EVENTS_LIBS)
  180. LINK_FLAGS += $(JUCE_GRAPHICS_LIBS)
  181. LINK_FLAGS += $(JUCE_GUI_BASICS_LIBS)
  182. ifeq ($(USING_JUCE_GUI_EXTRA),true)
  183. LINK_FLAGS += $(JUCE_GUI_EXTRA_LIBS)
  184. endif
  185. endif
  186. ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
  187. LINK_FLAGS += $(RTAUDIO_LIBS)
  188. LINK_FLAGS += $(RTMIDI_LIBS)
  189. endif
  190. ifeq ($(JACKBRIDGE_DIRECT),true)
  191. LINK_FLAGS += $(JACK_LIBS)
  192. endif
  193. # ---------------------------------------------------------------------------------------------------------------------
  194. OBJS = \
  195. $(OBJDIR)/carla_app.cpp.o \
  196. $(OBJDIR)/carla_database.cpp.o \
  197. $(OBJDIR)/carla_host.cpp.o \
  198. $(OBJDIR)/carla_settings.cpp.o \
  199. $(OBJDIR)/carla_skin.cpp.o \
  200. $(OBJDIR)/carla_shared.cpp.o \
  201. $(OBJDIR)/carla_widgets.cpp.o \
  202. $(OBJDIR)/patchcanvas/theme.cpp.o \
  203. $(OBJDIR)/moc_carla_database.cpp.o \
  204. $(OBJDIR)/moc_carla_host.cpp.o \
  205. $(OBJDIR)/moc_carla_settings.cpp.o \
  206. $(OBJDIR)/moc_carla_widgets.cpp.o \
  207. $(OBJDIR)/resources_rc.cpp.o \
  208. $(OBJDIR)/CarlaStandalone.cpp.o \
  209. $(OBJDIR)/CarlaStandaloneNSM.cpp.o \
  210. $(OBJDIR)/Information.cpp.o
  211. # ---------------------------------------------------------------------------------------------------------------------
  212. TARGETS = $(RES) $(UIs)
  213. ifeq ($(CPPMODE),true)
  214. TARGETS += $(BINDIR)/carla
  215. TARGETS += $(BINDIR)/carla-database
  216. TARGETS += $(BINDIR)/carla-settings
  217. endif
  218. # ---------------------------------------------------------------------------------------------------------------------
  219. all: $(TARGETS)
  220. # ---------------------------------------------------------------------------------------------------------------------
  221. $(BINDIR)/carla: $(OBJS) $(OBJDIR)/carla.cpp.o
  222. -@mkdir -p $(BINDIR)
  223. @echo "Linking carla"
  224. $(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  225. $(BINDIR)/carla-%: $(OBJS) $(OBJDIR)/carla_%_app.cpp.o
  226. -@mkdir -p $(BINDIR)
  227. @echo "Linking carla_$*"
  228. $(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(LINK_FLAGS) -o $@
  229. # ---------------------------------------------------------------------------------------------------------------------
  230. moc_%.cpp: %.hpp
  231. $(MOC_QT5) $< -o $@
  232. ui_%.hpp: $(RESDIR)/ui/%.ui
  233. $(UIC_QT5) $< -o $@
  234. ui_%.py: $(RESDIR)/ui/%.ui
  235. $(PYUIC) $< -o $@
  236. resources_rc.cpp: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
  237. $(RCC_QT5) $< -o $@
  238. resources_rc.py: $(RESDIR)/resources.qrc $(RESDIR)/*/*.png $(RESDIR)/*/*.svg $(RESDIR)/*/*.svgz
  239. $(PYRCC) $< -o $@
  240. $(BINDIR)/resources/%: %
  241. -@mkdir -p $(BINDIR)/resources
  242. $(LINK) $(CURDIR)/$* $(BINDIR)/resources/
  243. $(BINDIR)/resources/zynaddsubfx: ../native-plugins/resources/zynaddsubfx
  244. -@mkdir -p $(BINDIR)/resources
  245. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  246. $(BINDIR)/resources/zynaddsubfx-ui: ../native-plugins/resources/zynaddsubfx-ui
  247. -@mkdir -p $(BINDIR)/resources
  248. $(LINK) $(CURDIR)/$< $(BINDIR)/resources/
  249. # ---------------------------------------------------------------------------------------------------------------------
  250. $(OBJDIR)/%.cpp.o: %.cpp $(UIs)
  251. -@mkdir -p $(OBJDIR)/patchcanvas
  252. @echo "Compiling $<"
  253. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  254. $(OBJDIR)/Information.cpp.o: $(CWD)/backend/utils/Information.cpp
  255. -@mkdir -p $(OBJDIR)
  256. @echo "Compiling $<"
  257. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  258. $(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp
  259. -@mkdir -p $(OBJDIR)
  260. @echo "Compiling $<"
  261. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  262. $(OBJDIR)/CarlaStandaloneNSM.cpp.o: $(CWD)/backend/CarlaStandaloneNSM.cpp
  263. -@mkdir -p $(OBJDIR)
  264. @echo "Compiling $<"
  265. $(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@
  266. # ---------------------------------------------------------------------------------------------------------------------
  267. clean:
  268. rm -rf $(UIs) $(RES) __pycache__ *.pyc
  269. debug:
  270. $(MAKE) DEBUG=true
  271. # ---------------------------------------------------------------------------------------------------------------------
  272. -include $(OBJS:%.o=%.d)
  273. -include $(OBJDIR)/carla.cpp.d
  274. -include $(OBJDIR)/carla_database_app.cpp.d
  275. -include $(OBJDIR)/carla_settings_app.cpp.d
  276. # ---------------------------------------------------------------------------------------------------------------------