+quick-test: quick-test.o $(objects) $(libs)
+ @echo " [LD] $@"
+ $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
+
+ioctl-test.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
+ @echo " [CC] $@"
+ $(Q)$(CC) $(CFLAGS) -c $< -o $@
+
+ioctl-test-32.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
+ @echo " [CC32] $@"
+ $(Q)$(CC) $(CFLAGS) -m32 -c $< -o $@
+
+ioctl-test-64.o: ioctl-test.c ioctl.h kerncompat.h ctree.h
+ @echo " [CC64] $@"
+ $(Q)$(CC) $(CFLAGS) -m64 -c $< -o $@
+
+ioctl-test: ioctl-test.o
+ @echo " [LD] $@"
+ $(Q)$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
+ @echo " ?[PAHOLE] $@.pahole"
+ -$(Q)pahole $@ > $@.pahole
+
+ioctl-test-32: ioctl-test-32.o
+ @echo " [LD32] $@"
+ $(Q)$(CC) -m32 -o $@ $< $(LDFLAGS)
+ @echo " ?[PAHOLE] $@.pahole"
+ -$(Q)pahole $@ > $@.pahole
+
+ioctl-test-64: ioctl-test-64.o
+ @echo " [LD64] $@"
+ $(Q)$(CC) -m64 -o $@ $< $(LDFLAGS)
+ @echo " ?[PAHOLE] $@.pahole"
+ -$(Q)pahole $@ > $@.pahole
+
+test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64
+ @echo " [TEST/ioctl]"
+ $(Q)./ioctl-test > ioctl-test.log
+ $(Q)./ioctl-test-32 > ioctl-test-32.log
+ $(Q)./ioctl-test-64 > ioctl-test-64.log
+
+library-test: library-test.c libbtrfs.so
+ @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
+ $(Q)mkdir -p $(TMPD)/include/btrfs && \
+ cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
+ cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(ABSTOPDIR)/,$^) -Wl,-rpath=$(ABSTOPDIR) -lbtrfs
+ @echo " [TEST RUN] $@"
+ $(Q)cd $(TMPD) && ./$@
+ @echo " [TEST CLEAN] $@"
+ $(Q)$(RM) -rf -- $(TMPD)
+
+library-test.static: library-test.c $(libs_static)
+ @echo " [TEST PREP] $@"$(eval TMPD=$(shell mktemp -d))
+ $(Q)mkdir -p $(TMPD)/include/btrfs && \
+ cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
+ cd $(TMPD) && $(CC) -I$(TMPD)/include -o $@ $(addprefix $(ABSTOPDIR)/,$^) $(STATIC_LDFLAGS) $(STATIC_LIBS)
+ @echo " [TEST RUN] $@"
+ $(Q)cd $(TMPD) && ./$@
+ @echo " [TEST CLEAN] $@"
+ $(Q)$(RM) -rf -- $(TMPD)
+
+fssum: tests/fssum.c tests/sha224-256.c