Improve "make dist"

This commit is contained in:
Eelco Dolstra 2014-02-01 14:22:08 +01:00
parent ec1738589a
commit 6f8aa145d4
2 changed files with 10 additions and 6 deletions

11
dist.mk
View file

@ -2,14 +2,15 @@ ifdef PACKAGE_NAME
dist-name = $(PACKAGE_NAME)-$(PACKAGE_VERSION) dist-name = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
dist-files := dist: $(dist-name).tar.bz2 $(dist-name).tar.xz
dist: $(dist-name).tar.bz2
$(dist-name).tar.bz2: $(dist-files) $(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)/,'
clean-files += $(dist-name).tar.bz2 $(dist-name).tar.xz: $(dist-files)
$(trace-gen) tar cfJ $@ $(sort $(dist-files)) --transform 's,^,$(dist-name)/,'
clean-files += $(dist-name).tar.bz2 $(dist-name).tar.xz
print-top-help += echo " dist: Generate a source distribution"; print-top-help += echo " dist: Generate a source distribution";

5
lib.mk
View file

@ -10,6 +10,7 @@ bin-scripts :=
noinst-scripts := noinst-scripts :=
man-pages := man-pages :=
install-tests := install-tests :=
dist-files :=
OS = $(shell uname -s) OS = $(shell uname -s)
@ -49,7 +50,6 @@ endif
include mk/functions.mk include mk/functions.mk
include mk/tracing.mk include mk/tracing.mk
include mk/clean.mk include mk/clean.mk
include mk/dist.mk
include mk/install.mk include mk/install.mk
include mk/libraries.mk include mk/libraries.mk
include mk/programs.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)))))) $(foreach file, $(man-pages), $(eval $(call install-data-in, $(file), $(mandir)/man$(patsubst .%,%,$(suffix $(file))))))
include mk/dist.mk
.PHONY: default all man help .PHONY: default all man help
all: $(programs-list) $(libs-list) $(jars-list) $(man-pages) all: $(programs-list) $(libs-list) $(jars-list) $(man-pages)