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.

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