aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bpf/Makefile')
-rw-r--r--samples/bpf/Makefile14
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
5hostprogs-y := test_verifier test_maps 5hostprogs-y := test_verifier test_maps
6hostprogs-y += sock_example 6hostprogs-y += sock_example
7hostprogs-y += sockex1
7 8
8test_verifier-objs := test_verifier.o libbpf.o 9test_verifier-objs := test_verifier.o libbpf.o
9test_maps-objs := test_maps.o libbpf.o 10test_maps-objs := test_maps.o libbpf.o
10sock_example-objs := sock_example.o libbpf.o 11sock_example-objs := sock_example.o libbpf.o
12sockex1-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
13always := $(hostprogs-y) 15always := $(hostprogs-y)
16always += sockex1_kern.o
14 17
15HOSTCFLAGS += -I$(objtree)/usr/include 18HOSTCFLAGS += -I$(objtree)/usr/include
19
20HOSTCFLAGS_bpf_load.o += -I$(objtree)/usr/include -Wno-unused-variable
21HOSTLOADLIBES_sockex1 += -lelf
22
23# point this to your LLVM backend with bpf support
24LLC=$(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 $@