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.

693 lines
20KB

  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_DGL = $(shell $(PKG_CONFIG) --exists gl x11 && echo true)
  152. HAVE_YSFXGUI = $(shell $(PKG_CONFIG) --exists freetype2 fontconfig gl x11 && echo true)
  153. HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
  154. endif
  155. # FIXME update to DGL with wasm compat
  156. ifeq ($(WASM),true)
  157. HAVE_DGL = false
  158. endif
  159. # NOTE not yet implemented, disabled for now
  160. HAVE_YSFXGUI = false
  161. ifeq ($(UNIX),true)
  162. ifneq ($(MACOS),true)
  163. HAVE_PULSEAUDIO = $(shell $(PKG_CONFIG) --exists libpulse-simple && echo true)
  164. endif
  165. endif
  166. # ffmpeg values taken from https://ffmpeg.org/download.html (v2.8.15 maximum)
  167. HAVE_FFMPEG = $(shell $(PKG_CONFIG) --max-version=56.60.100 libavcodec && \
  168. $(PKG_CONFIG) --max-version=56.40.101 libavformat && \
  169. $(PKG_CONFIG) --max-version=54.31.100 libavutil && echo true)
  170. HAVE_FLUIDSYNTH = $(shell $(PKG_CONFIG) --atleast-version=1.1.7 fluidsynth && echo true)
  171. HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
  172. HAVE_QT4 = $(shell $(PKG_CONFIG) --exists QtCore QtGui && echo true)
  173. HAVE_QT5 = $(shell $(PKG_CONFIG) --exists Qt5Core Qt5Gui Qt5Widgets && \
  174. $(PKG_CONFIG) --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
  175. HAVE_QT5PKG = $(shell $(PKG_CONFIG) --silence-errors --variable=prefix Qt5OpenGLExtensions 1>/dev/null && echo true)
  176. HAVE_SNDFILE = $(shell $(PKG_CONFIG) --exists sndfile && echo true)
  177. ifeq ($(HAVE_FLUIDSYNTH),true)
  178. HAVE_FLUIDSYNTH_INSTPATCH = $(shell $(PKG_CONFIG) --atleast-version=2.1.0 fluidsynth && \
  179. $(PKG_CONFIG) --atleast-version=1.1.4 libinstpatch-1.0 && echo true)
  180. endif
  181. ifeq ($(JACKBRIDGE_DIRECT),true)
  182. HAVE_JACK = $(shell $(PKG_CONFIG) --exists jack && echo true)
  183. HAVE_JACKLIB = $(HAVE_JACK)
  184. else ifeq ($(WASM),true)
  185. HAVE_JACK = false
  186. HAVE_JACKLIB = false
  187. else
  188. HAVE_JACK = true
  189. HAVE_JACKLIB = false
  190. endif
  191. ifeq ($(LINUX),true)
  192. # juce only supports the most common architectures
  193. ifneq (,$(findstring arm,$(TARGET_MACHINE)))
  194. HAVE_JUCE_SUPPORTED_ARCH = true
  195. endif
  196. ifneq (,$(findstring aarch64,$(TARGET_MACHINE)))
  197. HAVE_JUCE_SUPPORTED_ARCH = true
  198. endif
  199. ifneq (,$(findstring i486,$(TARGET_MACHINE)))
  200. HAVE_JUCE_SUPPORTED_ARCH = true
  201. endif
  202. ifneq (,$(findstring i586,$(TARGET_MACHINE)))
  203. HAVE_JUCE_SUPPORTED_ARCH = true
  204. endif
  205. ifneq (,$(findstring i686,$(TARGET_MACHINE)))
  206. HAVE_JUCE_SUPPORTED_ARCH = true
  207. endif
  208. ifneq (,$(findstring x86_64,$(TARGET_MACHINE)))
  209. HAVE_JUCE_SUPPORTED_ARCH = true
  210. endif
  211. ifeq ($(HAVE_JUCE_SUPPORTED_ARCH),true)
  212. HAVE_JUCE_LINUX_DEPS = $(shell $(PKG_CONFIG) --exists x11 xcursor xext freetype2 && echo true)
  213. endif
  214. endif
  215. ifeq ($(WASM),true)
  216. HAVE_SDL1 = false
  217. HAVE_SDL2 = true
  218. else
  219. HAVE_SDL1 = $(shell $(PKG_CONFIG) --exists sdl && echo true)
  220. HAVE_SDL2 = $(shell $(PKG_CONFIG) --exists sdl2 && echo true)
  221. endif
  222. # ---------------------------------------------------------------------------------------------------------------------
  223. # Check for optional libs (special non-pkgconfig tests)
  224. ifneq ($(WASM),true)
  225. ifneq ($(WINDOWS),true)
  226. ifeq ($(shell $(PKG_CONFIG) --exists libmagic && echo true),true)
  227. HAVE_LIBMAGIC = true
  228. HAVE_LIBMAGICPKG = true
  229. else
  230. # old libmagic versions don't have a pkg-config file, so we need to call the compiler to test it
  231. CFLAGS_WITHOUT_ARCH = $(subst -arch arm64,,$(CFLAGS))
  232. HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS_WITHOUT_ARCH) -x c -w -c - -o /dev/null 2>/dev/null && echo true)
  233. endif
  234. endif
  235. endif
  236. # ---------------------------------------------------------------------------------------------------------------------
  237. # Set Qt tools
  238. ifeq ($(HAVE_QT4),true)
  239. MOC_QT4 ?= $(shell $(PKG_CONFIG) --variable=moc_location QtCore)
  240. RCC_QT4 ?= $(shell $(PKG_CONFIG) --variable=rcc_location QtCore)
  241. ifeq (,$(wildcard $(MOC_QT4)))
  242. HAVE_QT4 = false
  243. endif
  244. ifeq (,$(wildcard $(RCC_QT4)))
  245. HAVE_QT4 = false
  246. endif
  247. endif
  248. ifeq ($(HAVE_QT5),true)
  249. QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=host_bins Qt5Core)
  250. else ifeq ($(HAVE_QT5PKG),true)
  251. QT5_HOSTBINS = $(shell $(PKG_CONFIG) --variable=prefix Qt5OpenGLExtensions)/bin
  252. endif
  253. MOC_QT5 ?= $(QT5_HOSTBINS)/moc
  254. RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
  255. UIC_QT5 ?= $(QT5_HOSTBINS)/uic
  256. ifeq (,$(wildcard $(MOC_QT5)))
  257. HAVE_QT5 = false
  258. endif
  259. ifeq (,$(wildcard $(RCC_QT5)))
  260. HAVE_QT5 = false
  261. endif
  262. ifeq (,$(wildcard $(UIC_QT5)))
  263. HAVE_QT5 = false
  264. endif
  265. ifeq ($(HAVE_QT4),true)
  266. HAVE_QT = true
  267. else ifeq ($(HAVE_QT5),true)
  268. HAVE_QT = true
  269. # FIXME
  270. else ifeq ($(WINDOWS),true)
  271. HAVE_QT = true
  272. endif
  273. # ---------------------------------------------------------------------------------------------------------------------
  274. # Set PyQt tools
  275. PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
  276. PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
  277. ifneq ($(PYUIC5),)
  278. ifneq ($(PYRCC5),)
  279. HAVE_PYQT = true
  280. endif
  281. endif
  282. # ---------------------------------------------------------------------------------------------------------------------
  283. # Set PyQt tools, part2
  284. PYRCC ?= $(PYRCC5)
  285. PYUIC ?= $(PYUIC5)
  286. ifeq ($(HAVE_QT5),true)
  287. HAVE_THEME = true
  288. endif
  289. # ---------------------------------------------------------------------------------------------------------------------
  290. # Set USING_JUCE
  291. ifeq ($(MACOS_OR_WINDOWS),true)
  292. USING_JUCE = true
  293. USING_JUCE_AUDIO_DEVICES = true
  294. else ifeq ($(HAVE_JUCE_LINUX_DEPS),true)
  295. USING_JUCE = true
  296. endif
  297. # ---------------------------------------------------------------------------------------------------------------------
  298. # Set USING_RTAUDIO
  299. ifneq ($(HAIKU),true)
  300. ifneq ($(WASM),true)
  301. ifneq ($(USING_JUCE_AUDIO_DEVICES),true)
  302. USING_RTAUDIO = true
  303. endif
  304. endif
  305. endif
  306. # ---------------------------------------------------------------------------------------------------------------------
  307. # Disable features for static plugin target
  308. ifeq ($(STATIC_PLUGIN_TARGET),true)
  309. HAVE_ALSA = false
  310. HAVE_JACK = false
  311. HAVE_JACKLIB = false
  312. HAVE_HYLIA = false
  313. HAVE_LIBLO = false
  314. HAVE_PULSEAUDIO = false
  315. HAVE_PYQT = false
  316. HAVE_QT4 = false
  317. HAVE_QT5 = false
  318. HAVE_QT5PKG = false
  319. HAVE_SDL = false
  320. HAVE_SDL1 = false
  321. HAVE_SDL2 = false
  322. USING_JUCE = false
  323. USING_JUCE_AUDIO_DEVICES = false
  324. USING_RTAUDIO = false
  325. endif
  326. # ---------------------------------------------------------------------------------------------------------------------
  327. # Set libs stuff (part 1)
  328. ifneq ($(HAIKU_OR_MACOS_OR_WINDOWS),true)
  329. LIBDL_LIBS = -ldl
  330. endif
  331. ifeq ($(HAVE_LIBLO),true)
  332. LIBLO_FLAGS = $(shell $(PKG_CONFIG) --cflags liblo)
  333. LIBLO_LIBS = $(shell $(PKG_CONFIG) --libs liblo)
  334. endif
  335. ifeq ($(HAVE_FFMPEG),true)
  336. FFMPEG_FLAGS = $(shell $(PKG_CONFIG) --cflags libavcodec libavformat libavutil)
  337. FFMPEG_LIBS = $(shell $(PKG_CONFIG) --libs libavcodec libavformat libavutil)
  338. endif
  339. ifeq ($(HAVE_FLUIDSYNTH),true)
  340. FLUIDSYNTH_FLAGS = $(shell $(PKG_CONFIG) --cflags fluidsynth)
  341. FLUIDSYNTH_LIBS = $(shell $(PKG_CONFIG) --libs fluidsynth)
  342. endif
  343. ifeq ($(HAVE_JACKLIB),true)
  344. JACK_FLAGS = $(shell $(PKG_CONFIG) --cflags jack)
  345. JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack)
  346. JACK_LIBDIR = $(shell $(PKG_CONFIG) --variable=libdir jack)/jack
  347. endif
  348. ifeq ($(HAVE_QT5),true)
  349. QT5_FLAGS = $(shell $(PKG_CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets)
  350. QT5_LIBS = $(shell $(PKG_CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets)
  351. endif
  352. ifeq ($(WASM),true)
  353. HAVE_SDL = true
  354. SDL_FLAGS = -sUSE_SDL=2
  355. SDL_LIBS = -sUSE_SDL=2
  356. else ifeq ($(HAVE_SDL2),true)
  357. HAVE_SDL = true
  358. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl2)
  359. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl2)
  360. else ifeq ($(HAVE_SDL1),true)
  361. HAVE_SDL = true
  362. SDL_FLAGS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --cflags sdl)
  363. SDL_LIBS = $(shell $(PKG_CONFIG) $(PKG_CONFIG_FLAGS) --libs sdl)
  364. endif
  365. ifeq ($(HAVE_SNDFILE),true)
  366. SNDFILE_FLAGS = $(shell $(PKG_CONFIG) --cflags sndfile)
  367. SNDFILE_LIBS = $(shell $(PKG_CONFIG) --libs sndfile)
  368. endif
  369. # ifeq ($(HAVE_YSFXGUI),true)
  370. # ifeq ($(MACOS),true)
  371. # YSFX_LIBS = -framework Cocoa -framework Carbon -framework Metal -framework Foundation
  372. # else ifeq ($(WASM),true)
  373. # # TODO
  374. # YSFX_LIBS =
  375. # else
  376. # YSFX_FLAGS = $(shell $(PKG_CONFIG) --cflags freetype2 fontconfig)
  377. # YSFX_LIBS = $(shell $(PKG_CONFIG) --libs freetype2 fontconfig gl x11)
  378. # endif
  379. # endif
  380. ifeq ($(HAVE_X11),true)
  381. X11_FLAGS = $(shell $(PKG_CONFIG) --cflags x11)
  382. X11_LIBS = $(shell $(PKG_CONFIG) --libs x11)
  383. endif
  384. # ---------------------------------------------------------------------------------------------------------------------
  385. # Set libs stuff (dgl)
  386. ifeq ($(HAVE_DGL),true)
  387. ifeq ($(HAIKU),true)
  388. DGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl)
  389. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl) -lbe
  390. else ifeq ($(MACOS),true)
  391. DGL_FLAGS = -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
  392. DGL_LIBS = -framework OpenGL -framework Cocoa -framework CoreVideo
  393. else ifeq ($(WASM),true)
  394. ifneq ($(USE_GLES2)$(USE_GLES3),true)
  395. DGL_LIBS = -sLEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
  396. endif
  397. else ifeq ($(WINDOWS),true)
  398. DGL_LIBS = -lopengl32 -lgdi32
  399. else
  400. DGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl x11)
  401. DGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11)
  402. endif
  403. endif
  404. # ---------------------------------------------------------------------------------------------------------------------
  405. # Set libs stuff (libmagic)
  406. ifeq ($(HAVE_LIBMAGICPKG),true)
  407. MAGIC_FLAGS = $(shell $(PKG_CONFIG) --cflags libmagic)
  408. # this is missing in upstream pkg-config
  409. MAGIC_FLAGS += -I$(shell $(PKG_CONFIG) --variable=includedir libmagic)
  410. MAGIC_LIBS = $(shell $(PKG_CONFIG) --libs libmagic)
  411. else ifeq ($(HAVE_LIBMAGIC),true)
  412. MAGIC_LIBS += -lmagic
  413. ifeq ($(LINUX_OR_MACOS),true)
  414. MAGIC_LIBS += -lz
  415. endif
  416. endif
  417. # ---------------------------------------------------------------------------------------------------------------------
  418. # Set libs stuff (juce)
  419. ifeq ($(USING_JUCE),true)
  420. ifeq ($(LINUX),true)
  421. JUCE_AUDIO_BASICS_LIBS =
  422. JUCE_AUDIO_DEVICES_LIBS = $(shell $(PKG_CONFIG) --libs alsa)
  423. JUCE_AUDIO_FORMATS_LIBS =
  424. JUCE_AUDIO_PROCESSORS_LIBS =
  425. JUCE_CORE_LIBS = -ldl -pthread -lrt
  426. JUCE_EVENTS_LIBS =
  427. JUCE_GRAPHICS_LIBS = $(shell $(PKG_CONFIG) --libs freetype2)
  428. JUCE_GUI_BASICS_LIBS =
  429. JUCE_GUI_EXTRA_LIBS =
  430. else ifeq ($(MACOS),true)
  431. JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
  432. JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
  433. JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
  434. JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa
  435. JUCE_CORE_LIBS = -framework AppKit
  436. JUCE_EVENTS_LIBS = -framework AppKit
  437. JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
  438. JUCE_GUI_BASICS_LIBS = -framework Cocoa
  439. JUCE_GUI_EXTRA_LIBS = -framework IOKit
  440. else ifeq ($(WINDOWS),true)
  441. JUCE_AUDIO_BASICS_LIBS =
  442. JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
  443. JUCE_AUDIO_FORMATS_LIBS =
  444. JUCE_AUDIO_PROCESSORS_LIBS =
  445. JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  446. JUCE_EVENTS_LIBS = -lole32
  447. JUCE_GRAPHICS_LIBS = -lgdi32
  448. JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
  449. JUCE_GUI_EXTRA_LIBS =
  450. endif
  451. endif
  452. # ---------------------------------------------------------------------------------------------------------------------
  453. # Set libs stuff (rtaudio)
  454. ifeq ($(USING_RTAUDIO),true)
  455. RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
  456. RTMIDI_FLAGS =
  457. ifeq ($(DEBUG),true)
  458. RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
  459. RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
  460. endif
  461. ifeq ($(HAVE_ALSA),true)
  462. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  463. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs alsa) -pthread
  464. RTMIDI_FLAGS += $(shell $(PKG_CONFIG) --cflags alsa) -D__LINUX_ALSA__
  465. RTMIDI_LIBS += $(shell $(PKG_CONFIG) --libs alsa)
  466. endif
  467. ifeq ($(HAVE_JACK),true)
  468. ifeq ($(UNIX),true)
  469. RTAUDIO_FLAGS += -D__UNIX_JACK__
  470. endif
  471. endif
  472. ifeq ($(HAVE_PULSEAUDIO),true)
  473. RTAUDIO_FLAGS += $(shell $(PKG_CONFIG) --cflags libpulse-simple) -D__UNIX_PULSE__
  474. RTAUDIO_LIBS += $(shell $(PKG_CONFIG) --libs libpulse-simple)
  475. endif
  476. ifeq ($(MACOS),true)
  477. RTAUDIO_FLAGS += -D__MACOSX_CORE__
  478. RTAUDIO_LIBS += -framework CoreAudio
  479. RTMIDI_FLAGS += -D__MACOSX_CORE__
  480. RTMIDI_LIBS += -framework CoreMIDI
  481. else ifeq ($(WINDOWS),true)
  482. RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
  483. RTAUDIO_LIBS += -ldsound -luuid -lksuser
  484. RTMIDI_FLAGS += -D__WINDOWS_MM__
  485. RTMIDI_LIBS += -lwinmm
  486. endif
  487. endif
  488. # ---------------------------------------------------------------------------------------------------------------------
  489. # Set libs stuff (extra)
  490. ifeq ($(BSD),true)
  491. HYLIA_FLAGS =
  492. HYLIA_LIBS =
  493. JACKBRIDGE_LIBS = -pthread -lrt
  494. LILV_LIBS = -lm -lrt
  495. RTMEMPOOL_LIBS = -pthread
  496. WATER_LIBS = -pthread -lrt
  497. else ifeq ($(HAIKU),true)
  498. HYLIA_FLAGS =
  499. HYLIA_LIBS =
  500. JACKBRIDGE_LIBS = -lpthread
  501. LILV_LIBS = -lm
  502. RTMEMPOOL_LIBS = -lpthread
  503. WATER_LIBS = -lpthread
  504. else ifeq ($(HURD),true)
  505. HYLIA_FLAGS =
  506. HYLIA_LIBS =
  507. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  508. LILV_LIBS = -ldl -lm -lrt
  509. RTMEMPOOL_LIBS = -pthread -lrt
  510. WATER_LIBS = -ldl -pthread -lrt
  511. else ifeq ($(LINUX),true)
  512. HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
  513. HYLIA_LIBS =
  514. JACKBRIDGE_LIBS = -ldl -pthread -lrt
  515. LILV_LIBS = -ldl -lm -lrt
  516. RTMEMPOOL_LIBS = -pthread -lrt
  517. WATER_LIBS = -ldl -pthread -lrt
  518. else ifeq ($(MACOS),true)
  519. HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
  520. HYLIA_LIBS =
  521. JACKBRIDGE_LIBS = -ldl -pthread
  522. LILV_LIBS = -ldl -lm
  523. RTMEMPOOL_LIBS = -pthread
  524. WATER_LIBS = -framework AppKit
  525. else ifeq ($(WASM),true)
  526. HYLIA_FLAGS =
  527. HYLIA_LIBS =
  528. JACKBRIDGE_LIBS =
  529. LILV_LIBS = -ldl -lm
  530. RTMEMPOOL_LIBS =
  531. WATER_LIBS =
  532. else ifeq ($(WINDOWS),true)
  533. HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
  534. HYLIA_LIBS = -liphlpapi
  535. JACKBRIDGE_LIBS = -pthread
  536. LILV_LIBS = -lm
  537. RTMEMPOOL_LIBS = -pthread
  538. WATER_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  539. endif
  540. # ---------------------------------------------------------------------------------------------------------------------
  541. AUDIO_DECODER_LIBS = $(FFMPEG_LIBS)
  542. AUDIO_DECODER_LIBS += $(SNDFILE_LIBS)
  543. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  544. NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
  545. NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
  546. STATIC_CARLA_PLUGIN_LIBS = $(AUDIO_DECODER_LIBS)
  547. STATIC_CARLA_PLUGIN_LIBS += $(NATIVE_PLUGINS_LIBS)
  548. STATIC_CARLA_PLUGIN_LIBS += $(FLUIDSYNTH_LIBS)
  549. STATIC_CARLA_PLUGIN_LIBS += $(HYLIA_LIBS)
  550. STATIC_CARLA_PLUGIN_LIBS += $(LIBLO_LIBS)
  551. STATIC_CARLA_PLUGIN_LIBS += $(LILV_LIBS)
  552. STATIC_CARLA_PLUGIN_LIBS += $(MAGIC_LIBS)
  553. STATIC_CARLA_PLUGIN_LIBS += $(RTMEMPOOL_LIBS)
  554. STATIC_CARLA_PLUGIN_LIBS += $(WATER_LIBS)
  555. STATIC_CARLA_PLUGIN_LIBS += $(YSFX_LIBS)
  556. ifeq ($(USING_JUCE),true)
  557. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_BASICS_LIBS)
  558. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_FORMATS_LIBS)
  559. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_AUDIO_PROCESSORS_LIBS)
  560. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_CORE_LIBS)
  561. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_EVENTS_LIBS)
  562. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GRAPHICS_LIBS)
  563. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_BASICS_LIBS)
  564. STATIC_CARLA_PLUGIN_LIBS += $(JUCE_GUI_EXTRA_LIBS)
  565. endif
  566. ifeq ($(EXTERNAL_PLUGINS),true)
  567. ifneq ($(DEBUG),true)
  568. ifneq ($(TESTBUILD),true)
  569. ifeq ($(shell $(PKG_CONFIG) --exists liblo fftw3 mxml zlib && echo true),true)
  570. STATIC_CARLA_PLUGIN_LIBS += $(shell $(PKG_CONFIG) --libs liblo fftw3 mxml zlib) -pthread
  571. endif
  572. endif
  573. endif
  574. endif
  575. # ---------------------------------------------------------------------------------------------------------------------