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 17KB

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