DISTRHO Plugin Framework
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.

643 lines
17KB

  1. #!/usr/bin/make -f
  2. # Makefile for DPF #
  3. # ---------------- #
  4. # Created by falkTX
  5. #
  6. AR ?= ar
  7. CC ?= gcc
  8. CXX ?= g++
  9. # ---------------------------------------------------------------------------------------------------------------------
  10. # Protect against multiple inclusion
  11. ifneq ($(DPF_MAKEFILE_BASE_INCLUDED),true)
  12. DPF_MAKEFILE_BASE_INCLUDED = true
  13. # ---------------------------------------------------------------------------------------------------------------------
  14. # Auto-detect OS if not defined
  15. TARGET_MACHINE := $(shell $(CC) -dumpmachine)
  16. ifneq ($(BSD),true)
  17. ifneq ($(HAIKU),true)
  18. ifneq ($(HURD),true)
  19. ifneq ($(LINUX),true)
  20. ifneq ($(MACOS),true)
  21. ifneq ($(WASM),true)
  22. ifneq ($(WINDOWS),true)
  23. ifneq (,$(findstring bsd,$(TARGET_MACHINE)))
  24. BSD = true
  25. else ifneq (,$(findstring haiku,$(TARGET_MACHINE)))
  26. HAIKU = true
  27. else ifneq (,$(findstring linux,$(TARGET_MACHINE)))
  28. LINUX = true
  29. else ifneq (,$(findstring gnu,$(TARGET_MACHINE)))
  30. HURD = true
  31. else ifneq (,$(findstring apple,$(TARGET_MACHINE)))
  32. MACOS = true
  33. else ifneq (,$(findstring mingw,$(TARGET_MACHINE)))
  34. WINDOWS = true
  35. else ifneq (,$(findstring msys,$(TARGET_MACHINE)))
  36. WINDOWS = true
  37. else ifneq (,$(findstring wasm,$(TARGET_MACHINE)))
  38. WASM = true
  39. else ifneq (,$(findstring windows,$(TARGET_MACHINE)))
  40. WINDOWS = true
  41. endif
  42. endif # WINDOWS
  43. endif # WASM
  44. endif # MACOS
  45. endif # LINUX
  46. endif # HURD
  47. endif # HAIKU
  48. endif # BSD
  49. # ---------------------------------------------------------------------------------------------------------------------
  50. # Auto-detect the processor
  51. TARGET_PROCESSOR := $(firstword $(subst -, ,$(TARGET_MACHINE)))
  52. ifneq (,$(filter i%86,$(TARGET_PROCESSOR)))
  53. CPU_I386 = true
  54. CPU_I386_OR_X86_64 = true
  55. endif
  56. ifneq (,$(filter wasm32,$(TARGET_PROCESSOR)))
  57. CPU_I386 = true
  58. CPU_I386_OR_X86_64 = true
  59. endif
  60. ifneq (,$(filter x86_64,$(TARGET_PROCESSOR)))
  61. CPU_X86_64 = true
  62. CPU_I386_OR_X86_64 = true
  63. endif
  64. ifneq (,$(filter arm%,$(TARGET_PROCESSOR)))
  65. CPU_ARM = true
  66. CPU_ARM_OR_AARCH64 = true
  67. endif
  68. ifneq (,$(filter arm64%,$(TARGET_PROCESSOR)))
  69. CPU_ARM64 = true
  70. CPU_ARM_OR_AARCH64 = true
  71. endif
  72. ifneq (,$(filter aarch64%,$(TARGET_PROCESSOR)))
  73. CPU_AARCH64 = true
  74. CPU_ARM_OR_AARCH64 = true
  75. endif
  76. # ---------------------------------------------------------------------------------------------------------------------
  77. # Set PKG_CONFIG (can be overridden by environment variable)
  78. ifeq ($(WASM),true)
  79. # Skip on wasm by default
  80. PKG_CONFIG ?= false
  81. else ifeq ($(WINDOWS),true)
  82. # Build statically on Windows by default
  83. PKG_CONFIG ?= pkg-config --static
  84. else
  85. PKG_CONFIG ?= pkg-config
  86. endif
  87. # ---------------------------------------------------------------------------------------------------------------------
  88. # Set cross compiling flag
  89. ifeq ($(WASM),true)
  90. CROSS_COMPILING = true
  91. endif
  92. # ---------------------------------------------------------------------------------------------------------------------
  93. # Set LINUX_OR_MACOS
  94. ifeq ($(LINUX),true)
  95. LINUX_OR_MACOS = true
  96. endif
  97. ifeq ($(MACOS),true)
  98. LINUX_OR_MACOS = true
  99. endif
  100. # ---------------------------------------------------------------------------------------------------------------------
  101. # Set MACOS_OR_WINDOWS, MACOS_OR_WASM_OR_WINDOWS, HAIKU_OR_MACOS_OR_WINDOWS and HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS
  102. ifeq ($(HAIKU),true)
  103. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  104. HAIKU_OR_MACOS_OR_WINDOWS = true
  105. endif
  106. ifeq ($(MACOS),true)
  107. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  108. HAIKU_OR_MACOS_OR_WINDOWS = true
  109. MACOS_OR_WASM_OR_WINDOWS = true
  110. MACOS_OR_WINDOWS = true
  111. endif
  112. ifeq ($(WASM),true)
  113. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  114. MACOS_OR_WASM_OR_WINDOWS = true
  115. endif
  116. ifeq ($(WINDOWS),true)
  117. HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS = true
  118. HAIKU_OR_MACOS_OR_WINDOWS = true
  119. MACOS_OR_WASM_OR_WINDOWS = true
  120. MACOS_OR_WINDOWS = true
  121. endif
  122. # ---------------------------------------------------------------------------------------------------------------------
  123. # Set UNIX
  124. ifeq ($(BSD),true)
  125. UNIX = true
  126. endif
  127. ifeq ($(HURD),true)
  128. UNIX = true
  129. endif
  130. ifeq ($(LINUX),true)
  131. UNIX = true
  132. endif
  133. ifeq ($(MACOS),true)
  134. UNIX = true
  135. endif
  136. # ---------------------------------------------------------------------------------------------------------------------
  137. # Set build and link flags
  138. BASE_FLAGS = -Wall -Wextra -pipe -MD -MP
  139. BASE_OPTS = -O3 -ffast-math -fdata-sections -ffunction-sections
  140. ifeq ($(CPU_I386_OR_X86_64),true)
  141. BASE_OPTS += -mtune=generic
  142. ifeq ($(WASM),true)
  143. BASE_OPTS += -msse -msse2 -msse3 -msimd128
  144. else
  145. BASE_OPTS += -msse -msse2 -mfpmath=sse
  146. endif
  147. endif
  148. ifeq ($(CPU_ARM),true)
  149. ifneq ($(CPU_ARM64),true)
  150. BASE_OPTS += -mfpu=neon-vfpv4 -mfloat-abi=hard
  151. endif
  152. endif
  153. ifeq ($(MACOS),true)
  154. # MacOS linker flags
  155. LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-dead_strip,-dead_strip_dylibs
  156. ifneq ($(SKIP_STRIPPING),true)
  157. LINK_OPTS += -Wl,-x
  158. endif
  159. else
  160. # Common linker flags
  161. LINK_OPTS = -fdata-sections -ffunction-sections -Wl,-O1,--gc-sections
  162. ifneq ($(WASM),true)
  163. LINK_OPTS += -Wl,--as-needed
  164. ifneq ($(SKIP_STRIPPING),true)
  165. LINK_OPTS += -Wl,--strip-all
  166. endif
  167. endif
  168. endif
  169. ifeq ($(SKIP_STRIPPING),true)
  170. BASE_FLAGS += -g
  171. endif
  172. ifeq ($(NOOPT),true)
  173. # Non-CPU-specific optimization flags
  174. BASE_OPTS = -O2 -ffast-math -fdata-sections -ffunction-sections
  175. endif
  176. ifneq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  177. ifneq ($(BSD),true)
  178. BASE_FLAGS += -fno-gnu-unique
  179. endif
  180. endif
  181. ifeq ($(WINDOWS),true)
  182. # Assume we want posix
  183. BASE_FLAGS += -posix -D__STDC_FORMAT_MACROS=1 -D__USE_MINGW_ANSI_STDIO=1
  184. # Needed for windows, see https://github.com/falkTX/Carla/issues/855
  185. BASE_FLAGS += -mstackrealign
  186. else
  187. # Not needed for Windows
  188. BASE_FLAGS += -fPIC -DPIC
  189. endif
  190. ifeq ($(DEBUG),true)
  191. BASE_FLAGS += -DDEBUG -O0 -g
  192. LINK_OPTS =
  193. ifeq ($(WASM),true)
  194. LINK_OPTS += -sASSERTIONS=1
  195. endif
  196. else
  197. BASE_FLAGS += -DNDEBUG $(BASE_OPTS) -fvisibility=hidden
  198. CXXFLAGS += -fvisibility-inlines-hidden
  199. endif
  200. ifeq ($(STATIC_BUILD),true)
  201. BASE_FLAGS += -DSTATIC_BUILD
  202. # LINK_OPTS += -static
  203. endif
  204. ifeq ($(WITH_LTO),true)
  205. BASE_FLAGS += -fno-strict-aliasing -flto
  206. LINK_OPTS += -fno-strict-aliasing -flto -Werror=odr -Werror=lto-type-mismatch
  207. endif
  208. BUILD_C_FLAGS = $(BASE_FLAGS) -std=gnu99 $(CFLAGS)
  209. BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=gnu++11 $(CXXFLAGS)
  210. LINK_FLAGS = $(LINK_OPTS) $(LDFLAGS)
  211. ifeq ($(WASM),true)
  212. # Special flag for emscripten
  213. LINK_FLAGS += -sLLD_REPORT_UNDEFINED
  214. else ifneq ($(MACOS),true)
  215. # Not available on MacOS
  216. LINK_FLAGS += -Wl,--no-undefined
  217. endif
  218. ifeq ($(MACOS_OLD),true)
  219. BUILD_CXX_FLAGS = $(BASE_FLAGS) $(CXXFLAGS) -DHAVE_CPP11_SUPPORT=0
  220. endif
  221. ifeq ($(WASM_EXCEPTIONS),true)
  222. BUILD_CXX_FLAGS += -fexceptions
  223. LINK_FLAGS += -fexceptions
  224. endif
  225. ifeq ($(WINDOWS),true)
  226. # Always build statically on windows
  227. LINK_FLAGS += -static -static-libgcc -static-libstdc++
  228. endif
  229. # ---------------------------------------------------------------------------------------------------------------------
  230. # Strict test build
  231. ifeq ($(TESTBUILD),true)
  232. BASE_FLAGS += -Werror -Wcast-qual -Wconversion -Wformat -Wformat-security -Wredundant-decls -Wshadow -Wstrict-overflow -fstrict-overflow -Wundef -Wwrite-strings
  233. BASE_FLAGS += -Wpointer-arith -Wabi=98 -Winit-self -Wuninitialized -Wstrict-overflow=5
  234. # BASE_FLAGS += -Wfloat-equal
  235. ifeq ($(CC),clang)
  236. BASE_FLAGS += -Wdocumentation -Wdocumentation-unknown-command
  237. BASE_FLAGS += -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded -Wno-exit-time-destructors -Wno-float-equal
  238. else
  239. BASE_FLAGS += -Wcast-align -Wunsafe-loop-optimizations
  240. endif
  241. ifneq ($(MACOS),true)
  242. BASE_FLAGS += -Wmissing-declarations -Wsign-conversion
  243. ifneq ($(CC),clang)
  244. BASE_FLAGS += -Wlogical-op
  245. endif
  246. endif
  247. CFLAGS += -Wold-style-definition -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes
  248. CXXFLAGS += -Weffc++ -Wnon-virtual-dtor -Woverloaded-virtual
  249. endif
  250. # ---------------------------------------------------------------------------------------------------------------------
  251. # Check for required libraries
  252. HAVE_CAIRO = $(shell $(PKG_CONFIG) --exists cairo && echo true)
  253. ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  254. HAVE_OPENGL = true
  255. else
  256. HAVE_OPENGL = $(shell $(PKG_CONFIG) --exists gl && echo true)
  257. HAVE_DBUS = $(shell $(PKG_CONFIG) --exists dbus-1 && echo true)
  258. HAVE_X11 = $(shell $(PKG_CONFIG) --exists x11 && echo true)
  259. HAVE_XCURSOR = $(shell $(PKG_CONFIG) --exists xcursor && echo true)
  260. HAVE_XEXT = $(shell $(PKG_CONFIG) --exists xext && echo true)
  261. HAVE_XRANDR = $(shell $(PKG_CONFIG) --exists xrandr && echo true)
  262. endif
  263. # Vulkan is not supported yet
  264. # HAVE_VULKAN = $(shell $(PKG_CONFIG) --exists vulkan && echo true)
  265. # ---------------------------------------------------------------------------------------------------------------------
  266. # Check for optional libraries
  267. HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
  268. ifeq ($(SKIP_RTAUDIO_FALLBACK),true)
  269. CXXFLAGS += -DDPF_JACK_STANDALONE_SKIP_RTAUDIO_FALLBACK
  270. else
  271. ifeq ($(MACOS),true)
  272. HAVE_RTAUDIO = true
  273. else ifeq ($(WINDOWS),true)
  274. HAVE_RTAUDIO = true
  275. else
  276. HAVE_ALSA = $(shell $(PKG_CONFIG) --exists alsa && echo true)
  277. HAVE_PULSEAUDIO = $(shell $(PKG_CONFIG) --exists libpulse-simple && echo true)
  278. ifeq ($(HAVE_ALSA),true)
  279. HAVE_RTAUDIO = true
  280. else ifeq ($(HAVE_PULSEAUDIO),true)
  281. HAVE_RTAUDIO = true
  282. endif
  283. endif
  284. endif
  285. # backwards compat, always available/enabled
  286. HAVE_JACK = true
  287. # ---------------------------------------------------------------------------------------------------------------------
  288. # Set Generic DGL stuff
  289. ifeq ($(HAIKU),true)
  290. DGL_SYSTEM_LIBS += -lbe
  291. else ifeq ($(MACOS),true)
  292. DGL_SYSTEM_LIBS += -framework Cocoa -framework CoreVideo
  293. else ifeq ($(WASM),true)
  294. else ifeq ($(WINDOWS),true)
  295. DGL_SYSTEM_LIBS += -lgdi32 -lcomdlg32
  296. # -lole32
  297. else
  298. ifeq ($(HAVE_DBUS),true)
  299. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags dbus-1) -DHAVE_DBUS
  300. DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs dbus-1)
  301. endif
  302. ifeq ($(HAVE_X11),true)
  303. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags x11) -DHAVE_X11
  304. DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs x11)
  305. ifeq ($(HAVE_XCURSOR),true)
  306. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags xcursor) -DHAVE_XCURSOR
  307. DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs xcursor)
  308. endif
  309. ifeq ($(HAVE_XEXT),true)
  310. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags xext) -DHAVE_XEXT -DHAVE_XSYNC
  311. DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs xext)
  312. endif
  313. ifeq ($(HAVE_XRANDR),true)
  314. DGL_FLAGS += $(shell $(PKG_CONFIG) --cflags xrandr) -DHAVE_XRANDR
  315. DGL_SYSTEM_LIBS += $(shell $(PKG_CONFIG) --libs xrandr)
  316. endif
  317. endif
  318. endif
  319. # ---------------------------------------------------------------------------------------------------------------------
  320. # Set Cairo specific stuff
  321. ifeq ($(HAVE_CAIRO),true)
  322. DGL_FLAGS += -DHAVE_CAIRO
  323. CAIRO_FLAGS = $(shell $(PKG_CONFIG) --cflags cairo)
  324. CAIRO_LIBS = $(shell $(PKG_CONFIG) --libs cairo)
  325. HAVE_CAIRO_OR_OPENGL = true
  326. endif
  327. # ---------------------------------------------------------------------------------------------------------------------
  328. # Set OpenGL specific stuff
  329. ifeq ($(HAVE_OPENGL),true)
  330. DGL_FLAGS += -DHAVE_OPENGL
  331. ifeq ($(HAIKU),true)
  332. OPENGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl)
  333. OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl)
  334. else ifeq ($(MACOS),true)
  335. OPENGL_FLAGS = -DGL_SILENCE_DEPRECATION=1 -Wno-deprecated-declarations
  336. OPENGL_LIBS = -framework OpenGL
  337. else ifeq ($(WASM),true)
  338. ifneq ($(USE_GLES2),true)
  339. ifneq ($(USE_GLES3),true)
  340. OPENGL_LIBS = -sLEGACY_GL_EMULATION -sGL_UNSAFE_OPTS=0
  341. endif
  342. endif
  343. else ifeq ($(WINDOWS),true)
  344. OPENGL_LIBS = -lopengl32
  345. else
  346. OPENGL_FLAGS = $(shell $(PKG_CONFIG) --cflags gl x11)
  347. OPENGL_LIBS = $(shell $(PKG_CONFIG) --libs gl x11)
  348. endif
  349. HAVE_CAIRO_OR_OPENGL = true
  350. endif
  351. # ---------------------------------------------------------------------------------------------------------------------
  352. # Set Stub specific stuff
  353. ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  354. HAVE_STUB = true
  355. else
  356. HAVE_STUB = $(HAVE_X11)
  357. endif
  358. # ---------------------------------------------------------------------------------------------------------------------
  359. # Set Vulkan specific stuff
  360. ifeq ($(HAVE_VULKAN),true)
  361. DGL_FLAGS += -DHAVE_VULKAN
  362. VULKAN_FLAGS = $(shell $(PKG_CONFIG) --cflags vulkan)
  363. VULKAN_LIBS = $(shell $(PKG_CONFIG) --libs vulkan)
  364. ifneq ($(WINDOWS),true)
  365. VULKAN_LIBS += -ldl
  366. endif
  367. endif
  368. # ---------------------------------------------------------------------------------------------------------------------
  369. # Set optional libraries specific stuff
  370. ifeq ($(HAVE_ALSA),true)
  371. ALSA_FLAGS = $(shell $(PKG_CONFIG) --cflags alsa)
  372. ALSA_LIBS = $(shell $(PKG_CONFIG) --libs alsa)
  373. endif
  374. ifeq ($(HAVE_LIBLO),true)
  375. LIBLO_FLAGS = $(shell $(PKG_CONFIG) --cflags liblo)
  376. LIBLO_LIBS = $(shell $(PKG_CONFIG) --libs liblo)
  377. endif
  378. ifeq ($(HAVE_PULSEAUDIO),true)
  379. PULSEAUDIO_FLAGS = $(shell $(PKG_CONFIG) --cflags libpulse-simple)
  380. PULSEAUDIO_LIBS = $(shell $(PKG_CONFIG) --libs libpulse-simple)
  381. endif
  382. ifeq ($(HAVE_JACK),true)
  383. ifeq ($(STATIC_BUILD),true)
  384. JACK_FLAGS = $(shell $(PKG_CONFIG) --cflags jack)
  385. JACK_LIBS = $(shell $(PKG_CONFIG) --libs jack)
  386. endif
  387. endif
  388. ifneq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
  389. SHARED_MEMORY_LIBS = -lrt
  390. endif
  391. # ---------------------------------------------------------------------------------------------------------------------
  392. # Backwards-compatible HAVE_DGL
  393. ifeq ($(MACOS_OR_WASM_OR_WINDOWS),true)
  394. HAVE_DGL = true
  395. else ifeq ($(HAVE_OPENGL),true)
  396. HAVE_DGL = $(HAVE_X11)
  397. endif
  398. # ---------------------------------------------------------------------------------------------------------------------
  399. # Namespace flags
  400. ifneq ($(DISTRHO_NAMESPACE),)
  401. BUILD_CXX_FLAGS += -DDISTRHO_NAMESPACE=$(DISTRHO_NAMESPACE)
  402. endif
  403. ifneq ($(DGL_NAMESPACE),)
  404. BUILD_CXX_FLAGS += -DDGL_NAMESPACE=$(DGL_NAMESPACE)
  405. endif
  406. # ---------------------------------------------------------------------------------------------------------------------
  407. # Optional flags
  408. ifeq ($(NVG_DISABLE_SKIPPING_WHITESPACE),true)
  409. BUILD_CXX_FLAGS += -DNVG_DISABLE_SKIPPING_WHITESPACE
  410. endif
  411. ifneq ($(NVG_FONT_TEXTURE_FLAGS),)
  412. BUILD_CXX_FLAGS += -DNVG_FONT_TEXTURE_FLAGS=$(NVG_FONT_TEXTURE_FLAGS)
  413. endif
  414. ifeq ($(FILE_BROWSER_DISABLED),true)
  415. BUILD_CXX_FLAGS += -DDGL_FILE_BROWSER_DISABLED
  416. endif
  417. ifneq ($(WINDOWS_ICON_ID),)
  418. BUILD_CXX_FLAGS += -DDGL_WINDOWS_ICON_ID=$(WINDOWS_ICON_ID)
  419. endif
  420. ifeq ($(USE_GLES2),true)
  421. BUILD_CXX_FLAGS += -DDGL_USE_GLES -DDGL_USE_GLES2
  422. endif
  423. ifeq ($(USE_GLES3),true)
  424. BUILD_CXX_FLAGS += -DDGL_USE_GLES -DDGL_USE_GLES3
  425. endif
  426. ifeq ($(USE_OPENGL3),true)
  427. BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3
  428. endif
  429. ifeq ($(USE_NANOVG_FBO),true)
  430. BUILD_CXX_FLAGS += -DDGL_USE_NANOVG_FBO
  431. endif
  432. ifeq ($(USE_NANOVG_FREETYPE),true)
  433. BUILD_CXX_FLAGS += -DFONS_USE_FREETYPE $(shell $(PKG_CONFIG) --cflags freetype2)
  434. endif
  435. ifeq ($(USE_RGBA),true)
  436. BUILD_CXX_FLAGS += -DDGL_USE_RGBA
  437. endif
  438. # ---------------------------------------------------------------------------------------------------------------------
  439. # Set app extension
  440. ifeq ($(WASM),true)
  441. APP_EXT = .html
  442. else ifeq ($(WINDOWS),true)
  443. APP_EXT = .exe
  444. endif
  445. # ---------------------------------------------------------------------------------------------------------------------
  446. # Set shared lib extension
  447. ifeq ($(MACOS),true)
  448. LIB_EXT = .dylib
  449. else ifeq ($(WASM),true)
  450. LIB_EXT = .wasm
  451. else ifeq ($(WINDOWS),true)
  452. LIB_EXT = .dll
  453. else
  454. LIB_EXT = .so
  455. endif
  456. # ---------------------------------------------------------------------------------------------------------------------
  457. # Set shared library CLI arg
  458. ifeq ($(MACOS),true)
  459. SHARED = -dynamiclib
  460. else ifeq ($(WASM),true)
  461. SHARED = -sSIDE_MODULE=2
  462. else
  463. SHARED = -shared
  464. endif
  465. # ---------------------------------------------------------------------------------------------------------------------
  466. # Handle the verbosity switch
  467. SILENT =
  468. ifeq ($(VERBOSE),1)
  469. else ifeq ($(VERBOSE),y)
  470. else ifeq ($(VERBOSE),yes)
  471. else ifeq ($(VERBOSE),true)
  472. else
  473. SILENT = @
  474. endif
  475. # ---------------------------------------------------------------------------------------------------------------------
  476. # all needs to be first
  477. all:
  478. # ---------------------------------------------------------------------------------------------------------------------
  479. # helper to print what is available/possible to build
  480. print_available = @echo $(1): $(shell echo $($(1)) | grep -q true && echo Yes || echo No)
  481. features:
  482. @echo === Detected CPU
  483. $(call print_available,CPU_AARCH64)
  484. $(call print_available,CPU_ARM)
  485. $(call print_available,CPU_ARM64)
  486. $(call print_available,CPU_ARM_OR_AARCH64)
  487. $(call print_available,CPU_I386)
  488. $(call print_available,CPU_I386_OR_X86_64)
  489. @echo === Detected OS
  490. $(call print_available,BSD)
  491. $(call print_available,HAIKU)
  492. $(call print_available,HURD)
  493. $(call print_available,LINUX)
  494. $(call print_available,MACOS)
  495. $(call print_available,WASM)
  496. $(call print_available,WINDOWS)
  497. $(call print_available,HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS)
  498. $(call print_available,HAIKU_OR_MACOS_OR_WINDOWS)
  499. $(call print_available,LINUX_OR_MACOS)
  500. $(call print_available,MACOS_OR_WASM_OR_WINDOWS)
  501. $(call print_available,MACOS_OR_WINDOWS)
  502. $(call print_available,UNIX)
  503. @echo === Detected features
  504. $(call print_available,HAVE_ALSA)
  505. $(call print_available,HAVE_DBUS)
  506. $(call print_available,HAVE_CAIRO)
  507. $(call print_available,HAVE_DGL)
  508. $(call print_available,HAVE_LIBLO)
  509. $(call print_available,HAVE_OPENGL)
  510. $(call print_available,HAVE_PULSEAUDIO)
  511. $(call print_available,HAVE_RTAUDIO)
  512. $(call print_available,HAVE_STUB)
  513. $(call print_available,HAVE_VULKAN)
  514. $(call print_available,HAVE_X11)
  515. $(call print_available,HAVE_XCURSOR)
  516. $(call print_available,HAVE_XEXT)
  517. $(call print_available,HAVE_XRANDR)
  518. # ---------------------------------------------------------------------------------------------------------------------
  519. # Protect against multiple inclusion
  520. endif # DPF_MAKEFILE_BASE_INCLUDED
  521. # ---------------------------------------------------------------------------------------------------------------------