+ @echo "Cleaning all"
+ $(Q)$(RM) bcachefs libbcachefs.a tests/test_helper .version *.tar.xz $(OBJS) $(DEPS) $(DOCGENERATED)
+ $(Q)$(RM) -rf rust-src/*/target
+
+.PHONY: deb
+deb: all
+ debuild -us -uc -nc -b -i -I
+
+.PHONY: rpm
+rpm: clean
+ rpmbuild --build-in-place -bb --define "_version $(subst -,_,$(VERSION))" packaging/bcachefs-tools.spec
+
+bcachefs-principles-of-operation.pdf: doc/bcachefs-principles-of-operation.tex
+ pdflatex doc/bcachefs-principles-of-operation.tex
+ pdflatex doc/bcachefs-principles-of-operation.tex
+
+doc: bcachefs-principles-of-operation.pdf
+
+.PHONY: update-bcachefs-sources
+update-bcachefs-sources:
+ git rm -rf --ignore-unmatch libbcachefs
+ test -d libbcachefs || mkdir libbcachefs
+ cp $(LINUX_DIR)/fs/bcachefs/*.[ch] libbcachefs/
+ git add libbcachefs/*.[ch]
+ cp $(LINUX_DIR)/include/linux/closure.h include/linux/
+ git add include/linux/closure.h
+ cp $(LINUX_DIR)/lib/closure.c linux/
+ git add linux/closure.c
+ cp $(LINUX_DIR)/include/linux/xxhash.h include/linux/
+ git add include/linux/xxhash.h
+ cp $(LINUX_DIR)/lib/xxhash.c linux/
+ git add linux/xxhash.c
+ cp $(LINUX_DIR)/kernel/locking/six.c linux/
+ git add linux/six.c
+ cp $(LINUX_DIR)/include/linux/six.h include/linux/
+ git add include/linux/six.h
+ cp $(LINUX_DIR)/include/linux/list_nulls.h include/linux/
+ git add include/linux/list_nulls.h
+ cp $(LINUX_DIR)/include/linux/poison.h include/linux/
+ git add include/linux/poison.h
+ cp $(LINUX_DIR)/include/linux/generic-radix-tree.h include/linux/
+ git add include/linux/generic-radix-tree.h
+ cp $(LINUX_DIR)/lib/generic-radix-tree.c linux/
+ git add linux/generic-radix-tree.c
+ cp $(LINUX_DIR)/include/linux/kmemleak.h include/linux/
+ git add include/linux/kmemleak.h
+ cp $(LINUX_DIR)/lib/math/int_sqrt.c linux/
+ git add linux/int_sqrt.c
+ cp $(LINUX_DIR)/lib/math/mean_and_variance.c linux/
+ git add linux/mean_and_variance.c
+ cp $(LINUX_DIR)/include/linux/mean_and_variance.h include/linux/
+ git add include/linux/mean_and_variance.h
+ cp $(LINUX_DIR)/scripts/Makefile.compiler ./
+ git add Makefile.compiler
+ $(RM) libbcachefs/*.mod.c
+ git -C $(LINUX_DIR) rev-parse HEAD | tee .bcachefs_revision
+ git add .bcachefs_revision
+
+
+.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