selftests/bpf: Re-generate vmlinux.h and BPF skeletons if bpftool changed
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 18 Mar 2021 19:40:34 +0000 (12:40 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 18 Mar 2021 23:14:23 +0000 (16:14 -0700)
Trigger vmlinux.h and BPF skeletons re-generation if detected that bpftool was
re-compiled. Otherwise full `make clean` is required to get updated skeletons,
if bpftool is modified.

Fixes: acbd06206bbb ("selftests/bpf: Add vmlinux.h selftest exercising tracing of syscalls")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210318194036.3521577-11-andrii@kernel.org
tools/testing/selftests/bpf/Makefile

index d0db2b6..dbca39f 100644 (file)
@@ -232,7 +232,7 @@ $(HOST_BPFOBJ): $(wildcard $(BPFDIR)/*.[ch] $(BPFDIR)/Makefile)                \
                    DESTDIR=$(HOST_SCRATCH_DIR)/ prefix= all install_headers
 endif
 
-$(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) | $(BPFTOOL) $(INCLUDE_DIR)
+$(INCLUDE_DIR)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) | $(INCLUDE_DIR)
 ifeq ($(VMLINUX_H),)
        $(call msg,GEN,,$@)
        $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@
@@ -357,7 +357,8 @@ $(TRUNNER_BPF_OBJS): $(TRUNNER_OUTPUT)/%.o:                         \
 
 $(TRUNNER_BPF_SKELS): $(TRUNNER_OUTPUT)/%.skel.h:                      \
                      $(TRUNNER_OUTPUT)/%.o                             \
-                     | $(BPFTOOL) $(TRUNNER_OUTPUT)
+                     $(BPFTOOL)                                        \
+                     | $(TRUNNER_OUTPUT)
        $$(call msg,GEN-SKEL,$(TRUNNER_BINARY),$$@)
        $(Q)$$(BPFTOOL) gen skeleton $$< > $$@
 endif