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.

605 lines
18KB

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