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.

607 lines
17KB

  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. WINECC ?= winegcc
  12. # ---------------------------------------------------------------------------------------------------------------------
  13. # Auto-detect OS if not defined
  14. ifneq ($(BSD),true)
  15. ifneq ($(HAIKU),true)
  16. ifneq ($(HURD),true)
  17. ifneq ($(LINUX),true)
  18. ifneq ($(MACOS),true)
  19. ifneq ($(WIN32),true)
  20. TARGET_MACHINE := $(shell $(CC) -dumpmachine)
  21. ifneq (,$(findstring bsd,$(TARGET_MACHINE)))
  22. BSD=true
  23. endif
  24. ifneq (,$(findstring haiku,$(TARGET_MACHINE)))
  25. HAIKU=true
  26. endif
  27. ifneq (,$(findstring gnu,$(TARGET_MACHINE)))
  28. HURD=true
  29. endif
  30. ifneq (,$(findstring linux,$(TARGET_MACHINE)))
  31. LINUX=true
  32. endif
  33. ifneq (,$(findstring apple,$(TARGET_MACHINE)))
  34. MACOS=true
  35. endif
  36. ifneq (,$(findstring mingw,$(TARGET_MACHINE)))
  37. WIN32=true
  38. endif
  39. endif
  40. endif
  41. endif
  42. endif
  43. endif
  44. endif
  45. # ---------------------------------------------------------------------------------------------------------------------
  46. # Set LINUX_OR_MACOS
  47. ifeq ($(LINUX),true)
  48. LINUX_OR_MACOS=true
  49. endif
  50. ifeq ($(MACOS),true)
  51. LINUX_OR_MACOS=true
  52. endif
  53. # ---------------------------------------------------------------------------------------------------------------------
  54. # Set MACOS_OR_WIN32
  55. ifeq ($(MACOS),true)
  56. MACOS_OR_WIN32=true
  57. endif
  58. ifeq ($(WIN32),true)
  59. MACOS_OR_WIN32=true
  60. endif
  61. # ---------------------------------------------------------------------------------------------------------------------
  62. # Set UNIX
  63. ifeq ($(BSD),true)
  64. UNIX=true
  65. endif
  66. ifeq ($(HURD),true)
  67. UNIX=true
  68. endif
  69. ifeq ($(LINUX),true)
  70. UNIX=true
  71. endif
  72. ifeq ($(MACOS),true)
  73. UNIX=true
  74. endif
  75. # ---------------------------------------------------------------------------------------------------------------------
  76. # Set USING_JUCE
  77. # Not ready yet
  78. # ifeq ($(MACOS_OR_WIN32),true)
  79. # USING_JUCE=true
  80. # endif
  81. # ---------------------------------------------------------------------------------------------------------------------
  82. # Set build and link flags
  83. BASE_FLAGS = -Wall -Wextra -pipe -DBUILDING_CARLA -DREAL_BUILD -MD -MP
  84. BASE_OPTS = -O3 -ffast-math -mtune=generic -msse -msse2 -mfpmath=sse -fdata-sections -ffunction-sections
  85. ifeq ($(MACOS),true)
  86. # MacOS linker flags
  87. BASE_FLAGS += -Wno-deprecated-declarations
  88. LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip -Wl,-dead_strip_dylibs
  89. else
  90. # Common linker flags
  91. LINK_OPTS = -fdata-sections -ffunction-sections -Wl,--gc-sections -Wl,-O1 -Wl,--as-needed
  92. ifneq ($(SKIP_STRIPPING),true)
  93. LINK_OPTS += -Wl,--strip-all
  94. endif
  95. endif
  96. ifeq ($(NOOPT),true)
  97. # No CPU-specific optimization flags
  98. BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
  99. endif
  100. ifeq ($(WIN32),true)
  101. # mingw has issues with this specific optimization
  102. # See https://github.com/falkTX/Carla/issues/696
  103. BASE_OPTS += -fno-rerun-cse-after-loop
  104. # See https://github.com/falkTX/Carla/issues/855
  105. BASE_OPTS += -mstackrealign
  106. ifeq ($(BUILDING_FOR_WINDOWS),true)
  107. BASE_FLAGS += -DBUILDING_CARLA_FOR_WINDOWS
  108. endif
  109. else
  110. # Not needed for Windows
  111. BASE_FLAGS += -fPIC -DPIC
  112. endif
  113. ifeq ($(CLANG),true)
  114. BASE_FLAGS += -Wabsolute-value
  115. endif
  116. ifeq ($(DEBUG),true)
  117. BASE_FLAGS += -DDEBUG -O0 -g
  118. LINK_OPTS =
  119. else
  120. BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
  121. CXXFLAGS += -fvisibility-inlines-hidden
  122. endif
  123. 32BIT_FLAGS = -m32
  124. 64BIT_FLAGS = -m64
  125. ARM32_FLAGS = -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -mvectorize-with-neon-quad
  126. BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
  127. BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++0x $(CXXFLAGS)
  128. LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
  129. ifneq ($(MACOS),true)
  130. # Not available on MacOS
  131. LINK_FLAGS += -Wl,--no-undefined
  132. endif
  133. ifeq ($(MACOS_OLD),true)
  134. BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) -DHAVE_CPP11_SUPPORT=0
  135. endif
  136. ifeq ($(WIN32),true)
  137. # Always build statically on windows
  138. LINK_FLAGS += -static
  139. endif
  140. # ---------------------------------------------------------------------------------------------------------------------
  141. # Strict test build
  142. ifeq ($(TESTBUILD),true)
  143. BASE_FLAGS += -Werror -Wabi=98 -Wcast-qual -Wclobbered -Wconversion -Wdisabled-optimization
  144. BASE_FLAGS += -Wdouble-promotion -Wfloat-equal -Wlogical-op -Wpointer-arith -Wsign-conversion
  145. BASE_FLAGS += -Wformat=2 -Woverlength-strings -Wstringop-overflow=4 -Wstringop-truncation
  146. BASE_FLAGS += -Wmissing-declarations -Wredundant-decls
  147. BASE_FLAGS += -Wshadow -Wundef -Wuninitialized -Wunused
  148. BASE_FLAGS += -Wstrict-aliasing -fstrict-aliasing
  149. BASE_FLAGS += -Wstrict-overflow -fstrict-overflow
  150. BASE_FLAGS += -Wduplicated-branches -Wduplicated-cond -Wnull-dereference
  151. CFLAGS += -Winit-self -Wjump-misses-init -Wmissing-prototypes -Wnested-externs -Wstrict-prototypes -Wwrite-strings
  152. CXXFLAGS += -Wc++0x-compat -Wc++11-compat
  153. CXXFLAGS += -Wnon-virtual-dtor -Woverloaded-virtual
  154. # CXXFLAGS += -Wold-style-cast -Wuseless-cast
  155. CXXFLAGS += -Wzero-as-null-pointer-constant
  156. ifneq ($(DEBUG),true)
  157. CXXFLAGS += -Weffc++
  158. endif
  159. ifeq ($(LINUX),true)
  160. BASE_FLAGS += -isystem /opt/kxstudio/include
  161. endif
  162. ifeq ($(MACOS),true)
  163. CXXFLAGS += -isystem /System/Library/Frameworks
  164. endif
  165. ifeq ($(WIN32),true)
  166. BASE_FLAGS += -isystem /opt/mingw32/include
  167. endif
  168. ifeq ($(WIN64),true)
  169. BASE_FLAGS += -isystem /opt/mingw64/include
  170. endif
  171. endif
  172. # ---------------------------------------------------------------------------------------------------------------------
  173. # Check for optional libs (required by backend or bridges)
  174. ifeq ($(LINUX),true)
  175. HAVE_ALSA = $(shell pkg-config --exists alsa && echo true)
  176. HAVE_HYLIA = true
  177. endif
  178. ifeq ($(MACOS),true)
  179. ifneq ($(MACOS_OLD),true)
  180. HAVE_HYLIA = true
  181. endif
  182. endif
  183. ifeq ($(MACOS_OR_WIN32),true)
  184. HAVE_DGL = true
  185. else
  186. HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
  187. HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
  188. HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
  189. HAVE_X11 = $(shell pkg-config --exists x11 && echo true)
  190. endif
  191. ifeq ($(UNIX),true)
  192. ifneq ($(MACOS),true)
  193. HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true)
  194. endif
  195. endif
  196. HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && echo true)
  197. HAVE_FLUIDSYNTH = $(shell pkg-config --atleast-version=1.1.7 fluidsynth && echo true)
  198. HAVE_JACK = $(shell pkg-config --exists jack && echo true)
  199. HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
  200. HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true)
  201. HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && \
  202. pkg-config --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
  203. HAVE_SNDFILE = $(shell pkg-config --exists sndfile && echo true)
  204. ifeq ($(JACKBRIDGE_DIRECT),true)
  205. ifeq ($(HAVE_JACK),true)
  206. BASE_FLAGS += -DJACKBRIDGE_DIRECT
  207. else
  208. $(error jackbridge direct mode requested, but jack not available)
  209. endif
  210. endif
  211. # ---------------------------------------------------------------------------------------------------------------------
  212. # Check for optional libs (special non-pkgconfig tests)
  213. ifneq ($(WIN32),true)
  214. # libmagic doesn't have a pkg-config file, so we need to call the compiler to test it
  215. HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS) -x c -w -c - -o .libmagic-tmp 2>/dev/null && echo true)
  216. endif
  217. # ---------------------------------------------------------------------------------------------------------------------
  218. # Set Qt tools
  219. ifeq ($(HAVE_QT4),true)
  220. MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore)
  221. RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore)
  222. UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore)
  223. ifeq (,$(wildcard $(MOC_QT4)))
  224. HAVE_QT4=false
  225. endif
  226. ifeq (,$(wildcard $(RCC_QT4)))
  227. HAVE_QT4=false
  228. endif
  229. endif
  230. ifeq ($(HAVE_QT5),true)
  231. QT5_HOSTBINS = $(shell pkg-config --variable=host_bins Qt5Core)
  232. MOC_QT5 ?= $(QT5_HOSTBINS)/moc
  233. RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
  234. UIC_QT5 ?= $(QT5_HOSTBINS)/uic
  235. ifeq (,$(wildcard $(MOC_QT5)))
  236. HAVE_QT5=false
  237. endif
  238. ifeq (,$(wildcard $(RCC_QT5)))
  239. HAVE_QT5=false
  240. endif
  241. endif
  242. ifeq ($(HAVE_QT4),true)
  243. HAVE_QT=true
  244. endif
  245. ifeq ($(HAVE_QT5),true)
  246. HAVE_QT=true
  247. endif
  248. ifeq ($(WIN32),true)
  249. HAVE_QT=true
  250. endif
  251. # ---------------------------------------------------------------------------------------------------------------------
  252. # Set PyQt tools
  253. PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
  254. PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
  255. ifneq ($(PYUIC5),)
  256. ifneq ($(PYRCC5),)
  257. HAVE_PYQT=true
  258. endif
  259. endif
  260. # ---------------------------------------------------------------------------------------------------------------------
  261. # Set PyQt tools, part2
  262. PYUIC ?= pyuic5
  263. PYRCC ?= pyrcc5
  264. ifeq ($(HAVE_QT5),true)
  265. HAVE_THEME = true
  266. endif
  267. # ---------------------------------------------------------------------------------------------------------------------
  268. # Set base defines
  269. ifeq ($(HAVE_DGL),true)
  270. BASE_FLAGS += -DHAVE_DGL
  271. BASE_FLAGS += -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
  272. endif
  273. ifeq ($(HAVE_FLUIDSYNTH),true)
  274. BASE_FLAGS += -DHAVE_FLUIDSYNTH
  275. endif
  276. ifeq ($(HAVE_FFMPEG),true)
  277. BASE_FLAGS += -DHAVE_FFMPEG
  278. endif
  279. ifeq ($(HAVE_HYLIA),true)
  280. BASE_FLAGS += -DHAVE_HYLIA
  281. endif
  282. ifeq ($(HAVE_LIBLO),true)
  283. BASE_FLAGS += -DHAVE_LIBLO
  284. endif
  285. ifeq ($(HAVE_LIBMAGIC),true)
  286. BASE_FLAGS += -DHAVE_LIBMAGIC
  287. endif
  288. ifeq ($(HAVE_PYQT),true)
  289. BASE_FLAGS += -DHAVE_PYQT
  290. endif
  291. ifeq ($(HAVE_SNDFILE),true)
  292. BASE_FLAGS += -DHAVE_SNDFILE
  293. endif
  294. ifeq ($(HAVE_X11),true)
  295. BASE_FLAGS += -DHAVE_X11
  296. endif
  297. ifeq ($(USING_JUCE),true)
  298. BASE_FLAGS += -DUSING_JUCE
  299. endif
  300. # ---------------------------------------------------------------------------------------------------------------------
  301. # Set libs stuff (part 1)
  302. ifeq ($(LINUX_OR_MACOS),true)
  303. LIBDL_LIBS = -ldl
  304. endif
  305. ifeq ($(WIN32),true)
  306. PKG_CONFIG_FLAGS = --static
  307. endif
  308. ifeq ($(HAVE_DGL),true)
  309. ifeq ($(MACOS),true)
  310. DGL_LIBS = -framework OpenGL -framework Cocoa
  311. endif
  312. ifeq ($(WIN32),true)
  313. DGL_LIBS = -lopengl32 -lgdi32
  314. endif
  315. ifneq ($(MACOS_OR_WIN32),true)
  316. DGL_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags gl x11)
  317. DGL_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs gl x11)
  318. endif
  319. endif
  320. ifeq ($(HAVE_LIBLO),true)
  321. LIBLO_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags liblo)
  322. LIBLO_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs liblo)
  323. endif
  324. ifeq ($(HAVE_LIBMAGIC),true)
  325. MAGIC_LIBS += -lmagic
  326. ifeq ($(LINUX_OR_MACOS),true)
  327. MAGIC_LIBS += -lz
  328. endif
  329. endif
  330. ifeq ($(HAVE_FFMPEG),true)
  331. FFMPEG_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags libavcodec libavformat libavutil)
  332. FFMPEG_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libavcodec libavformat libavutil)
  333. endif
  334. ifeq ($(HAVE_FLUIDSYNTH),true)
  335. FLUIDSYNTH_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags fluidsynth)
  336. FLUIDSYNTH_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs fluidsynth)
  337. endif
  338. ifeq ($(HAVE_JACK),true)
  339. JACK_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags jack)
  340. JACK_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs jack)
  341. JACK_LIBDIR = $(shell pkg-config --variable=libdir jack)/jack
  342. endif
  343. ifeq ($(HAVE_SNDFILE),true)
  344. SNDFILE_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags sndfile)
  345. SNDFILE_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs sndfile)
  346. endif
  347. ifeq ($(HAVE_X11),true)
  348. X11_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags x11)
  349. X11_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  350. endif
  351. # ---------------------------------------------------------------------------------------------------------------------
  352. # Set libs stuff (part 2)
  353. ifneq ($(USING_JUCE),true)
  354. RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
  355. RTMIDI_FLAGS =
  356. ifeq ($(DEBUG),true)
  357. RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
  358. RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
  359. endif
  360. ifeq ($(UNIX),true)
  361. RTAUDIO_FLAGS += -D__UNIX_JACK__
  362. ifeq ($(HAVE_PULSEAUDIO),true)
  363. RTAUDIO_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags libpulse-simple) -D__UNIX_PULSE__
  364. RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libpulse-simple)
  365. endif
  366. endif
  367. endif # USING_JUCE
  368. ifeq ($(BSD),true)
  369. JACKBRIDGE_LIBS = -lpthread -lrt
  370. LILV_LIBS = -lm -lrt
  371. RTMEMPOOL_LIBS = -lpthread
  372. WATER_LIBS = -lpthread -lrt
  373. endif
  374. ifeq ($(HAIKU),true)
  375. JACKBRIDGE_LIBS = -lpthread
  376. LILV_LIBS = -lm
  377. RTMEMPOOL_LIBS = -lpthread
  378. WATER_LIBS = -lpthread
  379. endif
  380. ifeq ($(HURD),true)
  381. JACKBRIDGE_LIBS = -ldl -lpthread -lrt
  382. LILV_LIBS = -ldl -lm -lrt
  383. RTMEMPOOL_LIBS = -lpthread -lrt
  384. WATER_LIBS = -ldl -lpthread -lrt
  385. endif
  386. ifeq ($(LINUX),true)
  387. HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
  388. JACKBRIDGE_LIBS = -ldl -lpthread -lrt
  389. LILV_LIBS = -ldl -lm -lrt
  390. RTMEMPOOL_LIBS = -lpthread -lrt
  391. WATER_LIBS = -ldl -lpthread -lrt
  392. ifeq ($(USING_JUCE),true)
  393. JUCE_AUDIO_DEVICES_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa)
  394. JUCE_CORE_LIBS = -ldl -lpthread -lrt
  395. JUCE_EVENTS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  396. JUCE_GRAPHICS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs freetype2)
  397. JUCE_GUI_BASICS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11 xext)
  398. else
  399. ifeq ($(HAVE_ALSA),true)
  400. RTAUDIO_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LINUX_ALSA__
  401. RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa) -lpthread
  402. RTMIDI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LINUX_ALSA__
  403. RTMIDI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa)
  404. endif
  405. endif
  406. endif
  407. ifeq ($(MACOS),true)
  408. HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
  409. JACKBRIDGE_LIBS = -ldl -lpthread
  410. LILV_LIBS = -ldl -lm
  411. RTMEMPOOL_LIBS = -lpthread
  412. WATER_LIBS = -framework AppKit
  413. ifeq ($(USING_JUCE),true)
  414. JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
  415. JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
  416. JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
  417. JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa -framework Carbon
  418. JUCE_CORE_LIBS = -framework AppKit
  419. JUCE_EVENTS_LIBS = -framework AppKit
  420. JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
  421. JUCE_GUI_BASICS_LIBS = -framework Cocoa
  422. else
  423. RTAUDIO_FLAGS += -D__MACOSX_CORE__
  424. RTAUDIO_LIBS += -framework CoreAudio
  425. RTMIDI_FLAGS += -D__MACOSX_CORE__
  426. RTMIDI_LIBS += -framework CoreMIDI
  427. endif
  428. endif
  429. ifeq ($(WIN32),true)
  430. HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
  431. JACKBRIDGE_LIBS = -lpthread
  432. LILV_LIBS = -lm
  433. RTMEMPOOL_LIBS = -lpthread
  434. WATER_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  435. ifeq ($(USING_JUCE),true)
  436. JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
  437. JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  438. JUCE_GRAPHICS_LIBS = -lgdi32
  439. JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
  440. else
  441. RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
  442. RTAUDIO_LIBS += -ldsound -luuid -lksuser -lwinmm
  443. RTMIDI_FLAGS += -D__WINDOWS_MM__
  444. endif
  445. endif
  446. # ---------------------------------------------------------------------------------------------------------------------
  447. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  448. NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
  449. NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
  450. # ---------------------------------------------------------------------------------------------------------------------
  451. # Set app extension
  452. ifeq ($(WIN32),true)
  453. APP_EXT = .exe
  454. endif
  455. # ---------------------------------------------------------------------------------------------------------------------
  456. # Set shared lib extension
  457. LIB_EXT = .so
  458. ifeq ($(MACOS),true)
  459. LIB_EXT = .dylib
  460. endif
  461. ifeq ($(WIN32),true)
  462. LIB_EXT = .dll
  463. endif
  464. BASE_FLAGS += -DCARLA_LIB_EXT=\"$(LIB_EXT)\"
  465. # ---------------------------------------------------------------------------------------------------------------------
  466. # Set static libs start & end
  467. ifneq ($(MACOS),true)
  468. LIBS_START = -Wl,--start-group
  469. LIBS_END = -Wl,--end-group
  470. endif
  471. # ---------------------------------------------------------------------------------------------------------------------
  472. # Set shared library CLI arg
  473. ifeq ($(MACOS),true)
  474. SHARED = -dynamiclib
  475. else
  476. SHARED = -shared
  477. endif
  478. # ---------------------------------------------------------------------------------------------------------------------
  479. # Set arguments used for inline 'sed'
  480. ifeq ($(BSD),true)
  481. SED_ARGS=-i '' -e
  482. else
  483. SED_ARGS=-i -e
  484. endif
  485. # ---------------------------------------------------------------------------------------------------------------------
  486. # Set command used for file symlinking
  487. LINK := ln -sf
  488. # ---------------------------------------------------------------------------------------------------------------------
  489. ifneq ($(DEBUG),true)
  490. ifneq ($(TESTBUILD),true)
  491. ifneq (,$(wildcard $(CWD)/native-plugins/external/Makefile.mk))
  492. EXTERNAL_PLUGINS = true
  493. BASE_FLAGS += -DHAVE_EXTERNAL_PLUGINS
  494. include $(CWD)/native-plugins/external/Makefile.mk
  495. endif
  496. endif
  497. endif
  498. # ---------------------------------------------------------------------------------------------------------------------