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.

613 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. # FIXME make mingw compatible
  184. # ifeq ($(WIN32),true)
  185. # HAVE_HYLIA = true
  186. # endif
  187. ifeq ($(MACOS_OR_WIN32),true)
  188. HAVE_DGL = true
  189. else
  190. HAVE_DGL = $(shell pkg-config --exists gl x11 && echo true)
  191. HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true)
  192. HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true)
  193. HAVE_X11 = $(shell pkg-config --exists x11 && echo true)
  194. endif
  195. ifeq ($(UNIX),true)
  196. ifneq ($(MACOS),true)
  197. HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true)
  198. endif
  199. endif
  200. HAVE_FFMPEG = $(shell pkg-config --exists libavcodec libavformat libavutil && echo true)
  201. HAVE_FLUIDSYNTH = $(shell pkg-config --atleast-version=1.1.7 fluidsynth && echo true)
  202. HAVE_JACK = $(shell pkg-config --exists jack && echo true)
  203. HAVE_LIBLO = $(shell pkg-config --exists liblo && echo true)
  204. HAVE_QT4 = $(shell pkg-config --exists QtCore QtGui && echo true)
  205. HAVE_QT5 = $(shell pkg-config --exists Qt5Core Qt5Gui Qt5Widgets && \
  206. pkg-config --variable=qt_config Qt5Core | grep -q -v "static" && echo true)
  207. HAVE_SNDFILE = $(shell pkg-config --exists sndfile && echo true)
  208. ifeq ($(JACKBRIDGE_DIRECT),true)
  209. ifeq ($(HAVE_JACK),true)
  210. BASE_FLAGS += -DJACKBRIDGE_DIRECT
  211. else
  212. $(error jackbridge direct mode requested, but jack not available)
  213. endif
  214. endif
  215. # ---------------------------------------------------------------------------------------------------------------------
  216. # Check for optional libs (special non-pkgconfig tests)
  217. ifneq ($(WIN32),true)
  218. # libmagic doesn't have a pkg-config file, so we need to call the compiler to test it
  219. HAVE_LIBMAGIC = $(shell echo '\#include <magic.h>' | $(CC) $(CFLAGS) -x c -w -c - -o .libmagic-tmp 2>/dev/null && echo true)
  220. endif
  221. # ---------------------------------------------------------------------------------------------------------------------
  222. # Set Qt tools
  223. ifeq ($(HAVE_QT4),true)
  224. MOC_QT4 ?= $(shell pkg-config --variable=moc_location QtCore)
  225. RCC_QT4 ?= $(shell pkg-config --variable=rcc_location QtCore)
  226. UIC_QT4 ?= $(shell pkg-config --variable=uic_location QtCore)
  227. ifeq (,$(wildcard $(MOC_QT4)))
  228. HAVE_QT4=false
  229. endif
  230. ifeq (,$(wildcard $(RCC_QT4)))
  231. HAVE_QT4=false
  232. endif
  233. endif
  234. ifeq ($(HAVE_QT5),true)
  235. QT5_HOSTBINS = $(shell pkg-config --variable=host_bins Qt5Core)
  236. MOC_QT5 ?= $(QT5_HOSTBINS)/moc
  237. RCC_QT5 ?= $(QT5_HOSTBINS)/rcc
  238. UIC_QT5 ?= $(QT5_HOSTBINS)/uic
  239. ifeq (,$(wildcard $(MOC_QT5)))
  240. HAVE_QT5=false
  241. endif
  242. ifeq (,$(wildcard $(RCC_QT5)))
  243. HAVE_QT5=false
  244. endif
  245. endif
  246. ifeq ($(HAVE_QT4),true)
  247. HAVE_QT=true
  248. endif
  249. ifeq ($(HAVE_QT5),true)
  250. HAVE_QT=true
  251. endif
  252. ifeq ($(WIN32),true)
  253. HAVE_QT=true
  254. endif
  255. # ---------------------------------------------------------------------------------------------------------------------
  256. # Set PyQt tools
  257. PYRCC5 ?= $(shell which pyrcc5 2>/dev/null)
  258. PYUIC5 ?= $(shell which pyuic5 2>/dev/null)
  259. ifneq ($(PYUIC5),)
  260. ifneq ($(PYRCC5),)
  261. HAVE_PYQT=true
  262. endif
  263. endif
  264. # ---------------------------------------------------------------------------------------------------------------------
  265. # Set PyQt tools, part2
  266. PYRCC ?= $(PYRCC5)
  267. PYUIC ?= $(PYUIC5)
  268. ifeq ($(HAVE_QT5),true)
  269. HAVE_THEME = true
  270. endif
  271. # ---------------------------------------------------------------------------------------------------------------------
  272. # Set base defines
  273. ifeq ($(HAVE_DGL),true)
  274. BASE_FLAGS += -DHAVE_DGL
  275. BASE_FLAGS += -DDGL_NAMESPACE=CarlaDGL -DDGL_FILE_BROWSER_DISABLED -DDGL_NO_SHARED_RESOURCES
  276. endif
  277. ifeq ($(HAVE_FLUIDSYNTH),true)
  278. BASE_FLAGS += -DHAVE_FLUIDSYNTH
  279. endif
  280. ifeq ($(HAVE_FFMPEG),true)
  281. BASE_FLAGS += -DHAVE_FFMPEG
  282. endif
  283. ifeq ($(HAVE_HYLIA),true)
  284. BASE_FLAGS += -DHAVE_HYLIA
  285. endif
  286. ifeq ($(HAVE_LIBLO),true)
  287. BASE_FLAGS += -DHAVE_LIBLO
  288. endif
  289. ifeq ($(HAVE_LIBMAGIC),true)
  290. BASE_FLAGS += -DHAVE_LIBMAGIC
  291. endif
  292. ifeq ($(HAVE_PYQT),true)
  293. BASE_FLAGS += -DHAVE_PYQT
  294. endif
  295. ifeq ($(HAVE_SNDFILE),true)
  296. BASE_FLAGS += -DHAVE_SNDFILE
  297. endif
  298. ifeq ($(HAVE_X11),true)
  299. BASE_FLAGS += -DHAVE_X11
  300. endif
  301. ifeq ($(USING_JUCE),true)
  302. BASE_FLAGS += -DUSING_JUCE
  303. endif
  304. # ---------------------------------------------------------------------------------------------------------------------
  305. # Set libs stuff (part 1)
  306. ifeq ($(LINUX_OR_MACOS),true)
  307. LIBDL_LIBS = -ldl
  308. endif
  309. ifeq ($(WIN32),true)
  310. PKG_CONFIG_FLAGS = --static
  311. endif
  312. ifeq ($(HAVE_DGL),true)
  313. ifeq ($(MACOS),true)
  314. DGL_LIBS = -framework OpenGL -framework Cocoa
  315. endif
  316. ifeq ($(WIN32),true)
  317. DGL_LIBS = -lopengl32 -lgdi32
  318. endif
  319. ifneq ($(MACOS_OR_WIN32),true)
  320. DGL_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags gl x11)
  321. DGL_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs gl x11)
  322. endif
  323. endif
  324. ifeq ($(HAVE_LIBLO),true)
  325. LIBLO_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags liblo)
  326. LIBLO_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs liblo)
  327. endif
  328. ifeq ($(HAVE_LIBMAGIC),true)
  329. MAGIC_LIBS += -lmagic
  330. ifeq ($(LINUX_OR_MACOS),true)
  331. MAGIC_LIBS += -lz
  332. endif
  333. endif
  334. ifeq ($(HAVE_FFMPEG),true)
  335. FFMPEG_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags libavcodec libavformat libavutil)
  336. FFMPEG_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libavcodec libavformat libavutil)
  337. endif
  338. ifeq ($(HAVE_FLUIDSYNTH),true)
  339. FLUIDSYNTH_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags fluidsynth)
  340. FLUIDSYNTH_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs fluidsynth)
  341. endif
  342. ifeq ($(HAVE_JACK),true)
  343. JACK_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags jack)
  344. JACK_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs jack)
  345. JACK_LIBDIR = $(shell pkg-config --variable=libdir jack)/jack
  346. endif
  347. ifeq ($(HAVE_SNDFILE),true)
  348. SNDFILE_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags sndfile)
  349. SNDFILE_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs sndfile)
  350. endif
  351. ifeq ($(HAVE_X11),true)
  352. X11_FLAGS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags x11)
  353. X11_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  354. endif
  355. # ---------------------------------------------------------------------------------------------------------------------
  356. # Set libs stuff (part 2)
  357. ifneq ($(USING_JUCE),true)
  358. RTAUDIO_FLAGS = -DHAVE_GETTIMEOFDAY
  359. RTMIDI_FLAGS =
  360. ifeq ($(DEBUG),true)
  361. RTAUDIO_FLAGS += -D__RTAUDIO_DEBUG__
  362. RTMIDI_FLAGS += -D__RTMIDI_DEBUG__
  363. endif
  364. ifeq ($(UNIX),true)
  365. RTAUDIO_FLAGS += -D__UNIX_JACK__
  366. ifeq ($(HAVE_PULSEAUDIO),true)
  367. RTAUDIO_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags libpulse-simple) -D__UNIX_PULSE__
  368. RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs libpulse-simple)
  369. endif
  370. endif
  371. endif # USING_JUCE
  372. ifeq ($(BSD),true)
  373. JACKBRIDGE_LIBS = -lpthread -lrt
  374. LILV_LIBS = -lm -lrt
  375. RTMEMPOOL_LIBS = -lpthread
  376. WATER_LIBS = -lpthread -lrt
  377. endif
  378. ifeq ($(HAIKU),true)
  379. JACKBRIDGE_LIBS = -lpthread
  380. LILV_LIBS = -lm
  381. RTMEMPOOL_LIBS = -lpthread
  382. WATER_LIBS = -lpthread
  383. endif
  384. ifeq ($(HURD),true)
  385. JACKBRIDGE_LIBS = -ldl -lpthread -lrt
  386. LILV_LIBS = -ldl -lm -lrt
  387. RTMEMPOOL_LIBS = -lpthread -lrt
  388. WATER_LIBS = -ldl -lpthread -lrt
  389. endif
  390. ifeq ($(LINUX),true)
  391. HYLIA_FLAGS = -DLINK_PLATFORM_LINUX=1
  392. JACKBRIDGE_LIBS = -ldl -lpthread -lrt
  393. LILV_LIBS = -ldl -lm -lrt
  394. RTMEMPOOL_LIBS = -lpthread -lrt
  395. WATER_LIBS = -ldl -lpthread -lrt
  396. ifeq ($(USING_JUCE),true)
  397. JUCE_AUDIO_DEVICES_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa)
  398. JUCE_CORE_LIBS = -ldl -lpthread -lrt
  399. JUCE_EVENTS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11)
  400. JUCE_GRAPHICS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs freetype2)
  401. JUCE_GUI_BASICS_LIBS = $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs x11 xext)
  402. else
  403. ifeq ($(HAVE_ALSA),true)
  404. RTAUDIO_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LINUX_ALSA__
  405. RTAUDIO_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa) -lpthread
  406. RTMIDI_FLAGS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --cflags alsa) -D__LINUX_ALSA__
  407. RTMIDI_LIBS += $(shell pkg-config $(PKG_CONFIG_FLAGS) --libs alsa)
  408. endif
  409. endif
  410. endif
  411. ifeq ($(MACOS),true)
  412. HYLIA_FLAGS = -DLINK_PLATFORM_MACOSX=1
  413. JACKBRIDGE_LIBS = -ldl -lpthread
  414. LILV_LIBS = -ldl -lm
  415. RTMEMPOOL_LIBS = -lpthread
  416. WATER_LIBS = -framework AppKit
  417. ifeq ($(USING_JUCE),true)
  418. JUCE_AUDIO_BASICS_LIBS = -framework Accelerate
  419. JUCE_AUDIO_DEVICES_LIBS = -framework AppKit -framework AudioToolbox -framework CoreAudio -framework CoreMIDI
  420. JUCE_AUDIO_FORMATS_LIBS = -framework AudioToolbox -framework CoreFoundation
  421. JUCE_AUDIO_PROCESSORS_LIBS = -framework AudioToolbox -framework AudioUnit -framework CoreAudio -framework CoreAudioKit -framework Cocoa -framework Carbon
  422. JUCE_CORE_LIBS = -framework AppKit
  423. JUCE_EVENTS_LIBS = -framework AppKit
  424. JUCE_GRAPHICS_LIBS = -framework Cocoa -framework QuartzCore
  425. JUCE_GUI_BASICS_LIBS = -framework Cocoa
  426. else
  427. RTAUDIO_FLAGS += -D__MACOSX_CORE__
  428. RTAUDIO_LIBS += -framework CoreAudio
  429. RTMIDI_FLAGS += -D__MACOSX_CORE__
  430. RTMIDI_LIBS += -framework CoreMIDI
  431. endif
  432. endif
  433. ifeq ($(WIN32),true)
  434. HYLIA_FLAGS = -DLINK_PLATFORM_WINDOWS=1
  435. JACKBRIDGE_LIBS = -lpthread
  436. LILV_LIBS = -lm
  437. RTMEMPOOL_LIBS = -lpthread
  438. WATER_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  439. ifeq ($(USING_JUCE),true)
  440. JUCE_AUDIO_DEVICES_LIBS = -lwinmm -lole32
  441. JUCE_CORE_LIBS = -luuid -lwsock32 -lwininet -lversion -lole32 -lws2_32 -loleaut32 -limm32 -lcomdlg32 -lshlwapi -lrpcrt4 -lwinmm
  442. JUCE_GRAPHICS_LIBS = -lgdi32
  443. JUCE_GUI_BASICS_LIBS = -lgdi32 -limm32 -lcomdlg32 -lole32
  444. else
  445. RTAUDIO_FLAGS += -D__WINDOWS_ASIO__ -D__WINDOWS_DS__ -D__WINDOWS_WASAPI__
  446. RTAUDIO_LIBS += -ldsound -luuid -lksuser -lwinmm
  447. RTMIDI_FLAGS += -D__WINDOWS_MM__
  448. endif
  449. endif
  450. # ---------------------------------------------------------------------------------------------------------------------
  451. NATIVE_PLUGINS_LIBS += $(DGL_LIBS)
  452. NATIVE_PLUGINS_LIBS += $(FFMPEG_LIBS)
  453. NATIVE_PLUGINS_LIBS += $(SNDFILE_LIBS)
  454. # ---------------------------------------------------------------------------------------------------------------------
  455. # Set app extension
  456. ifeq ($(WIN32),true)
  457. APP_EXT = .exe
  458. endif
  459. # ---------------------------------------------------------------------------------------------------------------------
  460. # Set shared lib extension
  461. LIB_EXT = .so
  462. ifeq ($(MACOS),true)
  463. LIB_EXT = .dylib
  464. endif
  465. ifeq ($(WIN32),true)
  466. LIB_EXT = .dll
  467. endif
  468. BASE_FLAGS += -DCARLA_LIB_EXT=\"$(LIB_EXT)\"
  469. # ---------------------------------------------------------------------------------------------------------------------
  470. # Set static libs start & end
  471. ifneq ($(MACOS),true)
  472. LIBS_START = -Wl,--start-group
  473. LIBS_END = -Wl,--end-group
  474. endif
  475. # ---------------------------------------------------------------------------------------------------------------------
  476. # Set shared library CLI arg
  477. ifeq ($(MACOS),true)
  478. SHARED = -dynamiclib
  479. else
  480. SHARED = -shared
  481. endif
  482. # ---------------------------------------------------------------------------------------------------------------------
  483. # Set arguments used for inline 'sed'
  484. ifeq ($(BSD),true)
  485. SED_ARGS=-i '' -e
  486. else
  487. SED_ARGS=-i -e
  488. endif
  489. # ---------------------------------------------------------------------------------------------------------------------
  490. # Set command used for file symlinking
  491. LINK := ln -sf
  492. # ---------------------------------------------------------------------------------------------------------------------
  493. ifneq ($(DEBUG),true)
  494. ifneq ($(TESTBUILD),true)
  495. ifneq (,$(wildcard $(CWD)/native-plugins/external/Makefile.mk))
  496. EXTERNAL_PLUGINS = true
  497. BASE_FLAGS += -DHAVE_EXTERNAL_PLUGINS
  498. include $(CWD)/native-plugins/external/Makefile.mk
  499. endif
  500. endif
  501. endif
  502. # ---------------------------------------------------------------------------------------------------------------------