Skip to content

Commit

Permalink
Add coverity build scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jones <pjones@redhat.com>
  • Loading branch information
vathpela committed May 10, 2017
1 parent 868b42b commit 95327e6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
*.tar.*
*.rpm
core.*
cov-int
37 changes: 37 additions & 0 deletions Make.coverity
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
include $(TOPDIR)/Make.version
include $(TOPDIR)/Make.rules
include $(TOPDIR)/Make.defaults

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
cov-build --dir cov-int make 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-file cov-upload

clean : | cov-clean

.PHONY : coverity cov-upload cov-clean cov-file
2 changes: 2 additions & 0 deletions Make.defaults
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
NAME = pesign
COMMIT_ID ?= $(shell git log -1 --pretty=%H 2>/dev/null || echo master)
prefix ?= /usr/
prefix := $(abspath $(prefix))/
libdir ?= $(prefix)lib64/
Expand Down
4 changes: 4 additions & 0 deletions Make.rules
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ endef

$(TOPDIR)/libdpe/%.a $(TOPDIR)/libdpe/% :
$(MAKE) -C $(TOPDIR)/libdpe $(notdir $@)

define get-config =
$(shell git config --local --get "$(NAME).$(1)")
endef
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TOPDIR = $(realpath .)
include $(TOPDIR)/Make.version
include $(TOPDIR)/Make.rules
include $(TOPDIR)/Make.defaults
include $(TOPDIR)/Make.coverity

SUBDIRS := include libdpe src

Expand Down

0 comments on commit 95327e6

Please sign in to comment.