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.

632 lines
18KB

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