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.

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