diff options
Diffstat (limited to 'samples/bpf/Makefile')
-rw-r--r-- | samples/bpf/Makefile | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index f46d3492d032..770d145186c3 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile | |||
@@ -4,12 +4,26 @@ obj- := dummy.o | |||
4 | # List of programs to build | 4 | # List of programs to build |
5 | hostprogs-y := test_verifier test_maps | 5 | hostprogs-y := test_verifier test_maps |
6 | hostprogs-y += sock_example | 6 | hostprogs-y += sock_example |
7 | hostprogs-y += sockex1 | ||
7 | 8 | ||
8 | test_verifier-objs := test_verifier.o libbpf.o | 9 | test_verifier-objs := test_verifier.o libbpf.o |
9 | test_maps-objs := test_maps.o libbpf.o | 10 | test_maps-objs := test_maps.o libbpf.o |
10 | sock_example-objs := sock_example.o libbpf.o | 11 | sock_example-objs := sock_example.o libbpf.o |
12 | sockex1-objs := bpf_load.o libbpf.o sockex1_user.o | ||
11 | 13 | ||
12 | # Tell kbuild to always build the programs | 14 | # Tell kbuild to always build the programs |
13 | always := $(hostprogs-y) | 15 | always := $(hostprogs-y) |
16 | always += sockex1_kern.o | ||
14 | 17 | ||
15 | HOSTCFLAGS += -I$(objtree)/usr/include | 18 | HOSTCFLAGS += -I$(objtree)/usr/include |
19 | |||
20 | HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable | ||
21 | HOSTLOADLIBES_sockex1 += -lelf | ||
22 | |||
23 | # point this to your LLVM backend with bpf support | ||
24 | LLC=$(srctree)/tools/bpf/llvm/bld/Debug+Asserts/bin/llc | ||
25 | |||
26 | %.o: %.c | ||
27 | clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ | ||
28 | -D__KERNEL__ -Wno-unused-value -Wno-pointer-sign \ | ||
29 | -O2 -emit-llvm -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ | ||