]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - Makefile
remove Rust artifacts during `make clean`
[bcachefs-tools-debian] / Makefile
index 177ee45efe93bfd18d727c356fa79e1d3e02827b..418ffffc7e84feccddbe76cf6d6931fc211b1b49 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3.3
+VERSION=1.3.6
 
 PREFIX?=/usr/local
 PKG_CONFIG?=pkg-config
@@ -15,8 +15,10 @@ endif
 
 ifeq ($(BUILD_VERBOSE),1)
   Q =
+  CARGO_CLEAN_ARGS = --verbose
 else
   Q = @
+  CARGO_CLEAN_ARGS = --quiet
 endif
 
 CFLAGS+=-std=gnu11 -O2 -g -MMD -Wall -fPIC                     \
@@ -46,9 +48,12 @@ CARGO_ARGS=${CARGO_TOOLCHAIN}
 CARGO=cargo $(CARGO_ARGS)
 CARGO_PROFILE=release
 # CARGO_PROFILE=debug
+CARGO_MANIFEST=--manifest-path rust-src/Cargo.toml
 
 CARGO_BUILD_ARGS=--$(CARGO_PROFILE)
-CARGO_BUILD=$(CARGO) build $(CARGO_BUILD_ARGS)
+CARGO_BUILD=$(CARGO) build $(CARGO_BUILD_ARGS) $(CARGO_MANIFEST)
+
+CARGO_CLEAN=$(CARGO) clean $(CARGO_CLEAN_ARGS) $(CARGO_MANIFEST)
 
 include Makefile.compiler
 
@@ -59,6 +64,7 @@ CFLAGS+=$(call cc-disable-warning, missing-braces)
 CFLAGS+=$(call cc-disable-warning, zero-length-array)
 CFLAGS+=$(call cc-disable-warning, shift-overflow)
 CFLAGS+=$(call cc-disable-warning, enum-conversion)
+CFLAGS+=$(call cc-disable-warning, gnu-variable-sized-type-not-at-end)
 
 PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd libudev libkeyutils udev"
 ifdef BCACHEFS_FUSE
@@ -96,7 +102,7 @@ LIBDIR=$(PREFIX)/lib
 
 PKGCONFIG_SERVICEDIR:=$(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd)
 ifeq (,$(PKGCONFIG_SERVICEDIR))
-       $(warning skipping systemd integration)
+  $(warning skipping systemd integration)
 else
 BCACHEFSCK_ARGS=-f -n
 systemd_libfiles=\
@@ -176,7 +182,7 @@ libbcachefs.a: $(filter-out ./tests/%.o, $(OBJS))
 
 RUST_SRCS=$(shell find rust-src/src rust-src/bch_bindgen/src -type f -iname '*.rs')
 rust-src/target/release/libbcachefs_rust.a: $(RUST_SRCS)
-       $(CARGO_BUILD) --manifest-path rust-src/Cargo.toml
+       $(CARGO_BUILD)
 
 tests/test_helper: $(filter ./tests/%.o, $(OBJS))
        @echo "    [LD]     $@"
@@ -221,7 +227,7 @@ install_systemd: $(systemd_services) $(systemd_libfiles)
 clean:
        @echo "Cleaning all"
        $(Q)$(RM) bcachefs libbcachefs.a tests/test_helper .version *.tar.xz $(OBJS) $(DEPS) $(DOCGENERATED)
-       $(Q)$(RM) -rf rust-src/*/target
+       $(Q)$(CARGO_CLEAN)
        $(Q)$(RM) -f $(built_scripts)
 
 .PHONY: deb
@@ -269,7 +275,7 @@ update-bcachefs-sources:
        git add include/linux/kmemleak.h
        cp $(LINUX_DIR)/lib/math/int_sqrt.c linux/
        git add linux/int_sqrt.c
-       git rm libbcachefs/mean_and_variance_test.c
+       git rm -f libbcachefs/mean_and_variance_test.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/