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.

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