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.

630 lines
18KB

  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. ifneq (,$(filter riscv64%,$(TARGET_PROCESSOR)))
  75. CPU_RISCV64 = true
  76. endif
  77. # ---------------------------------------------------------------------------------------------------------------------
  78. # Set PKG_CONFIG (can be overridden by environment variable)
  79. ifeq ($(WASM),true)
  80. # Skip on wasm by default
  81. PKG_CONFIG ?= false
  82. else ifeq ($(WINDOWS),true)
  83. # Build statically on Windows by default
  84. PKG_CONFIG ?= pkg-config --static
  85. else
  86. PKG_CONFIG ?= pkg-config
  87. endif
  88. # ---------------------------------------------------------------------------------------------------------------------
  89. # Set cross compiling flag
  90. ifeq ($(WASM),true)
  91. CROSS_COMPILING = true
  92. endif
  93. # ---------------------------------------------------------------------------------------------------------------------
  94. # Set LINUX_OR_MACOS
  95. ifeq ($(LINUX),true)
  96. LINUX_OR_MACOS = true
  97. endif
  98. ifeq ($(MACOS),true)
  99. LINUX_OR_MACOS = true
  100. endif
  101. # ---------------------------------------------------------------------------------------------------------------------
  102. # Set HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS, HAIKU_OR_MACOS_OR_WINDOWS, MACOS_OR_WASM_OR_WINDOWS and MACOS_OR_WINDOWS
  103. ifeq ($(HAIKU),true)
  104. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  105. HAIKU_OR_MACOS_OR_WINDOWS = true
  106. endif
  107. ifeq ($(MACOS),true)
  108. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  109. HAIKU_OR_MACOS_OR_WINDOWS = true
  110. MACOS_OR_WASM_OR_WINDOWS = true
  111. MACOS_OR_WINDOWS = true
  112. endif
  113. ifeq ($(WASM),true)
  114. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  115. MACOS_OR_WASM_OR_WINDOWS = true
  116. endif
  117. ifeq ($(WINDOWS),true)
  118. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  119. HAIKU_OR_MACOS_OR_WINDOWS = true
  120. MACOS_OR_WASM_OR_WINDOWS = true
  121. MACOS_OR_WINDOWS = true
  122. endif
  123. # ---------------------------------------------------------------------------------------------------------------------
  124. # Set UNIX
  125. ifeq ($(BSD),true)
  126. UNIX = true
  127. endif
  128. ifeq ($(HURD),true)
  129. UNIX = true
  130. endif
  131. ifeq ($(LINUX),true)
  132. UNIX = true
  133. endif
  134. ifeq ($(MACOS),true)
  135. UNIX = true
  136. endif
  137. # ---------------------------------------------------------------------------------------------------------------------
  138. # Check for optional libs (required by backend or bridges)
  139. ifeq ($(LINUX),true)
  140. HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true)
  141. HAVE_HYLIA = true
  142. else ifeq ($(MACOS),true)
  143. HAVE_HYLIA = true
  144. else ifeq ($(WINDOWS),true)
  145. HAVE_HYLIA = true
  146. endif
  147. ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  148. HAVE_DGL = true
  149. HAVE_YSFXGUI = true
  150. else
  151. HAVE_DBUS = $(shell $(PKG_CONFIG) --exists dbus-1 && echo true)
  152. HAVE_DGL = $(shell $(PKG_CONFIG) --exists gl x11 xcursor xext xrandr && echo true)
  153. HAVE_YSFXGUI = $(shell $(PKG_CONFIG) --exists freetype2 fontconfig gl x11 && echo true)
  154. HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
  155. HAVE_XCURSOR = $(shell $(PKG_CONFIG) --exists xcursor && echo true)
  156. HAVE_XEXT = $(shell $(PKG_CONFIG) --exists xext && echo true)
  157. HAVE_XRANDR = $(shell $(PKG_CONFIG) --exists xrandr && echo true)
  158. endif
  159. # FIXME update to DGL with wasm compat
  160. ifeq ($(WASM),true)
  161. HAVE_DGL = false
  162. endif
  163. # NOTE opt-out rather than opt-in
  164. HAVE_YSFX = true
  165. # NOTE not yet implemented, disabled for now
  166. HAVE_YSFXGUI = false
  167. ifeq ($(UNIX),true)
  168. ifneq ($(MACOS),true)
  169. HAVE_PULSEAUDIO = $(shell $(PKG_CONFIG) --exists libpulse-simple && echo true)
  170. endif
  171. endif
  172. # ffmpeg values taken from https://ffmpeg.org/download.html (v2.8.15 maximum)
  173. HAVE_FFMPEG = $(shell $(PKG_CONFIG) --max-version=56.60.100 libavcodec && \
  174. $(PKG_CONFIG) --max-version=56.40.101 libavformat && \
  175. $(PKG_CONFIG) --max-version=54.31.100 libavutil && echo true)
  176. HAVE_FLUIDSYNTH = $(shell $(PKG_CONFIG) --atleast-version=1.1.7 fluidsynth && echo true)
  177. HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
  178. HAVE_QT4 = $(shell $(PKG_CONFIG) --exists QtCore QtGui && echo true)
  179. HAVE_QT5 = $(shell $(PKG_CONFIG) --exists Qt5Core Qt5Gui Qt5Widgets && \
  180. $(PKG_CONFIG) --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
  181. HAVE_QT5PKG = $(shell $(PKG_CONFIG) --silence-errors --variable=prefix Qt5OpenGLExtensions 1>/dev/null && echo true)
  182. HAVE_QT5BREW = $(shell test -e /usr/local/opt/qt5/bin/uic && echo true)
  183. HAVE_SNDFILE = $(shell $(PKG_CONFIG) --exists sndfile && echo true)
  184. ifeq ($(HAVE_FLUIDSYNTH),true)
  185. HAVE_FLUIDSYNTH_INSTPATCH = $(shell $(PKG_CONFIG) --atleast-version=2.1.0 fluidsynth && \
  186. $(PKG_CONFIG) --atleast-version=1.1.4 libinstpatch-1.0 && echo true)
  187. endif
  188. ifeq ($(JACKBRIDGE_DIRECT),true)
  189. HAVE_JACK = $(shell $(PKG_CONFIG) --exists jack && echo true)
  190. HAVE_JACKLIB = $(HAVE_JACK)
  191. else ifeq ($(WASM),true)
  192. HAVE_JACK = false
  193. HAVE_JACKLIB = false
  194. else
  195. HAVE_JACK = true
  196. HAVE_JACKLIB = false
  197. endif
  198. ifeq ($(WASM),true)
  199. HAVE_SDL1 = false
  200. HAVE_SDL2 = true
  201. else
  202. HAVE_SDL1 = $(shell $(PKG_CONFIG) --exists sdl && echo true)
  203. HAVE_SDL2 = $(shell $(PKG_CONFIG) --exists sdl2 && echo true)
  204. endif
  205. # ---------------------------------------------------------------------------------------------------------------------
  206. # Check for optional libs (special non-pkgconfig tests)
  207. ifneq ($(WASM),true)
  208. ifneq ($(WINDOWS),true)
  209. ifeq ($(shell $(PKG_CONFIG) --exists libmagic && echo true),true)
  210. HAVE_LIBMAGIC = true
  211. HAVE_LIBMAGICPKG = true
  212. else
  213. # old libmagic versions don't have a pkg-config file, so we need to call the compiler to test it
  214. CFLAGS_WITHOUT_ARCH = $(subst -arch arm64,,$(CFLAGS))
  215. HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS_WITHOUT_ARCH) -x c -w -c - -o /dev/null 2>/dev/null && echo true)
  216. endif
  217. endif
  218. endif
  219. # ---------------------------------------------------------------------------------------------------------------------
  220. # Set Qt tools
  221. ifeq ($(HAVE_QT4),true)
  222. MOC_QT4 ?= $(shell $(PKG_CONFIG) --variable=moc_location QtCore)
  223. RCC_QT4 ?= $(shell $(PKG_CONFIG) --variable=rcc_location QtCore)
  224. ifeq (,$(wildcard $(MOC_QT4)))
  225. HAVE_QT4 = false
  226. endif
  227. ifeq (,$(wildcard $(RCC_QT4)))
  228. HAVE_QT4 = false
  229. endif
  230. endif
  231. ifeq ($(HAVE_QT5),true)
  232. QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=host_bins Qt5Core)
  233. else ifeq ($(HAVE_QT5PKG),true)
  234. QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=prefix Qt5OpenGLExtensions)/bin
  235. else ifeq ($(HAVE_QT5BREW),true)
  236. QT5_HOSTBINS = /usr/local/opt/qt5/bin
  237. endif
  238. MOC_QT5 ?= $(QT5_HOSTBINS)/moc
  239. RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
  240. UIC_QT5 ?= $(QT5_HOSTBINS)/uic
  241. ifeq (,$(wildcard $(MOC_QT5)))
  242. HAVE_QT5 = false
  243. endif
  244. ifeq (,$(wildcard $(RCC_QT5)))
  245. HAVE_QT5 = false
  246. endif
  247. ifeq (,$(wildcard $(UIC_QT5)))
  248. HAVE_QT5 = false
  249. endif
  250. ifeq ($(HAVE_QT4),true)
  251. HAVE_QT = true
  252. else ifeq ($(HAVE_QT5),true)
  253. HAVE_QT = true
  254. # FIXME
  255. else ifeq ($(WINDOWS),true)
  256. HAVE_QT = true
  257. endif
  258. ifneq (,$(findstring true,$(HAVE_QT5)$(HAVE_QT5PKG)$(HAVE_QT5BREW)))
  259. HAVE_THEME = true
  260. endif
  261. # ---------------------------------------------------------------------------------------------------------------------
  262. # Set PyQt tools
  263. PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
  264. PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
  265. ifneq ($(PYUIC5),)
  266. ifneq ($(PYRCC5),)
  267. HAVE_PYQT = true
  268. ifneq (,$(findstring true,$(HAVE_QT5)$(HAVE_QT5PKG)$(HAVE_QT5BREW)))
  269. HAVE_FRONTEND = true
  270. endif
  271. endif
  272. endif
  273. # ---------------------------------------------------------------------------------------------------------------------
  274. # Set PyQt tools, part2
  275. PYRCC ?= $(PYRCC5)
  276. PYUIC ?= $(PYUIC5)
  277. # ---------------------------------------------------------------------------------------------------------------------
  278. # Set USING_RTAUDIO
  279. ifneq ($(HAIKU),true)
  280. ifneq ($(WASM),true)
  281. USING_RTAUDIO = true
  282. endif
  283. endif
  284. # ---------------------------------------------------------------------------------------------------------------------
  285. # Disable features for static plugin target
  286. ifeq ($(STATIC_PLUGIN_TARGET),true)
  287. HAVE_ALSA = false
  288. HAVE_JACK = false
  289. HAVE_JACKLIB = false
  290. HAVE_FRONTEND = false
  291. HAVE_HYLIA = false
  292. HAVE_LIBLO = false
  293. HAVE_PULSEAUDIO = false
  294. HAVE_PYQT = false
  295. HAVE_QT4 = false
  296. HAVE_QT5 = false
  297. HAVE_QT5PKG = false
  298. HAVE_QT5BREW = false
  299. HAVE_SDL = false
  300. HAVE_SDL1 = false
  301. HAVE_SDL2 = false
  302. USING_RTAUDIO = false
  303. endif
  304. # ---------------------------------------------------------------------------------------------------------------------
  305. # Set libs stuff (part 1)
  306. ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
  307. LIBDL_LIBS = -ldl
  308. endif
  309. ifeq ($(HAVE_LIBLO),true)
  310. LIBLO_FLAGS = $(shell $(PKG_CONFIG) --cflags liblo)
  311. LIBLO_LIBS = $(shell $(PKG_CONFIG) --libs liblo)
  312. endif
  313. ifeq ($(HAVE_FFMPEG),true)
  314. FFMPEG_FLAGS = $(shell $(PKG_CONFIG) --cflags libavcodec libavformat libavutil)
  315. FFMPEG_LIBS = $(shell $(PKG_CONFIG) --libs libavcodec libavformat libavutil)
  316. endif
  317. ifeq ($(HAVE_FLUIDSYNTH),true)
  318. FLUIDSYNTH_FLAGS = $(shell $(PKG_CONFIG) --cflags fluidsynth)
  319. FLUIDSYNTH_LIBS = $(shell $(PKG_CONFIG) --libs fluidsynth)
  320. endif
  321. ifeq ($(HAVE_JACKLIB),true)
  322. JACK_FLAGS = $(shell $(PKG_CONFIG) --cflags jack)
  323. JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack)
  324. JACK_LIBDIR = $(shell $(PKG_CONFIG) --variable=libdir jack)/jack
  325. endif
  326. ifeq ($(HAVE_QT5),true)
  327. QT5_FLAGS = $(shell $(PKG_CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets)
  328. QT5_LIBS = $(shell $(PKG_CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets)
  329. endif
  330. ifeq ($(WASM),true)
  331. HAVE_SDL = true
  332. SDL_FLAGS = -sUSE_SDL=2
  333. SDL_LIBS = -sUSE_SDL=2
  334. else ifeq ($(HAVE_SDL2),true)
  335. HAVE_SDL = true
  336. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl2)
  337. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl2)
  338. else ifeq ($(HAVE_SDL1),true)
  339. HAVE_SDL = true
  340. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl)
  341. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl)
  342. endif
  343. ifeq ($(HAVE_SNDFILE),true)
  344. SNDFILE_FLAGS = $(shell $(PKG_CONFIG) --cflags sndfile)
  345. SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile)
  346. endif
  347. # ifeq ($(HAVE_YSFXGUI),true)
  348. # ifeq ($(MACOS),true)
  349. # YSFX_LIBS = -framework Cocoa -framework Carbon -framework Metal -framework Foundation
  350. # else ifeq ($(WASM),true)
  351. # # TODO
  352. # YSFX_LIBS =
  353. # else
  354. # YSFX_FLAGS = $(shell $(PKG_CONFIG) --cflags freetype2 fontconfig)
  355. # YSFX_LIBS = $(shell $(PKG_CONFIG) --libs freetype2 fontconfig gl x11)
  356. # endif
  357. # endif
  358. ifeq ($(HAVE_X11),true)
  359. X11_FLAGS = $(shell $(PKG_CONFIG) --cflags x11)
  360. X11_LIBS = $(shell $(PKG_CONFIG) --libs x11)
  361. endif
  362. # ---------------------------------------------------------------------------------------------------------------------
  363. # Set libs stuff (dgl)
  364. ifeq ($(HAVE_DGL),true)
  365. DGL_FLAGS = -DHAVE_OPENGL -DDGL_OPENGL -DHAVE_DGL
  366. ifeq ($(HAIKU),true)
  367. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags gl)
  368. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl) -lbe
  369. else ifeq ($(MACOS),true)
  370. DGL_FLAGS += -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
  371. DGL_LIBS = -framework OpenGL -framework Cocoa -framework CoreVideo
  372. else ifeq ($(WASM),true)
  373. ifneq ($(USE_GLES2)$(USE_GLES3),true)
  374. DGL_LIBS = -sLEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
  375. endif
  376. else ifeq ($(WINDOWS),true)
  377. DGL_LIBS = -lcomdlg32 -ldwmapi -lopengl32 -lgdi32
  378. else
  379. DGL_FLAGS += -DHAVE_X11 -DHAVE_XCURSOR -DHAVE_XEXT -DHAVE_XSYNC -DHAVE_XRANDR
  380. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags gl x11 xcursor xext xrandr)
  381. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11 xcursor xext xrandr)
  382. ifeq ($(HAVE_DBUS)$(STATIC_PLUGIN_TARGET)$(USING_CUSTOM_DPF),truetruetrue)
  383. DGL_FLAGS += -DHAVE_DBUS
  384. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags dbus-1)
  385. DGL_LIBS += $(shell $(PKG_CONFIG) --libs dbus-1)
  386. endif
  387. endif
  388. endif
  389. # ---------------------------------------------------------------------------------------------------------------------
  390. # Set libs stuff (libmagic)
  391. ifeq ($(HAVE_LIBMAGICPKG),true)
  392. MAGIC_FLAGS = $(shell $(PKG_CONFIG) --cflags libmagic)
  393. # this is missing in upstream pkg-config
  394. MAGIC_FLAGS += -I$(shell $(PKG_CONFIG) --variable=includedir libmagic)
  395. MAGIC_LIBS = $(shell $(PKG_CONFIG) --libs libmagic)
  396. else ifeq ($(HAVE_LIBMAGIC),true)
  397. MAGIC_LIBS += -lmagic
  398. ifeq ($(LINUX_OR_MACOS),true)
  399. MAGIC_LIBS += -lz
  400. endif
  401. endif
  402. # ---------------------------------------------------------------------------------------------------------------------
  403. # Set libs stuff (rtaudio)
  404. ifeq ($(USING_RTAUDIO),true)
  405. RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
  406. RTMIDI_FLAGS =
  407. ifeq ($(DEBUG),true)
  408. RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
  409. RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
  410. endif
  411. ifeq ($(HAVE_ALSA),true)
  412. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  413. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs alsa) -pthread
  414. RTMIDI_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  415. RTMIDI_LIBS += $(shell $(PKG_CONFIG) --libs alsa)
  416. endif
  417. ifeq ($(HAVE_JACK),true)
  418. ifeq ($(UNIX),true)
  419. RTAUDIO_FLAGS += -D__UNIX_JACK__
  420. endif
  421. endif
  422. ifeq ($(HAVE_PULSEAUDIO),true)
  423. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags libpulse-simple) -D__UNIX_PULSE__
  424. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs libpulse-simple)
  425. endif
  426. ifeq ($(MACOS),true)
  427. RTAUDIO_FLAGS += -D__MACOSX_CORE__
  428. RTAUDIO_LIBS += -framework CoreAudio
  429. RTMIDI_FLAGS += -D__MACOSX_CORE__
  430. RTMIDI_LIBS += -framework CoreMIDI
  431. else ifeq ($(WINDOWS),true)
  432. RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
  433. RTAUDIO_LIBS += -ldsound -luuid -lksuser
  434. RTMIDI_FLAGS += -D__WINDOWS_MM__
  435. RTMIDI_LIBS += -lwinmm
  436. endif
  437. endif
  438. # ---------------------------------------------------------------------------------------------------------------------
  439. # Set libs stuff (extra)
  440. ifeq ($(BSD),true)
  441. HYLIA_FLAGS =
  442. HYLIA_LIBS =
  443. JACKBRIDGE_LIBS = -pthread -lrt
  444. LILV_LIBS = -lm -lrt
  445. RTMEMPOOL_LIBS = -pthread
  446. WATER_LIBS = -pthread -lrt
  447. else ifeq ($(HAIKU),true)
  448. HYLIA_FLAGS =
  449. HYLIA_LIBS =
  450. JACKBRIDGE_LIBS = -lpthread
  451. LILV_LIBS = -lm
  452. RTMEMPOOL_LIBS = -lpthread
  453. WATER_LIBS = -lpthread
  454. else ifeq ($(HURD),true)
  455. HYLIA_FLAGS =
  456. HYLIA_LIBS =
  457. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  458. LILV_LIBS = -ldl -lm -lrt
  459. RTMEMPOOL_LIBS = -pthread -lrt
  460. WATER_LIBS = -ldl -pthread -lrt
  461. else ifeq ($(LINUX),true)
  462. HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
  463. HYLIA_LIBS =
  464. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  465. LILV_LIBS = -ldl -lm -lrt
  466. RTMEMPOOL_LIBS = -pthread -lrt
  467. WATER_LIBS = -ldl -pthread -lrt
  468. else ifeq ($(MACOS),true)
  469. HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
  470. HYLIA_LIBS =
  471. JACKBRIDGE_LIBS = -pthread
  472. LILV_LIBS = -lm
  473. RTMEMPOOL_LIBS = -pthread
  474. WATER_LIBS = -pthread -framework AppKit
  475. else ifeq ($(WASM),true)
  476. HYLIA_FLAGS =
  477. HYLIA_LIBS =
  478. JACKBRIDGE_LIBS =
  479. LILV_LIBS = -ldl -lm
  480. RTMEMPOOL_LIBS =
  481. WATER_LIBS =
  482. else ifeq ($(WINDOWS),true)
  483. HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
  484. HYLIA_LIBS = -liphlpapi
  485. JACKBRIDGE_LIBS = -pthread
  486. LILV_LIBS = -lm
  487. RTMEMPOOL_LIBS = -pthread
  488. WATER_LIBS = -pthread -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  489. endif
  490. # ---------------------------------------------------------------------------------------------------------------------
  491. AUDIO_DECODER_LIBS = $(FFMPEG_LIBS)
  492. AUDIO_DECODER_LIBS += $(SNDFILE_LIBS)
  493. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  494. NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
  495. NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
  496. STATIC_CARLA_PLUGIN_LIBS = $(AUDIO_DECODER_LIBS)
  497. STATIC_CARLA_PLUGIN_LIBS += $(NATIVE_PLUGINS_LIBS)
  498. STATIC_CARLA_PLUGIN_LIBS += $(FLUIDSYNTH_LIBS)
  499. STATIC_CARLA_PLUGIN_LIBS += $(HYLIA_LIBS)
  500. STATIC_CARLA_PLUGIN_LIBS += $(LIBLO_LIBS)
  501. STATIC_CARLA_PLUGIN_LIBS += $(LILV_LIBS)
  502. STATIC_CARLA_PLUGIN_LIBS += $(MAGIC_LIBS)
  503. STATIC_CARLA_PLUGIN_LIBS += $(RTMEMPOOL_LIBS)
  504. STATIC_CARLA_PLUGIN_LIBS += $(WATER_LIBS)
  505. STATIC_CARLA_PLUGIN_LIBS += $(YSFX_LIBS)
  506. ifeq ($(EXTERNAL_PLUGINS),true)
  507. ifneq ($(DEBUG),true)
  508. ifneq ($(TESTBUILD),true)
  509. ifeq ($(shell $(PKG_CONFIG) --exists liblo fftw3 mxml zlib && echo true),true)
  510. STATIC_CARLA_PLUGIN_LIBS += $(filter-out -lpthread,$(shell $(PKG_CONFIG) --libs liblo fftw3 mxml zlib))
  511. ifneq ($(WASM),true)
  512. STATIC_CARLA_PLUGIN_LIBS += -pthread
  513. endif
  514. endif
  515. endif
  516. endif
  517. endif
  518. # ---------------------------------------------------------------------------------------------------------------------