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.

Makefile.mk 16KB

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