OSDN Git Service

Improve libabigail support a bit.
[android-x86/external-efivar.git] / Makefile
index 25b3fc4..ce8a1a6 100644 (file)
--- a/Makefile
+++ b/Makefile
 TOPDIR = $(shell echo $$PWD)
 
+include $(TOPDIR)/Make.version
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defaults
+
 SUBDIRS := src docs
-VERSION := 0.8
 
-all : $(SUBDIRS)
+all : | efivar.spec Make.version
+all :
+       @set -e ; for x in $(SUBDIRS) ; do \
+               $(MAKE) -C $$x $@ ; \
+       done
+
+install :
+       @set -e ; for x in $(SUBDIRS) ; do \
+               $(MAKE) -C $$x $@ ; \
+       done
+
+abidw abicheck efivar efivar-static static:
+       $(MAKE) -C src $@
 
 $(SUBDIRS) :
-       $(MAKE) -C $@ TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) VERSION=$(VERSION)
+       $(MAKE) -C $@
 
-clean :
-       @for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done
+brick : all
+       @set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} test ; done
 
-install :
-       @for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) VERSION=$(VERSION) DESTDIR=$(DESTDIR) includedir=$(includedir) bindir=$(bindir) libdir=$(libdir) PCDIR=$(PCDIR) $@ ; done
+a :
+       @if [ $${EUID} != 0 ]; then \
+               echo no 1>&2 ; \
+               exit 1 ; \
+       fi
 
-test : all
-       @for x in $(SUBDIRS) ; do $(MAKE) -C $${x} TOPDIR=$(TOPDIR) SRCDIR=$(TOPDIR)/$@/ ARCH=$(ARCH) $@ ; done
+.PHONY: $(SUBDIRS) a brick coverity cov-upload
 
-.PHONY: $(SUBDIRS) all clean install test
+efivar.spec : | Makefile Make.version
 
-include $(TOPDIR)/Make.defaults
-include $(TOPDIR)/Make.rules
+COV_EMAIL=$(call get-config,coverity.email)
+COV_TOKEN=$(call get-config,coverity.token)
+COV_URL=$(call get-config,coverity.url)
+COV_FILE=efivar-coverity-$(VERSION)-$(COMMIT_ID).tar.bz2
+COMMIT_ID=$(shell git log -1 --pretty=%H 2>/dev/null || echo master)
+
+cov-int : clean
+       cov-build --dir cov-int make all
+
+$(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
 
-GITTAG = $(VERSION)
+coverity : $(COV_FILE) cov-upload
 
-test-archive:
+clean :
+       @set -e ; for x in $(SUBDIRS) ; do \
+               $(MAKE) -C $$x $@ ; \
+       done
+       @rm -vf efivar.spec
+       @rm -vrf cov-int efivar-coverity-*.tar.*
+
+GITTAG = $(VERSION) + 1
+
+test-archive: abicheck efivar.spec
        @rm -rf /tmp/efivar-$(VERSION) /tmp/efivar-$(VERSION)-tmp
        @mkdir -p /tmp/efivar-$(VERSION)-tmp
        @git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/efivar-$(VERSION)-tmp/ ; tar x )
        @git diff | ( cd /tmp/efivar-$(VERSION)-tmp/ ; patch -s -p1 -b -z .gitdiff )
        @mv /tmp/efivar-$(VERSION)-tmp/ /tmp/efivar-$(VERSION)/
-       @dir=$$PWD; cd /tmp; tar -c --xz -f $$dir/efivar-$(VERSION).tar.xz efivar-$(VERSION)
+       @cp efivar.spec /tmp/efivar-$(VERSION)/
+       @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(VERSION).tar.bz2 efivar-$(VERSION)
        @rm -rf /tmp/efivar-$(VERSION)
-       @echo "The archive is in efivar-$(VERSION).tar.xz"
+       @echo "The archive is in efivar-$(VERSION).tar.bz2"
+
+bumpver :
+       echo VERSION=$(GITTAG) > Make.version
+       git add Make.version
+       git commit -m "Bump version to $(GITTAG)" -s
 
 tag:
-       git tag $(GITTAG) refs/heads/master
+       git tag -s $(GITTAG) refs/heads/master
 
-archive: tag
+archive: abicheck bumpver abidw tag efivar.spec
        @rm -rf /tmp/efivar-$(VERSION) /tmp/efivar-$(VERSION)-tmp
        @mkdir -p /tmp/efivar-$(VERSION)-tmp
-       @git archive --format=tar $(GITTAG) | ( cd /tmp/efivar-$(VERSION)-tmp/ ; tar x )
+       git archive --format=tar $(GITTAG) | ( cd /tmp/efivar-$(VERSION)-tmp/ ; tar x )
        @mv /tmp/efivar-$(VERSION)-tmp/ /tmp/efivar-$(VERSION)/
-       @dir=$$PWD; cd /tmp; tar -c --xz -f $$dir/efivar-$(VERSION).tar.xz efivar-$(VERSION)
+       @cp efivar.spec /tmp/efivar-$(VERSION)/
+       @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(VERSION).tar.bz2 efivar-$(VERSION)
        @rm -rf /tmp/efivar-$(VERSION)
-       @echo "The archive is in efivar-$(VERSION).tar.xz"
+       @echo "The archive is in efivar-$(VERSION).tar.bz2"