File: Makefile.am

package info (click to toggle)
suricata 1%3A7.0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,104 kB
  • sloc: ansic: 334,774; python: 7,725; sh: 5,001; makefile: 2,075; perl: 867
file content (30 lines) | stat: -rw-r--r-- 791 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
EXTRA_DIST= include bypass_filter.c filter.c lb.c vlan_filter.c xdp_filter.c \
	    xdp_lb.c bpf_helpers.h hash_func01.h

if BUILD_EBPF

# Maintaining a local copy of UAPI linux/bpf.h
BPF_CFLAGS = -Iinclude -I$(ebpf_includes)

BPF_TARGETS  = lb.bpf
BPF_TARGETS += filter.bpf
BPF_TARGETS += bypass_filter.bpf
BPF_TARGETS += xdp_filter.bpf
BPF_TARGETS += xdp_lb.bpf
BPF_TARGETS += vlan_filter.bpf

all: $(BPF_TARGETS)


$(BPF_TARGETS): %.bpf: %.c
#      From C-code to LLVM-IR format suffix .ll (clang -S -emit-llvm)
	${CLANG} -Wall $(BPF_CFLAGS) -O2 \
		-D__KERNEL__ -D__ASM_SYSREG_H \
		-target bpf -S -emit-llvm $< -o ${@:.bpf=.ll}
#      From LLVM-IR to BPF-bytecode in ELF-obj file
	${LLC} -march=bpf -filetype=obj ${@:.bpf=.ll} -o $@
	${RM} ${@:.bpf=.ll}

CLEANFILES = *.bpf *.ll

endif