about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-01T13·22+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-02-01T13·22+0100
commit6f8aa145d43d0453d74e70d1d33cfa6e21fddf89 (patch)
tree2134bbc25098881141034143974f14c058cdd58d
parentec1738589a3aa1dd59e476de09ae2721d51b3e6e (diff)
Improve "make dist"
-rw-r--r--dist.mk11
-rw-r--r--lib.mk5
2 files changed, 10 insertions, 6 deletions
diff --git a/dist.mk b/dist.mk
index 0ce4377ae4af..794b277713d4 100644
--- a/dist.mk
+++ b/dist.mk
@@ -2,14 +2,15 @@ ifdef PACKAGE_NAME
 
 dist-name = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
 
-dist-files :=
-
-dist: $(dist-name).tar.bz2
+dist: $(dist-name).tar.bz2 $(dist-name).tar.xz
 
 $(dist-name).tar.bz2: $(dist-files)
-	$(suppress) tar cvfj $@ $(dist-files) --transform 's,^,$(dist-name)/,'
+	$(trace-gen) tar cfj $@ $(sort $(dist-files)) --transform 's,^,$(dist-name)/,'
+
+$(dist-name).tar.xz: $(dist-files)
+	$(trace-gen) tar cfJ $@ $(sort $(dist-files)) --transform 's,^,$(dist-name)/,'
 
-clean-files += $(dist-name).tar.bz2
+clean-files += $(dist-name).tar.bz2 $(dist-name).tar.xz
 
 print-top-help += echo "  dist: Generate a source distribution";
 
diff --git a/lib.mk b/lib.mk
index d930b0ef3aa5..6e02bc91299b 100644
--- a/lib.mk
+++ b/lib.mk
@@ -10,6 +10,7 @@ bin-scripts :=
 noinst-scripts :=
 man-pages :=
 install-tests :=
+dist-files :=
 OS = $(shell uname -s)
 
 
@@ -49,7 +50,6 @@ endif
 include mk/functions.mk
 include mk/tracing.mk
 include mk/clean.mk
-include mk/dist.mk
 include mk/install.mk
 include mk/libraries.mk
 include mk/programs.mk
@@ -80,6 +80,9 @@ $(foreach test, $(install-tests), $(eval $(call run-install-test,$(test))))
 $(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file))))))
 
 
+include mk/dist.mk
+
+
 .PHONY: default all man help
 
 all: $(programs-list) $(libs-list) $(jars-list) $(man-pages)