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.deps.mk 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. #!/usr/bin/make -f
  2. # Makefile for Carla C++ code #
  3. # --------------------------- #
  4. # Created by falkTX
  5. #
  6. # ---------------------------------------------------------------------------------------------------------------------
  7. # Base environment vars
  8. AR ?= ar
  9. CC ?= gcc
  10. CXX ?= g++
  11. # ---------------------------------------------------------------------------------------------------------------------
  12. # Auto-detect OS if not defined
  13. TARGET_MACHINE := $(shell $(CC) -dumpmachine)
  14. ifneq ($(BSD),true)
  15. ifneq ($(HAIKU),true)
  16. ifneq ($(HURD),true)
  17. ifneq ($(LINUX),true)
  18. ifneq ($(MACOS),true)
  19. ifneq ($(WASM),true)
  20. ifneq ($(WINDOWS),true)
  21. ifneq (,$(findstring bsd,$(TARGET_MACHINE)))
  22. BSD = true
  23. else ifneq (,$(findstring haiku,$(TARGET_MACHINE)))
  24. HAIKU = true
  25. else ifneq (,$(findstring linux,$(TARGET_MACHINE)))
  26. LINUX = true
  27. else ifneq (,$(findstring gnu,$(TARGET_MACHINE)))
  28. HURD = true
  29. else ifneq (,$(findstring apple,$(TARGET_MACHINE)))
  30. MACOS = true
  31. else ifneq (,$(findstring mingw,$(TARGET_MACHINE)))
  32. WINDOWS = true
  33. else ifneq (,$(findstring msys,$(TARGET_MACHINE)))
  34. WINDOWS = true
  35. else ifneq (,$(findstring wasm,$(TARGET_MACHINE)))
  36. WASM = true
  37. else ifneq (,$(findstring windows,$(TARGET_MACHINE)))
  38. WINDOWS = true
  39. endif
  40. endif # WINDOWS
  41. endif # WASM
  42. endif # MACOS
  43. endif # LINUX
  44. endif # HURD
  45. endif # HAIKU
  46. endif # BSD
  47. # ---------------------------------------------------------------------------------------------------------------------
  48. # Auto-detect the processor
  49. TARGET_PROCESSOR := $(firstword $(subst -, ,$(TARGET_MACHINE)))
  50. ifneq (,$(filter i%86,$(TARGET_PROCESSOR)))
  51. CPU_I386 = true
  52. CPU_I386_OR_X86_64 = true
  53. endif
  54. ifneq (,$(filter wasm32,$(TARGET_PROCESSOR)))
  55. CPU_I386 = true
  56. CPU_I386_OR_X86_64 = true
  57. endif
  58. ifneq (,$(filter x86_64,$(TARGET_PROCESSOR)))
  59. CPU_X86_64 = true
  60. CPU_I386_OR_X86_64 = true
  61. endif
  62. ifneq (,$(filter arm%,$(TARGET_PROCESSOR)))
  63. CPU_ARM = true
  64. CPU_ARM_OR_AARCH64 = true
  65. endif
  66. ifneq (,$(filter arm64%,$(TARGET_PROCESSOR)))
  67. CPU_ARM64 = true
  68. CPU_ARM_OR_AARCH64 = true
  69. endif
  70. ifneq (,$(filter aarch64%,$(TARGET_PROCESSOR)))
  71. CPU_AARCH64 = true
  72. CPU_ARM_OR_AARCH64 = true
  73. endif
  74. # ---------------------------------------------------------------------------------------------------------------------
  75. # Set PKG_CONFIG (can be overridden by environment variable)
  76. ifeq ($(WASM),true)
  77. # Skip on wasm by default
  78. PKG_CONFIG ?= false
  79. else ifeq ($(WINDOWS),true)
  80. # Build statically on Windows by default
  81. PKG_CONFIG ?= pkg-config --static
  82. else
  83. PKG_CONFIG ?= pkg-config
  84. endif
  85. # ---------------------------------------------------------------------------------------------------------------------
  86. # Set cross compiling flag
  87. ifeq ($(WASM),true)
  88. CROSS_COMPILING = true
  89. endif
  90. # ---------------------------------------------------------------------------------------------------------------------
  91. # Set LINUX_OR_MACOS
  92. ifeq ($(LINUX),true)
  93. LINUX_OR_MACOS = true
  94. endif
  95. ifeq ($(MACOS),true)
  96. LINUX_OR_MACOS = true
  97. endif
  98. # ---------------------------------------------------------------------------------------------------------------------
  99. # Set HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS, HAIKU_OR_MACOS_OR_WINDOWS, MACOS_OR_WASM_OR_WINDOWS and MACOS_OR_WINDOWS
  100. ifeq ($(HAIKU),true)
  101. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  102. HAIKU_OR_MACOS_OR_WINDOWS = true
  103. endif
  104. ifeq ($(MACOS),true)
  105. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  106. HAIKU_OR_MACOS_OR_WINDOWS = true
  107. MACOS_OR_WASM_OR_WINDOWS = true
  108. MACOS_OR_WINDOWS = true
  109. endif
  110. ifeq ($(WASM),true)
  111. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  112. MACOS_OR_WASM_OR_WINDOWS = true
  113. endif
  114. ifeq ($(WINDOWS),true)
  115. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  116. HAIKU_OR_MACOS_OR_WINDOWS = true
  117. MACOS_OR_WASM_OR_WINDOWS = true
  118. MACOS_OR_WINDOWS = true
  119. endif
  120. # ---------------------------------------------------------------------------------------------------------------------
  121. # Set UNIX
  122. ifeq ($(BSD),true)
  123. UNIX = true
  124. endif
  125. ifeq ($(HURD),true)
  126. UNIX = true
  127. endif
  128. ifeq ($(LINUX),true)
  129. UNIX = true
  130. endif
  131. ifeq ($(MACOS),true)
  132. UNIX = true
  133. endif
  134. # ---------------------------------------------------------------------------------------------------------------------
  135. # Check for optional libs (required by backend or bridges)
  136. ifeq ($(LINUX),true)
  137. HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true)
  138. HAVE_HYLIA = true
  139. else ifeq ($(MACOS),true)
  140. HAVE_HYLIA = true
  141. else ifeq ($(WINDOWS),true)
  142. HAVE_HYLIA = true
  143. endif
  144. ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  145. HAVE_DGL = true
  146. HAVE_YSFXGUI = true
  147. else
  148. HAVE_DGL = $(shell $(PKG_CONFIG) --exists gl x11 && echo true)
  149. HAVE_YSFXGUI = $(shell $(PKG_CONFIG) --exists freetype2 fontconfig gl x11 && echo true)
  150. HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
  151. endif
  152. # FIXME update to DGL with wasm compat
  153. ifeq ($(WASM),true)
  154. HAVE_DGL = false
  155. endif
  156. # NOTE not yet implemented, disabled for now
  157. HAVE_YSFXGUI = false
  158. ifeq ($(UNIX),true)
  159. ifneq ($(MACOS),true)
  160. HAVE_PULSEAUDIO = $(shell $(PKG_CONFIG) --exists libpulse-simple && echo true)
  161. endif
  162. endif
  163. # ffmpeg values taken from https://ffmpeg.org/download.html (v2.8.15 maximum)
  164. HAVE_FFMPEG = $(shell $(PKG_CONFIG) --max-version=56.60.100 libavcodec && \
  165. $(PKG_CONFIG) --max-version=56.40.101 libavformat && \
  166. $(PKG_CONFIG) --max-version=54.31.100 libavutil && echo true)
  167. HAVE_FLUIDSYNTH = $(shell $(PKG_CONFIG) --atleast-version=1.1.7 fluidsynth && echo true)
  168. HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
  169. HAVE_QT4 = $(shell $(PKG_CONFIG) --exists QtCore QtGui && echo true)
  170. HAVE_QT5 = $(shell $(PKG_CONFIG) --exists Qt5Core Qt5Gui Qt5Widgets && \
  171. $(PKG_CONFIG) --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
  172. HAVE_QT5PKG = $(shell $(PKG_CONFIG) --silence-errors --variable=prefix Qt5OpenGLExtensions 1>/dev/null && echo true)
  173. HAVE_SNDFILE = $(shell $(PKG_CONFIG) --exists sndfile && echo true)
  174. ifeq ($(HAVE_FLUIDSYNTH),true)
  175. HAVE_FLUIDSYNTH_INSTPATCH = $(shell $(PKG_CONFIG) --atleast-version=2.1.0 fluidsynth && \
  176. $(PKG_CONFIG) --atleast-version=1.1.4 libinstpatch-1.0 && echo true)
  177. endif
  178. ifeq ($(JACKBRIDGE_DIRECT),true)
  179. HAVE_JACK = $(shell $(PKG_CONFIG) --exists jack && echo true)
  180. HAVE_JACKLIB = $(HAVE_JACK)
  181. else ifeq ($(WASM),true)
  182. HAVE_JACK = false
  183. HAVE_JACKLIB = false
  184. else
  185. HAVE_JACK = true
  186. HAVE_JACKLIB = false
  187. endif
  188. ifeq ($(LINUX),true)
  189. # juce only supports the most common architectures
  190. ifneq (,$(findstring arm,$(TARGET_MACHINE)))
  191. HAVE_JUCE_SUPPORTED_ARCH = true
  192. endif
  193. ifneq (,$(findstring aarch64,$(TARGET_MACHINE)))
  194. HAVE_JUCE_SUPPORTED_ARCH = true
  195. endif
  196. ifneq (,$(findstring i486,$(TARGET_MACHINE)))
  197. HAVE_JUCE_SUPPORTED_ARCH = true
  198. endif
  199. ifneq (,$(findstring i586,$(TARGET_MACHINE)))
  200. HAVE_JUCE_SUPPORTED_ARCH = true
  201. endif
  202. ifneq (,$(findstring i686,$(TARGET_MACHINE)))
  203. HAVE_JUCE_SUPPORTED_ARCH = true
  204. endif
  205. ifneq (,$(findstring x86_64,$(TARGET_MACHINE)))
  206. HAVE_JUCE_SUPPORTED_ARCH = true
  207. endif
  208. ifeq ($(HAVE_JUCE_SUPPORTED_ARCH),true)
  209. HAVE_JUCE_LINUX_DEPS = $(shell $(PKG_CONFIG) --exists x11 xcursor xext freetype2 && echo true)
  210. endif
  211. endif
  212. ifeq ($(WASM),true)
  213. HAVE_SDL1 = false
  214. HAVE_SDL2 = true
  215. else
  216. HAVE_SDL1 = $(shell $(PKG_CONFIG) --exists sdl && echo true)
  217. HAVE_SDL2 = $(shell $(PKG_CONFIG) --exists sdl2 && echo true)
  218. endif
  219. # ---------------------------------------------------------------------------------------------------------------------
  220. # Check for optional libs (special non-pkgconfig tests)
  221. ifneq ($(WASM),true)
  222. ifneq ($(WINDOWS),true)
  223. ifeq ($(shell $(PKG_CONFIG) --exists libmagic && echo true),true)
  224. HAVE_LIBMAGIC = true
  225. HAVE_LIBMAGICPKG = true
  226. else
  227. # old libmagic versions don't have a pkg-config file, so we need to call the compiler to test it
  228. CFLAGS_WITHOUT_ARCH = $(subst -arch arm64,,$(CFLAGS))
  229. HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS_WITHOUT_ARCH) -x c -w -c - -o /dev/null 2>/dev/null && echo true)
  230. endif
  231. endif
  232. endif
  233. # ---------------------------------------------------------------------------------------------------------------------
  234. # Set Qt tools
  235. ifeq ($(HAVE_QT4),true)
  236. MOC_QT4 ?= $(shell $(PKG_CONFIG) --variable=moc_location QtCore)
  237. RCC_QT4 ?= $(shell $(PKG_CONFIG) --variable=rcc_location QtCore)
  238. ifeq (,$(wildcard $(MOC_QT4)))
  239. HAVE_QT4 = false
  240. endif
  241. ifeq (,$(wildcard $(RCC_QT4)))
  242. HAVE_QT4 = false
  243. endif
  244. endif
  245. ifeq ($(HAVE_QT5),true)
  246. QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=host_bins Qt5Core)
  247. MOC_QT5 ?= $(QT5_HOSTBINS)/moc
  248. RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
  249. ifeq (,$(wildcard $(MOC_QT5)))
  250. HAVE_QT5 = false
  251. endif
  252. ifeq (,$(wildcard $(RCC_QT5)))
  253. HAVE_QT5 = false
  254. endif
  255. endif
  256. ifeq ($(HAVE_QT4),true)
  257. HAVE_QT = true
  258. endif
  259. ifeq ($(HAVE_QT5),true)
  260. HAVE_QT = true
  261. endif
  262. ifeq ($(WINDOWS),true)
  263. HAVE_QT = true
  264. endif
  265. # ---------------------------------------------------------------------------------------------------------------------
  266. # Set PyQt tools
  267. PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
  268. PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
  269. ifneq ($(PYUIC5),)
  270. ifneq ($(PYRCC5),)
  271. HAVE_PYQT = true
  272. endif
  273. endif
  274. # ---------------------------------------------------------------------------------------------------------------------
  275. # Set PyQt tools, part2
  276. PYRCC ?= $(PYRCC5)
  277. PYUIC ?= $(PYUIC5)
  278. ifeq ($(HAVE_QT5),true)
  279. HAVE_THEME = true
  280. endif
  281. # ---------------------------------------------------------------------------------------------------------------------
  282. # Set USING_JUCE
  283. ifeq ($(MACOS_OR_WINDOWS),true)
  284. USING_JUCE = true
  285. USING_JUCE_AUDIO_DEVICES = true
  286. else ifeq ($(HAVE_JUCE_LINUX_DEPS),true)
  287. USING_JUCE = true
  288. endif
  289. # ---------------------------------------------------------------------------------------------------------------------
  290. # Set USING_RTAUDIO
  291. ifneq ($(HAIKU),true)
  292. ifneq ($(WASM),true)
  293. ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
  294. USING_RTAUDIO = true
  295. endif
  296. endif
  297. endif
  298. # ---------------------------------------------------------------------------------------------------------------------
  299. # Disable features for static plugin target
  300. ifeq ($(STATIC_PLUGIN_TARGET),true)
  301. HAVE_ALSA = false
  302. HAVE_JACK = false
  303. HAVE_JACKLIB = false
  304. HAVE_HYLIA = false
  305. HAVE_LIBLO = false
  306. HAVE_PULSEAUDIO = false
  307. HAVE_PYQT = false
  308. HAVE_QT4 = false
  309. HAVE_QT5 = false
  310. HAVE_QT5PKG = false
  311. USING_JUCE = false
  312. USING_JUCE_AUDIO_DEVICES = false
  313. USING_RTAUDIO = false
  314. endif
  315. # ---------------------------------------------------------------------------------------------------------------------
  316. # Set libs stuff (part 1)
  317. ifneq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
  318. LIBDL_LIBS = -ldl
  319. endif
  320. ifeq ($(HAVE_LIBLO),true)
  321. LIBLO_FLAGS = $(shell $(PKG_CONFIG) --cflags liblo)
  322. LIBLO_LIBS = $(shell $(PKG_CONFIG) --libs liblo)
  323. endif
  324. ifeq ($(HAVE_FFMPEG),true)
  325. FFMPEG_FLAGS = $(shell $(PKG_CONFIG) --cflags libavcodec libavformat libavutil)
  326. FFMPEG_LIBS = $(shell $(PKG_CONFIG) --libs libavcodec libavformat libavutil)
  327. endif
  328. ifeq ($(HAVE_FLUIDSYNTH),true)
  329. FLUIDSYNTH_FLAGS = $(shell $(PKG_CONFIG) --cflags fluidsynth)
  330. FLUIDSYNTH_LIBS = $(shell $(PKG_CONFIG) --libs fluidsynth)
  331. endif
  332. ifeq ($(HAVE_JACKLIB),true)
  333. JACK_FLAGS = $(shell $(PKG_CONFIG) --cflags jack)
  334. JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack)
  335. JACK_LIBDIR = $(shell $(PKG_CONFIG) --variable=libdir jack)/jack
  336. endif
  337. ifeq ($(HAVE_QT5),true)
  338. QT5_FLAGS = $(shell $(PKG_CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets)
  339. QT5_LIBS = $(shell $(PKG_CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets)
  340. endif
  341. ifeq ($(WASM),true)
  342. HAVE_SDL = true
  343. SDL_FLAGS = -sUSE_SDL=2
  344. SDL_LIBS = -sUSE_SDL=2
  345. else ifeq ($(HAVE_SDL2),true)
  346. HAVE_SDL = true
  347. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl2)
  348. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl2)
  349. else ifeq ($(HAVE_SDL1),true)
  350. HAVE_SDL = true
  351. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl)
  352. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl)
  353. endif
  354. ifeq ($(HAVE_SNDFILE),true)
  355. SNDFILE_FLAGS = $(shell $(PKG_CONFIG) --cflags sndfile)
  356. SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile)
  357. endif
  358. # ifeq ($(HAVE_YSFXGUI),true)
  359. # ifeq ($(MACOS),true)
  360. # YSFX_LIBS = -framework Cocoa -framework Carbon -framework Metal -framework Foundation
  361. # else ifeq ($(WASM),true)
  362. # # TODO
  363. # YSFX_LIBS =
  364. # else
  365. # YSFX_FLAGS = $(shell $(PKG_CONFIG) --cflags freetype2 fontconfig)
  366. # YSFX_LIBS = $(shell $(PKG_CONFIG) --libs freetype2 fontconfig gl x11)
  367. # endif
  368. # endif
  369. ifeq ($(HAVE_X11),true)
  370. X11_FLAGS = $(shell $(PKG_CONFIG) --cflags x11)
  371. X11_LIBS = $(shell $(PKG_CONFIG) --libs x11)
  372. endif
  373. # ---------------------------------------------------------------------------------------------------------------------
  374. # Set libs stuff (dgl)
  375. ifeq ($(HAVE_DGL),true)
  376. ifeq ($(HAIKU),true)
  377. DGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl)
  378. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
  379. else ifeq ($(MACOS),true)
  380. DGL_FLAGS = -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
  381. DGL_LIBS = -framework OpenGL -framework Cocoa
  382. else ifeq ($(WASM),true)
  383. ifneq ($(USE_GLES2),true)
  384. ifneq ($(USE_GLES3),true)
  385. DGL_LIBS = -sLEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
  386. endif
  387. endif
  388. else ifeq ($(WINDOWS),true)
  389. DGL_LIBS = -lopengl32 -lgdi32
  390. else
  391. DGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl x11)
  392. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11)
  393. endif
  394. endif
  395. # ---------------------------------------------------------------------------------------------------------------------
  396. # Set libs stuff (libmagic)
  397. ifeq ($(HAVE_LIBMAGICPKG),true)
  398. MAGIC_FLAGS = $(shell $(PKG_CONFIG) --cflags libmagic)
  399. # this is missing in upstream pkg-config
  400. MAGIC_FLAGS += -I$(shell $(PKG_CONFIG) --variable=includedir libmagic)
  401. MAGIC_LIBS = $(shell $(PKG_CONFIG) --libs libmagic)
  402. else ifeq ($(HAVE_LIBMAGIC),true)
  403. MAGIC_LIBS += -lmagic
  404. ifeq ($(LINUX_OR_MACOS),true)
  405. MAGIC_LIBS += -lz
  406. endif
  407. endif
  408. # ---------------------------------------------------------------------------------------------------------------------
  409. # Set libs stuff (juce)
  410. ifeq ($(USING_JUCE),true)
  411. ifeq ($(LINUX),true)
  412. JUCE_AUDIO_BASICS_LIBS =
  413. JUCE_AUDIO_DEVICES_LIBS = $(shell $(PKG_CONFIG) --libs alsa)
  414. JUCE_AUDIO_FORMATS_LIBS =
  415. JUCE_AUDIO_PROCESSORS_LIBS =
  416. JUCE_CORE_LIBS = -ldl -pthread -lrt
  417. JUCE_EVENTS_LIBS =
  418. JUCE_GRAPHICS_LIBS = $(shell $(PKG_CONFIG) --libs freetype2)
  419. JUCE_GUI_BASICS_LIBS =
  420. JUCE_GUI_EXTRA_LIBS =
  421. else ifeq ($(MACOS),true)
  422. JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
  423. JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
  424. JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
  425. JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa
  426. JUCE_CORE_LIBS = -framework AppKit
  427. JUCE_EVENTS_LIBS = -framework AppKit
  428. JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
  429. JUCE_GUI_BASICS_LIBS = -framework Cocoa
  430. JUCE_GUI_EXTRA_LIBS = -framework IOKit
  431. else ifeq ($(WINDOWS),true)
  432. JUCE_AUDIO_BASICS_LIBS =
  433. JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
  434. JUCE_AUDIO_FORMATS_LIBS =
  435. JUCE_AUDIO_PROCESSORS_LIBS =
  436. JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  437. JUCE_EVENTS_LIBS = -lole32
  438. JUCE_GRAPHICS_LIBS = -lgdi32
  439. JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
  440. JUCE_GUI_EXTRA_LIBS =
  441. endif
  442. endif
  443. # ---------------------------------------------------------------------------------------------------------------------
  444. # Set libs stuff (rtaudio)
  445. ifeq ($(USING_RTAUDIO),true)
  446. RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
  447. RTMIDI_FLAGS =
  448. ifeq ($(DEBUG),true)
  449. RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
  450. RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
  451. endif
  452. ifeq ($(HAVE_ALSA),true)
  453. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  454. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs alsa) -pthread
  455. RTMIDI_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  456. RTMIDI_LIBS += $(shell $(PKG_CONFIG) --libs alsa)
  457. endif
  458. ifeq ($(HAVE_JACK),true)
  459. ifeq ($(UNIX),true)
  460. RTAUDIO_FLAGS += -D__UNIX_JACK__
  461. endif
  462. endif
  463. ifeq ($(HAVE_PULSEAUDIO),true)
  464. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags libpulse-simple) -D__UNIX_PULSE__
  465. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs libpulse-simple)
  466. endif
  467. ifeq ($(MACOS),true)
  468. RTAUDIO_FLAGS += -D__MACOSX_CORE__
  469. RTAUDIO_LIBS += -framework CoreAudio
  470. RTMIDI_FLAGS += -D__MACOSX_CORE__
  471. RTMIDI_LIBS += -framework CoreMIDI
  472. else ifeq ($(WINDOWS),true)
  473. RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
  474. RTAUDIO_LIBS += -ldsound -luuid -lksuser
  475. RTMIDI_FLAGS += -D__WINDOWS_MM__
  476. RTMIDI_LIBS += -lwinmm
  477. endif
  478. endif
  479. # ---------------------------------------------------------------------------------------------------------------------
  480. # Set libs stuff (extra)
  481. ifeq ($(BSD),true)
  482. HYLIA_FLAGS =
  483. HYLIA_LIBS =
  484. JACKBRIDGE_LIBS = -pthread -lrt
  485. LILV_LIBS = -lm -lrt
  486. RTMEMPOOL_LIBS = -pthread
  487. WATER_LIBS = -pthread -lrt
  488. else ifeq ($(HAIKU),true)
  489. HYLIA_FLAGS =
  490. HYLIA_LIBS =
  491. JACKBRIDGE_LIBS = -lpthread
  492. LILV_LIBS = -lm
  493. RTMEMPOOL_LIBS = -lpthread
  494. WATER_LIBS = -lpthread
  495. else ifeq ($(HURD),true)
  496. HYLIA_FLAGS =
  497. HYLIA_LIBS =
  498. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  499. LILV_LIBS = -ldl -lm -lrt
  500. RTMEMPOOL_LIBS = -pthread -lrt
  501. WATER_LIBS = -ldl -pthread -lrt
  502. else ifeq ($(LINUX),true)
  503. HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
  504. HYLIA_LIBS =
  505. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  506. LILV_LIBS = -ldl -lm -lrt
  507. RTMEMPOOL_LIBS = -pthread -lrt
  508. WATER_LIBS = -ldl -pthread -lrt
  509. else ifeq ($(MACOS),true)
  510. HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
  511. HYLIA_LIBS =
  512. JACKBRIDGE_LIBS = -ldl -pthread
  513. LILV_LIBS = -ldl -lm
  514. RTMEMPOOL_LIBS = -pthread
  515. WATER_LIBS = -framework AppKit
  516. else ifeq ($(WASM),true)
  517. HYLIA_FLAGS =
  518. HYLIA_LIBS =
  519. JACKBRIDGE_LIBS =
  520. LILV_LIBS =
  521. RTMEMPOOL_LIBS =
  522. WATER_LIBS =
  523. else ifeq ($(WINDOWS),true)
  524. HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
  525. HYLIA_LIBS = -liphlpapi
  526. JACKBRIDGE_LIBS = -pthread
  527. LILV_LIBS = -lm
  528. RTMEMPOOL_LIBS = -pthread
  529. WATER_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  530. endif
  531. # ---------------------------------------------------------------------------------------------------------------------
  532. AUDIO_DECODER_LIBS = $(FFMPEG_LIBS)
  533. AUDIO_DECODER_LIBS += $(SNDFILE_LIBS)
  534. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  535. NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
  536. NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
  537. STATIC_CARLA_PLUGIN_LIBS = $(AUDIO_DECODER_LIBS)
  538. STATIC_CARLA_PLUGIN_LIBS += $(NATIVE_PLUGINS_LIBS)
  539. STATIC_CARLA_PLUGIN_LIBS += $(FLUIDSYNTH_LIBS)
  540. STATIC_CARLA_PLUGIN_LIBS += $(HYLIA_LIBS)
  541. STATIC_CARLA_PLUGIN_LIBS += $(LIBLO_LIBS)
  542. STATIC_CARLA_PLUGIN_LIBS += $(LILV_LIBS)
  543. STATIC_CARLA_PLUGIN_LIBS += $(MAGIC_LIBS)
  544. STATIC_CARLA_PLUGIN_LIBS += $(RTMEMPOOL_LIBS)
  545. STATIC_CARLA_PLUGIN_LIBS += $(WATER_LIBS)
  546. STATIC_CARLA_PLUGIN_LIBS += $(YSFX_LIBS)
  547. ifeq ($(USING_JUCE),true)
  548. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_BASICS_LIBS)
  549. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_FORMATS_LIBS)
  550. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  551. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_CORE_LIBS)
  552. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_EVENTS_LIBS)
  553. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GRAPHICS_LIBS)
  554. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_BASICS_LIBS)
  555. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_EXTRA_LIBS)
  556. endif
  557. ifeq ($(EXTERNAL_PLUGINS),true)
  558. ifneq ($(DEBUG),true)
  559. ifneq ($(TESTBUILD),true)
  560. ifeq ($(shell $(PKG_CONFIG) --exists liblo fftw3 mxml zlib && echo true),true)
  561. STATIC_CARLA_PLUGIN_LIBS += $(shell $(PKG_CONFIG) --libs liblo fftw3 mxml zlib) -pthread
  562. endif
  563. endif
  564. endif
  565. endif
  566. # ---------------------------------------------------------------------------------------------------------------------