aboutsummaryrefslogtreecommitdiff
path: root/samples/bpf
diff options
context:
space:
mode:
authorQuentin Monnet2021-10-07 20:44:36 +0100
committerAndrii Nakryiko2021-10-08 12:02:36 -0700
commita60d24e7400247bf21cac451f28961ac800756c6 (patch)
tree1f47c8c1a1c490f7bdbf73a20a5dea70c87c948c /samples/bpf
parent3f7a3318a7c60947e27be372950840a5eab976d0 (diff)
samples/bpf: Do not FORCE-recompile libbpf
In samples/bpf/Makefile, libbpf has a FORCE dependency that force it to be rebuilt. I read this as a way to keep the library up-to-date, given that we do not have, in samples/bpf, a list of the source files for libbpf itself. However, a better approach would be to use the "$(wildcard ...)" function from make, and to have libbpf depend on all the .c and .h files in its directory. This is what samples/bpf/Makefile does for bpftool, and also what the BPF selftests' Makefile does for libbpf. Let's update the Makefile to avoid rebuilding libbpf all the time (and bpftool on top of it). Signed-off-by: Quentin Monnet <quentin@isovalent.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20211007194438.34443-11-quentin@isovalent.com
Diffstat (limited to 'samples/bpf')
-rw-r--r--samples/bpf/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile
index 8c5311d77680..4c5ad15f8d28 100644
--- a/samples/bpf/Makefile
+++ b/samples/bpf/Makefile
@@ -276,7 +276,7 @@ clean:
@find $(CURDIR) -type f -name '*~' -delete
@$(RM) -r $(CURDIR)/libbpf $(CURDIR)/bpftool
-$(LIBBPF): FORCE | $(LIBBPF_OUTPUT)
+$(LIBBPF): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(LIBBPF_OUTPUT)
# Fix up variables inherited from Kbuild that tools/ build system won't like
$(MAKE) -C $(LIBBPF_SRC) RM='rm -rf' EXTRA_CFLAGS="$(TPROGS_CFLAGS)" \
LDFLAGS=$(TPROGS_LDFLAGS) srctree=$(BPF_SAMPLES_PATH)/../../ \