summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sandeen.net>2022-11-15 13:51:39 -0600
committerKent Overstreet <kent.overstreet@linux.dev>2022-11-15 14:54:13 -0500
commitd9905d97d094027e07bf38f7cc5d6cabff24b528 (patch)
tree78472b6a54ce3650848832916942d642fdce87da /Makefile
parentcde2d0e2fcc5f2a2691975b6ec6b657cd8322c6a (diff)
bcachefs-tools: add tarball make target
This makes it easy to generate a tarball, which should eventually facilitate packaging: "make tarball" Note that it's currently using the $(VERSION) from git describe which may not be ideal once point releases are happening, but that holds true for everywhere $(VERSION) is used. All tar.xz files are removed via "make clean" Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index b0066666..49f06cf6 100644
--- 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