]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - Makefile
fs_usage cmd fixes
[bcachefs-tools-debian] / Makefile
index c6daadc82fb1fa57a1e74d008f7ee120e05a4fca..25de546ac5b0ec77bbc67aff765c7db7911e77db 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,6 +2,7 @@
 PREFIX?=/usr/local
 PKG_CONFIG?=pkg-config
 INSTALL=install
+PYTEST=pytest-3
 CFLAGS+=-std=gnu89 -O2 -g -MMD -Wall                           \
        -Wno-pointer-sign                                       \
        -fno-strict-aliasing                                    \
@@ -12,6 +13,7 @@ CFLAGS+=-std=gnu89 -O2 -g -MMD -Wall                          \
        -D_LGPL_SOURCE                                          \
        -DRCU_MEMBARRIER                                        \
        -DZSTD_STATIC_LINKING_ONLY                              \
+       -DFUSE_USE_VERSION=32                                   \
        -DNO_BCACHEFS_CHARDEV                                   \
        -DNO_BCACHEFS_FS                                        \
        -DNO_BCACHEFS_SYSFS                                     \
@@ -34,9 +36,14 @@ endif
 ifdef D
        CFLAGS+=-Werror
        CFLAGS+=-DCONFIG_BCACHEFS_DEBUG=y
+       CFLAGS+=-DCONFIG_VALGRIND=y
 endif
 
 PKGCONFIG_LIBS="blkid uuid liburcu libsodium zlib liblz4 libzstd"
+ifdef BCACHEFS_FUSE
+       PKGCONFIG_LIBS+="fuse3 >= 3.7"
+       CFLAGS+=-DBCACHEFS_FUSE
+endif
 
 PKGCONFIG_CFLAGS:=$(shell $(PKG_CONFIG) --cflags $(PKGCONFIG_LIBS))
 ifeq (,$(PKGCONFIG_CFLAGS))
@@ -64,12 +71,28 @@ endif
 .PHONY: all
 all: bcachefs
 
+.PHONY: tests
+tests: tests/test_helper
+
+.PHONY: check
+check: tests bcachefs
+       cd tests; $(PYTEST)
+
+.PHONY: TAGS tags
+TAGS:
+       ctags -e -R .
+
+tags:
+       ctags -R .
+
 SRCS=$(shell find . -type f -iname '*.c')
 DEPS=$(SRCS:.c=.d)
 -include $(DEPS)
 
 OBJS=$(SRCS:.c=.o)
-bcachefs: $(OBJS)
+bcachefs: $(filter-out ./tests/%.o, $(OBJS))
+
+tests/test_helper: $(filter ./tests/%.o, $(OBJS))
 
 # If the version string differs from the last build, update the last version
 ifneq ($(VERSION),$(shell cat .version 2>/dev/null))
@@ -96,7 +119,7 @@ install: bcachefs
 
 .PHONY: clean
 clean:
-       $(RM) bcachefs .version $(OBJS) $(DEPS)
+       $(RM) bcachefs tests/test_helper .version $(OBJS) $(DEPS)
 
 .PHONY: deb
 deb: all