summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--images/Makefile25
1 files 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