From d67437e5db32ab9871d8efe59bec3a74647c340f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Fri, 23 Jan 2009 16:56:35 +0000 Subject: Add git support (for git-svn) to make tar --- images/Makefile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/images/Makefile b/images/Makefile index ed8f2f012..19e8756e9 100644 --- a/images/Makefile +++ b/images/Makefile @@ -19,14 +19,25 @@ images: all.kernels all.kernels: update_kernel ../kernel/list_modules.pm ./update_kernel $(KERNELS) +dist: tar tar: - rm -rf $(PRODUCT)*.tar* $(PRODUCT)-$(VERSION) - mkdir -p $(PRODUCT)-$(VERSION) - svn export -q -rBASE . $(PRODUCT)-$(VERSION)/images - svn export -q -rBASE ../kernel $(PRODUCT)-$(VERSION)/kernel - cp ../Makefile.config $(PRODUCT)-$(VERSION)/ - tar cfj $(PRODUCT)-$(VERSION).tar.bz2 $(PRODUCT)-$(VERSION) - rm -rf $(PRODUCT)-$(VERSION) + @rm -rf $(PRODUCT)*.tar* $(PRODUCT)-$(VERSION) + @if [ -e ".svn" ]; then \ + mkdir -p $(PRODUCT)-$(VERSION); \ + svn export -q -rBASE . $(PRODUCT)-$(VERSION)/images; \ + svn export -q -rBASE ../kernel $(PRODUCT)-$(VERSION)/kernel; \ + cp ../Makefile.config $(PRODUCT)-$(VERSION)/; \ + tar cfj $(PRODUCT)-$(VERSION).tar.bz2 $(PRODUCT)-$(VERSION); \ + rm -rf $(PRODUCT)-$(VERSION); \ + elif [ -e "../.git" ]; then \ + pushd .. &>/dev/null; \ + git archive --prefix=$(PRODUCT)-$(VERSION)/ HEAD images kernel Makefile.config | bzip2 >images/$(PRODUCT)-$(VERSION).tar.bz2; \ + popd &>/dev/null; \ + else \ + echo "Unknown SCM (not SVN nor GIT)";\ + exit 1; \ + fi; + $(info $(PRODUCT)-$(VERSION).tar.bz2 is ready) clean: rm -rf images isolinux all.kernels modules.description -- cgit v1.2.1