kvm: selftests: add cscope make target
authorAndrew Jones <drjones@redhat.com>
Tue, 18 Sep 2018 17:54:27 +0000 (19:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Oct 2018 22:26:30 +0000 (00:26 +0200)
Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/Makefile

index 734a60da977606793886d3f4ef7dc4f7545ba2be..959be146f78912aa0cd72766db403fbc6a7c068e 100644 (file)
@@ -29,7 +29,7 @@ include ../lib.mk
 
 STATIC_LIBS := $(OUTPUT)/libkvm.a
 LIBKVM_OBJ := $(patsubst %.c, $(OUTPUT)/%.o, $(LIBKVM))
-EXTRA_CLEAN += $(LIBKVM_OBJ) $(STATIC_LIBS)
+EXTRA_CLEAN += $(LIBKVM_OBJ) $(STATIC_LIBS) cscope.*
 
 x := $(shell mkdir -p $(sort $(dir $(LIBKVM_OBJ))))
 $(LIBKVM_OBJ): $(OUTPUT)/%.o: %.c
@@ -41,3 +41,12 @@ $(OUTPUT)/libkvm.a: $(LIBKVM_OBJ)
 all: $(STATIC_LIBS)
 $(TEST_GEN_PROGS): $(STATIC_LIBS)
 $(STATIC_LIBS):| khdr
+
+cscope: include_paths = $(LINUX_TOOL_INCLUDE) $(LINUX_HDR_PATH) include lib ..
+cscope:
+       $(RM) cscope.*
+       (find $(include_paths) -name '*.h' \
+               -exec realpath --relative-base=$(PWD) {} \;; \
+       find . -name '*.c' \
+               -exec realpath --relative-base=$(PWD) {} \;) | sort -u > cscope.files
+       cscope -b