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.

587 lines
16KB

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