summaryrefslogtreecommitdiff
path: root/include/scan-build.mk
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2021-03-23 23:49:46 +0000
committerSteve McIntyre <steve@einval.com>2021-03-23 23:49:46 +0000
commit1251a7ba86fc40a6aad8b4fecdbca2b61808d9fa (patch)
tree2125fda549aaca55cb49a48d54be77dec7fbf3df /include/scan-build.mk
parent85b409232ce89b34626df9d72abedf5d4f5ccef6 (diff)
parent031e5cce385d3f96b1caa1d53495332a7eb03749 (diff)
downloadefi-boot-shim-debian/15.3-1.tar.gz
efi-boot-shim-debian/15.3-1.zip
Update upstream source from tag 'upstream/15.3'debian/15.3-1
Update to upstream version '15.3' with Debian dir 1b484f1c1ac270604a5a1451b34de4b0865c6211
Diffstat (limited to 'include/scan-build.mk')
-rw-r--r--include/scan-build.mk38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/scan-build.mk b/include/scan-build.mk
new file mode 100644
index 00000000..3ed7660e
--- /dev/null
+++ b/include/scan-build.mk
@@ -0,0 +1,38 @@
+SCAN_BUILD ?= $(shell x=$$(which --skip-alias --skip-functions scan-build 2>/dev/null) ; [ -n "$$x" ] && echo "$$x")
+
+scan-test : ; $(if $(findstring /,$(SCAN_BUILD)),,$(error scan-build not found))
+
+define prop
+$(if $(findstring undefined,$(origin $(1))),,$(1)="$($1)")
+endef
+
+PROPOGATE_MAKE_FLAGS = ARCH ARCH_SUFFIX COLOR CC COMPILER CROSS_COMPILE DASHJ
+
+MAKEARGS = $(foreach x,$(PROPOGATE_MAKE_FLAGS),$(call prop,$(x)))
+
+scan-clean :
+ @if [[ -d scan-results ]]; then rm -rf scan-results && echo "removed 'scan-results'"; fi
+
+scan : | scan-test
+scan : clean-shim-objs clean-cryptlib-objs scan-build-no-openssl
+
+scan-build-unchecked-cryptlib : Cryptlib/libcryptlib.a
+
+scan-build-unchecked-openssl : Cryptlib/OpenSSL/libopenssl.a
+
+scan-build-all : CCACHE_DISABLE=1
+scan-build-all : COMPILER=clang
+scan-build-all : | scan-test
+scan-build-all :
+ +scan-build -o scan-results make $(MAKEARGS) $(DASHJ) CCACHE_DISABLE=1 all
+
+scan-build-no-openssl : | scan-test
+scan-build-no-openssl : clean-shim-objs clean-cryptlib-objs scan-build-unchecked-openssl scan-build-all
+
+scan-build-no-cryptlib : | scan-test
+scan-build-no-cryptlib : clean-shim-objs scan-build-unchecked-cryptlib scan-build-unchecked-openssl scan-build-all
+
+scan-all : | scan-test
+scan-all : clean scan-build-all
+
+.PHONY : scan-build scan-clean