<commit_before>include ../Makefile.defs

CLANG_FLAGS := -Iinclude -D__NR_CPUS__=$(shell nproc) -O2 -target bpf -I. -Wall -Werror

BPF = bpf_lxc.o bpf_netdev.o bpf_overlay.o bpf_lb.o
SCRIPTS = init.sh join_ep.sh run_probes.sh
LIB := $(shell find ./lib -name '*.h')

ifeq ("$(PKG_BUILD)","")

all: $(BPF)

%.o: %.c
	clang ${CLANG_FLAGS} -c $< -o $@

LB_OPTIONS = \
	 \
	-DLB_L3 \
	-DLB_L4 \
	-DLB_L3 -DLB_L4

bpf_lb.o:
	$(foreach OPTS,$(LB_OPTIONS), \
		clang ${OPTS} ${CLANG_FLAGS} -c bpf_lb.c -o $@;)

else<commit_msg>bpf: disable -Waddress-of-packed-member on newer clang versions<commit_after>include ../Makefile.defs

CLANG_FLAGS := -Iinclude -D__NR_CPUS__=$(shell nproc) -O2 -target bpf -I.

# eBPF verifier enforces unaligned access checks where necessary, so don't
# let clang complain too early.
CLANG_FLAGS += -Wall -Werror -Wno-address-of-packed-member -Wno-unknown-warning-option

BPF = bpf_lxc.o bpf_netdev.o bpf_overlay.o bpf_lb.o
SCRIPTS = init.sh join_ep.sh run_probes.sh
LIB := $(shell find ./lib -name '*.h')

ifeq ("$(PKG_BUILD)","")

all: $(BPF)

%.o: %.c
	clang ${CLANG_FLAGS} -c $< -o $@

LB_OPTIONS = \
	 \
	-DLB_L3 \
	-DLB_L4 \
	-DLB_L3 -DLB_L4

bpf_lb.o:
	$(foreach OPTS,$(LB_OPTIONS), \
		clang ${OPTS} ${CLANG_FLAGS} -c bpf_lb.c -o $@;)

else
{'fraction_non_alphanumeric': 0.17758484609313338, 'fraction_numerical': 0.007892659826361484, 'mean_word_length': 3.449122807017544, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1717305', 'n_tokens_mistral': 601, 'n_tokens_neox': 581, 'n_words': 127}