samples: bpf: fix build after move to compiling full libbpf.a
authorJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 15 May 2018 05:35:04 +0000 (22:35 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 15 May 2018 05:52:10 +0000 (22:52 -0700)
commit787360f8c2b87d4ae4858bb8736a19c289904885
treef7d14c565d49b414c7224e543e91f1a88ab00ec0
parent8d93045077aeede62127b6d6663bfdd31f6240da
samples: bpf: fix build after move to compiling full libbpf.a

There are many ways users may compile samples, some of them got
broken by commit 5f9380572b4b ("samples: bpf: compile and link
against full libbpf").  Improve path resolution and make libbpf
building a dependency of source files to force its build.

Samples should now again build with any of:
 cd samples/bpf; make
 make samples/bpf/
 make -C samples/bpf
 cd samples/bpf; make O=builddir
 make samples/bpf/ O=builddir
 make -C samples/bpf O=builddir
 export KBUILD_OUTPUT=builddir
 make samples/bpf/
 make -C samples/bpf

Fixes: 5f9380572b4b ("samples: bpf: compile and link against full libbpf")
Reported-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
samples/bpf/Makefile