summaryrefslogtreecommitdiff
path: root/Make.rules
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-05-27 14:46:38 +0300
committerTimo Teras <timo.teras@iki.fi>2009-05-27 14:46:48 +0300
commit9c4fdf9ead1a6b694e0b96c3d04d2bc4939daca8 (patch)
tree58ac33ee2aad6ab224fb9250d3f59e44fb9953fe /Make.rules
parentc8c985136950eee7f6748593d6fdf31eea7f8493 (diff)
downloadapk-tools-9c4fdf9ead1a6b694e0b96c3d04d2bc4939daca8.tar.gz
apk-tools-9c4fdf9ead1a6b694e0b96c3d04d2bc4939daca8.tar.bz2
apk-tools-9c4fdf9ead1a6b694e0b96c3d04d2bc4939daca8.tar.xz
apk-tools-9c4fdf9ead1a6b694e0b96c3d04d2bc4939daca8.zip
build: create archive directly from git tree
So we don't get local modifications or extra files in the tarball.
Diffstat (limited to 'Make.rules')
-rw-r--r--Make.rules19
1 files changed, 15 insertions, 4 deletions
diff --git a/Make.rules b/Make.rules
index 81881a7..fce3a77 100644
--- a/Make.rules
+++ b/Make.rules
@@ -49,8 +49,7 @@ export srctree objtree
GIT_REV := $(shell test -d .git && git describe || echo exported)
ifneq ($(GIT_REV), exported)
-FULL_VERSION := $(patsubst $(PACKAGE)-%,%,$(GIT_REV))
-FULL_VERSION := $(patsubst v%,%,$(FULL_VERSION))
+FULL_VERSION := $(patsubst $(TAGPREFIX)%,%,$(GIT_REV))
else
FULL_VERSION := $(VERSION)
endif
@@ -172,8 +171,9 @@ if_changed_rule = $(if $(strip $(any-prereq) $(arg-check) ), \
#####
# Handle options to gcc.
-c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS_ALL) $(CFLAGS_$(notdir $@))
-ld_flags = $(LDFLAGS_ALL) $(LDFLAGS_$(notdir $@))
+c_flags = -Wp,-MD,$(depfile),-MT,$@ $(CFLAGS_ALL) $(CFLAGS_EXTRA) \
+ $(CFLAGS_$(notdir $@))
+ld_flags = $(LDFLAGS_ALL) $(LDFLAGS_EXTRA) $(LDFLAGS_$(notdir $@))
#####
# Compile c-files.
@@ -252,6 +252,17 @@ ifeq ($(toplevelrun),yes)
endif
$(Q)rm -rf $(addprefix $(obj)/,$(sort $(progs-y) $(progs-n) $(progs-)))
+ifeq ($(origin VERSION),command line)
+DIST_VERSION=$(VERSION)
+else
+DIST_VERSION=$(FULL_VERSION)
+endif
+
+dist:
+ git archive --format tar --prefix=$(PACKAGE)-$(DIST_VERSION)/ \
+ $(TAGPREFIX)$(DIST_VERSION) \
+ | bzip2 -9 > $(PACKAGE)-$(DIST_VERSION).tar.bz2
+
FORCE:
# Read all saved command lines and dependencies for the $(targets) we