summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorThomas F Herbert <therbert@redhat.com>2017-07-18 15:48:03 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2017-07-20 20:10:09 +0000
commit8d48722b0932e7857f93c4e06ba9b2dff8bd5cad (patch)
tree7cf47e83ccbccb99365a46f930442116a0acefa5 /Makefile
parent93d84c9fc2a839cb4114dbe431a00a58f2a1b168 (diff)
Enable build from dist tarball independent of git.
This is necessary for downstream builds from source rpm. JIRA: VPP-498 Change-Id: I30ea51a19b153dc35ececbbca79b940fe4e3bc8a Signed-off-by: Thomas F Herbert <therbert@redhat.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 11 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 46c51dd891e..09a802a2c83 100644
--- a/Makefile
+++ b/Makefile
@@ -274,12 +274,17 @@ DIST_FILE = $(BR)/vpp-$(shell src/scripts/version).tar
DIST_SUBDIR = vpp-$(shell src/scripts/version|cut -f1 -d-)
dist:
- @git archive \
- --prefix=$(DIST_SUBDIR)/ \
- --format=tar \
- -o $(DIST_FILE) \
- HEAD
- @git describe > $(BR)/.version
+ @if git rev-parse 2> /dev/null ; then \
+ git archive \
+ --prefix=$(DIST_SUBDIR)/ \
+ --format=tar \
+ -o $(DIST_FILE) \
+ HEAD ; \
+ git describe > $(BR)/.version ; \
+ else \
+ (cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
+ src/scripts/version > $(BR)/.version ; \
+ fi
@tar --append \
--file $(DIST_FILE) \
--transform='s,.*/.version,$(DIST_SUBDIR)/src/scripts/.version,' \