Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

samples/bpf: adjust Makefile and README.rst

Side effect of some kbuild changes resulted in breaking the
documented way to build samples/bpf/.

This patch change the samples/bpf/Makefile to work again, when
invoking make from the subdir samples/bpf/. Also update the
documentation in README.rst, to reflect the new way to build.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jesper Dangaard Brouer and committed by
David S. Miller
6cc2c876 5b67a3ed

+7 -9
+2 -2
samples/bpf/Makefile
··· 203 203 TPROGLDLIBS_xdpsock += -pthread 204 204 205 205 # Allows pointing LLC/CLANG to a LLVM backend with bpf support, redefine on cmdline: 206 - # make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang 206 + # make M=samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang 207 207 LLC ?= llc 208 208 CLANG ?= clang 209 209 LLVM_OBJCOPY ?= llvm-objcopy ··· 246 246 247 247 # Trick to allow make to be run from this directory 248 248 all: 249 - $(MAKE) -C ../../ $(CURDIR)/ BPF_SAMPLES_PATH=$(CURDIR) 249 + $(MAKE) -C ../../ M=$(CURDIR) BPF_SAMPLES_PATH=$(CURDIR) 250 250 251 251 clean: 252 252 $(MAKE) -C ../../ M=$(CURDIR) clean
+5 -7
samples/bpf/README.rst
··· 46 46 For building the BPF samples, issue the below command from the kernel 47 47 top level directory:: 48 48 49 - make samples/bpf/ 50 - 51 - Do notice the "/" slash after the directory name. 49 + make M=samples/bpf 52 50 53 51 It is also possible to call make from this directory. This will just 54 - hide the the invocation of make as above with the appended "/". 52 + hide the invocation of make as above. 55 53 56 54 Manually compiling LLVM with 'bpf' support 57 55 ------------------------------------------ ··· 75 77 It is also possible to point make to the newly compiled 'llc' or 76 78 'clang' command via redefining LLC or CLANG on the make command line:: 77 79 78 - make samples/bpf/ LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang 80 + make M=samples/bpf LLC=~/git/llvm/build/bin/llc CLANG=~/git/llvm/build/bin/clang 79 81 80 82 Cross compiling samples 81 83 ----------------------- ··· 96 98 in its targets appropriate arm64 arch (usually it has several arches). 97 99 Build samples:: 98 100 99 - make samples/bpf/ 101 + make M=samples/bpf 100 102 101 103 Or build samples with SYSROOT if some header or library is absent in toolchain, 102 104 say libelf, providing address to file system containing headers and libs, 103 105 can be RFS of target board:: 104 106 105 - make samples/bpf/ SYSROOT=~/some_sysroot 107 + make M=samples/bpf SYSROOT=~/some_sysroot