summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-02-19 13:55:55 -0500
committerPeter Jones <pjones@redhat.com>2021-02-25 10:15:14 -0500
commit173ee6b0d8fc31faa961d5ca286bc40371412829 (patch)
tree16c078222da6164e52116f8f7c1cdb0cfa950e90 /include
parentde9165756c5dc0ef90508e44a151619f7a3cb27f (diff)
downloadefi-boot-shim-173ee6b0d8fc31faa961d5ca286bc40371412829.tar.gz
efi-boot-shim-173ee6b0d8fc31faa961d5ca286bc40371412829.zip
Move the coverity and scan-build makefiles out of the top directory
I'm adding even more of this stuff, and it's feeling pretty cluttered, so this moves the scan-build and coverity makefiles into include/, where we'll see them less. Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/coverity.mk45
-rw-r--r--include/scan-build.mk17
2 files changed, 62 insertions, 0 deletions
diff --git a/include/coverity.mk b/include/coverity.mk
new file mode 100644
index 00000000..a897aa0a
--- /dev/null
+++ b/include/coverity.mk
@@ -0,0 +1,45 @@
+COV_EMAIL=$(call get-config,coverity.email)
+COV_TOKEN=$(call get-config,coverity.token)
+COV_URL=$(call get-config,coverity.url)
+COV_FILE=$(NAME)-coverity-$(VERSION)-$(COMMIT_ID).tar.bz2
+
+cov-int : clean-shim-objs
+ make $(DASHJ) Cryptlib/OpenSSL/libopenssl.a Cryptlib/libcryptlib.a
+ cov-build --dir cov-int make $(DASHJ) all
+
+cov-int-all : clean
+ cov-build --dir cov-int make $(DASHJ) all
+
+cov-clean :
+ @rm -vf $(NAME)-coverity-*.tar.*
+ @if [ -d cov-int ]; then rm -rf cov-int && echo "removed 'cov-int'"; fi
+
+cov-file : | $(COV_FILE)
+
+$(COV_FILE) : | cov-int
+ tar caf $@ cov-int
+
+cov-upload :
+ @if [ -n "$(COV_URL)" ] && \
+ [ -n "$(COV_TOKEN)" ] && \
+ [ -n "$(COV_EMAIL)" ] ; \
+ then \
+ echo curl --form token=$(COV_TOKEN) --form email="$(COV_EMAIL)" --form file=@"$(COV_FILE)" --form version=$(VERSION).1 --form description="$(COMMIT_ID)" "$(COV_URL)" ; \
+ curl --form token=$(COV_TOKEN) --form email="$(COV_EMAIL)" --form file=@"$(COV_FILE)" --form version=$(VERSION).1 --form description="$(COMMIT_ID)" "$(COV_URL)" ; \
+ else \
+ echo Coverity output is in $(COV_FILE) ; \
+ fi
+
+coverity : | cov-test
+coverity : cov-int cov-file cov-upload
+
+coverity-all : | cov-test
+coverity-all : cov-int-all cov-file cov-upload
+
+clean : | cov-clean
+
+COV_BUILD ?= $(shell x=$$(which --skip-alias --skip-functions cov-build 2>/dev/null) ; [ -n "$$x" ] && echo "$$x")
+
+cov-test : ; $(if $(findstring /,$(COV_BUILD)),,$(error cov-build not found))
+
+.PHONY : coverity cov-upload cov-clean cov-file cov-test
diff --git a/include/scan-build.mk b/include/scan-build.mk
new file mode 100644
index 00000000..7697cb89
--- /dev/null
+++ b/include/scan-build.mk
@@ -0,0 +1,17 @@
+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))
+
+scan-clean :
+ @if [[ -d scan-results ]]; then rm -rf scan-results && echo "removed 'scan-results'"; fi
+
+scan-build : | scan-test
+scan-build : clean-shim-objs
+ make $(DASHJ) Cryptlib/OpenSSL/libopenssl.a Cryptlib/libcryptlib.a
+ scan-build -o scan-results make $(DASHJ) CC=clang all
+
+scan-build-all : | scan-test
+scan-build-all : clean
+ scan-build -o scan-results make $(DASHJ) CC=clang all
+
+.PHONY : scan-build scan-clean