OSDN Git Service

Define strdupa if it is not defined
[android-x86/external-efivar.git] / Makefile
index 11c6df0..8c67b9d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,55 +1,83 @@
 TOPDIR = $(shell echo $$PWD)
 
+include $(TOPDIR)/Make.deprecated
+include $(TOPDIR)/Make.version
+include $(TOPDIR)/Make.rules
+include $(TOPDIR)/Make.defaults
+include $(TOPDIR)/Make.coverity
+include $(TOPDIR)/Make.scan-build
+
 SUBDIRS := src docs
-VERSION := 0.18
 
-all : $(SUBDIRS) efivar.spec
+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 $@
+
+abiupdate :
+       $(MAKE) clean all
+       $(MAKE) -C src abiclean abixml
 
 $(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
-       @rm -vf efivar.spec
+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 abiupdate
 
-.PHONY: $(SUBDIRS) all clean install test
+GITTAG = $(shell bash -c "echo $$(($(VERSION) + 1))")
 
-include $(TOPDIR)/Make.defaults
-include $(TOPDIR)/Make.rules
+efivar.spec : | Makefile Make.version
 
-efivar.spec : efivar.spec.in Makefile
-       @sed -e "s,@@VERSION@@,$(VERSION),g" $< > $@
+clean :
+       @set -e ; for x in $(SUBDIRS) ; do \
+               $(MAKE) -C $$x $@ ; \
+       done
+       @rm -vf efivar.spec
 
-GITTAG = $(VERSION)
+test-archive: abicheck efivar.spec
+       @rm -rf /tmp/efivar-$(GITTAG) /tmp/efivar-$(GITTAG)-tmp
+       @mkdir -p /tmp/efivar-$(GITTAG)-tmp
+       @git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/efivar-$(GITTAG)-tmp/ ; tar x )
+       @git diff | ( cd /tmp/efivar-$(GITTAG)-tmp/ ; patch -s -p1 -b -z .gitdiff )
+       @mv /tmp/efivar-$(GITTAG)-tmp/ /tmp/efivar-$(GITTAG)/
+       @cp efivar.spec /tmp/efivar-$(GITTAG)/
+       @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(GITTAG).tar.bz2 efivar-$(GITTAG)
+       @rm -rf /tmp/efivar-$(GITTAG)
+       @echo "The archive is in efivar-$(GITTAG).tar.bz2"
 
-test-archive: 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)/
-       @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.bz2"
+bumpver :
+       @echo VERSION=$(GITTAG) > Make.version
+       @git add Make.version
+       git commit -m "Bump version to $(GITTAG)" -s
 
 tag:
        git tag -s $(GITTAG) refs/heads/master
 
-archive: 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 )
-       @mv /tmp/efivar-$(VERSION)-tmp/ /tmp/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.bz2"
+archive: abicheck bumpver abidw tag efivar.spec
+       @rm -rf /tmp/efivar-$(GITTAG) /tmp/efivar-$(GITTAG)-tmp
+       @mkdir -p /tmp/efivar-$(GITTAG)-tmp
+       @git archive --format=tar $(GITTAG) | ( cd /tmp/efivar-$(GITTAG)-tmp/ ; tar x )
+       @mv /tmp/efivar-$(GITTAG)-tmp/ /tmp/efivar-$(GITTAG)/
+       @cp efivar.spec /tmp/efivar-$(GITTAG)/
+       @dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(GITTAG).tar.bz2 efivar-$(GITTAG)
+       @rm -rf /tmp/efivar-$(GITTAG)
+       @echo "The archive is in efivar-$(GITTAG).tar.bz2"