]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - Makefile
Bring back debug makefile target
[bcachefs-tools-debian] / Makefile
index 1bc6542ada4cb275b39f225401b4e407509a3e64..6dcbc0682f5fb4725df9fbdcf541aabf418dbde8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,12 +89,13 @@ TAGS:
 tags:
        ctags -R .
 
-DOCSRC := gen.h bcachefs.5.rst
-DOCGENERATED := bcachefs.5 doc/autogen/gen.csv
-DOCDEPS := $(addprefix ./doc/autogen/,$(DOCSRC))
+DOCSRC := opts_macro.h bcachefs.5.rst.tmpl
+DOCGENERATED := bcachefs.5 doc/bcachefs.5.rst
+DOCDEPS := $(addprefix ./doc/,$(DOCSRC))
 bcachefs.5: $(DOCDEPS)  libbcachefs/opts.h
-       CC=$(CC) doc/autogen/gen.sh
-       rst2man doc/autogen/bcachefs.5.rst bcachefs.5
+       $(CC) doc/opts_macro.h -I libbcachefs -I include -E 2>/dev/null \
+               | doc/macro2rst.py
+       rst2man doc/bcachefs.5.rst bcachefs.5
 
 SRCS=$(shell find . -type f -iname '*.c')
 DEPS=$(SRCS:.c=.d)
@@ -105,6 +106,10 @@ bcachefs: $(filter-out ./tests/%.o, $(OBJS))
 
 MOUNT_SRCS=$(shell find mount/src -type f -iname '*.rs') \
     mount/Cargo.toml mount/Cargo.lock mount/build.rs
+
+debug: CFLAGS+=-Werror -DCONFIG_BCACHEFS_DEBUG=y -DCONFIG_VALGRIND=y
+debug: bcachefs
+
 libbcachefs_mount.a: $(MOUNT_SRCS)
        LIBBCACHEFS_INCLUDE=$(CURDIR) cargo build --manifest-path mount/Cargo.toml --release
        cp mount/target/release/libbcachefs_mount.a $@
@@ -156,6 +161,10 @@ update-bcachefs-sources:
        git add libbcachefs/*.[ch]
        cp $(LINUX_DIR)/include/trace/events/bcachefs.h include/trace/events/
        git add include/trace/events/bcachefs.h
+       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/