summaryrefslogtreecommitdiff
path: root/Make.coverity
diff options
context:
space:
mode:
authorMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
committerMathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>2018-07-24 16:24:23 -0400
commitf892ac66084ab0315adb0c52e4a39b518730d023 (patch)
tree0b41430bab3e1cf51e37476a5e6548f639cb7ec6 /Make.coverity
parent6215e920e71f5c6c43189f27b755e7a3238ad396 (diff)
downloadefi-boot-shim-upstream/15+1531942534.dd3230d.tar.gz
efi-boot-shim-upstream/15+1531942534.dd3230d.zip
New upstream version 15+1531942534.dd3230dupstream/15+1531942534.dd3230d
Diffstat (limited to 'Make.coverity')
-rw-r--r--Make.coverity48
1 files changed, 48 insertions, 0 deletions
diff --git a/Make.coverity b/Make.coverity
new file mode 100644
index 00000000..1ffeced3
--- /dev/null
+++ b/Make.coverity
@@ -0,0 +1,48 @@
+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 1)
+ifeq ($(COV_BUILD),)
+ COV_BUILD_ERROR = $(error cov-build not found)
+endif
+
+cov-test : ; $(COV_BUILD_ERROR)
+
+.PHONY : coverity cov-upload cov-clean cov-file cov-test