diff mbox series

[bpf] tools/bpf: permit selftests/bpf to be built in a different directory

Message ID 20180130052328.3750469-1-yhs@fb.com
State Accepted, archived
Delegated to: BPF Maintainers
Headers show
Series [bpf] tools/bpf: permit selftests/bpf to be built in a different directory | expand

Commit Message

Yonghong Song Jan. 30, 2018, 5:23 a.m. UTC
Fix a couple of issues at tools/testing/selftests/bpf/Makefile so
the following command
   make -C tools/testing/selftests/bpf OUTPUT=/home/yhs/tmp
can put the built results into a different directory.

Also add the built binary test_tcpbpf_user in the .gitignore file.

Fixes: 6882804c916b ("selftests/bpf: add a test for overlapping packet range checks")
Fixes: 9d1f15941967 ("bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/")
Signed-off-by: Yonghong Song <yhs@fb.com>
---
 tools/testing/selftests/bpf/.gitignore | 1 +
 tools/testing/selftests/bpf/Makefile   | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

Comments

Daniel Borkmann Feb. 1, 2018, 10:35 a.m. UTC | #1
On 01/30/2018 06:23 AM, Yonghong Song wrote:
> Fix a couple of issues at tools/testing/selftests/bpf/Makefile so
> the following command
>    make -C tools/testing/selftests/bpf OUTPUT=/home/yhs/tmp
> can put the built results into a different directory.
> 
> Also add the built binary test_tcpbpf_user in the .gitignore file.
> 
> Fixes: 6882804c916b ("selftests/bpf: add a test for overlapping packet range checks")
> Fixes: 9d1f15941967 ("bpf: move cgroup_helpers from samples/bpf/ to tools/testing/selftesting/bpf/")
> Signed-off-by: Yonghong Song <yhs@fb.com>

Applied to bpf tree, thanks Yonghong!
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/.gitignore b/tools/testing/selftests/bpf/.gitignore
index 1e09d77..cc15af2 100644
--- a/tools/testing/selftests/bpf/.gitignore
+++ b/tools/testing/selftests/bpf/.gitignore
@@ -8,5 +8,6 @@  fixdep
 test_align
 test_dev_cgroup
 test_progs
+test_tcpbpf_user
 test_verifier_log
 feature
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index bf05bc5..566d6ad 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -27,7 +27,7 @@  TEST_PROGS := test_kmod.sh test_xdp_redirect.sh test_xdp_meta.sh \
 
 include ../lib.mk
 
-BPFOBJ := $(OUTPUT)/libbpf.a $(OUTPUT)/cgroup_helpers.c
+BPFOBJ := $(OUTPUT)/libbpf.a cgroup_helpers.c
 
 $(TEST_GEN_PROGS): $(BPFOBJ)
 
@@ -58,7 +58,7 @@  CLANG_FLAGS = -I. -I./include/uapi -I../../../include/uapi \
 $(OUTPUT)/test_l4lb_noinline.o: CLANG_FLAGS += -fno-inline
 $(OUTPUT)/test_xdp_noinline.o: CLANG_FLAGS += -fno-inline
 
-%.o: %.c
+$(OUTPUT)/%.o: %.c
 	$(CLANG) $(CLANG_FLAGS) \
 		 -O2 -target bpf -emit-llvm -c $< -o - |      \
 	$(LLC) -march=bpf -mcpu=$(CPU) -filetype=obj -o $@