]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - Makefile
bcachefs-tools: add tarball make target
[bcachefs-tools-debian] / Makefile
index b0066666c8ea69dd45dddf51c75ae69511f3aebf..49f06cf6b4702df30f2f36359b9f524e74e7b772 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -181,7 +181,7 @@ install: bcachefs lib
 .PHONY: clean
 clean:
        @echo "Cleaning all"
-       $(Q)$(RM) bcachefs mount.bcachefs libbcachefs_mount.a tests/test_helper .version $(OBJS) $(DEPS) $(DOCGENERATED)
+       $(Q)$(RM) bcachefs mount.bcachefs libbcachefs_mount.a tests/test_helper .version *.tar.xz $(OBJS) $(DEPS) $(DOCGENERATED)
        $(Q)$(RM) -rf rust-src/*/target
 
 .PHONY: deb
@@ -240,3 +240,20 @@ update-bcachefs-sources:
 .PHONY: update-commit-bcachefs-sources
 update-commit-bcachefs-sources: update-bcachefs-sources
        git commit -m "Update bcachefs sources to $(shell git -C $(LINUX_DIR) show --oneline --no-patch)"
+
+SRCTARXZ = bcachefs-tools-$(VERSION).tar.xz
+SRCDIR=bcachefs-tools-$(VERSION)
+
+.PHONY: tarball
+tarball: $(SRCTARXZ)
+
+$(SRCTARXZ) : .gitcensus
+       $(Q)tar --transform "s,^,$(SRCDIR)/," -Jcf $(SRCDIR).tar.xz  \
+           `cat .gitcensus` 
+       @echo Wrote: $@
+
+.PHONY: .gitcensus
+.gitcensus:
+       $(Q)if test -d .git; then \
+         git ls-files > .gitcensus; \
+       fi