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.

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