# SPDX-License-Identifier: LGPL-2.1 OR BSD-2-Clause # Copyright (c) 2026 Meta Platforms, Inc. and affiliates. .PHONY: clean # Defaults for standalone builds CLANG ?= clang BPFTOOL ?= bpftool LDLIBS ?= -lbpf -lelf -lz -lrt -lpthread -lzstd ifeq ($(V),1) Q = msg = else Q ?= @ msg = @printf ' %-8s%s %s%s\n' "$(1)" "$(if $(2), [$(2)])" "$(notdir $(3))" "$(if $(4), $(4))"; endif IS_LITTLE_ENDIAN = $(shell $(CC) -dM -E - $@ libarena.skel.h: libarena.bpf.o $(call msg,GEN-SKEL,libarena,$@) $(Q)$(BPFTOOL) gen skeleton $< name "libarena" > $@ libarena_asan.bpf.o: $(LIBARENA_OBJECTS_ASAN) $(call msg,GEN-OBJ,libarena,$@) $(Q)$(BPFTOOL) gen object $@ $^ libarena.bpf.o: $(LIBARENA_OBJECTS) $(call msg,GEN-OBJ,libarena,$@) $(Q)$(BPFTOOL) gen object $@ $^ %_asan.bpf.o: %.bpf.c $(call msg,CLNG-BPF,libarena,$@) $(Q)$(CLANG) $(BPF_CFLAGS) $(ASAN_FLAGS) -DBPF_ARENA_ASAN $(BPF_TARGET_ENDIAN) -c $< -o $@ %.bpf.o: %.bpf.c $(call msg,CLNG-BPF,libarena,$@) $(Q)$(CLANG) $(BPF_CFLAGS) $(BPF_TARGET_ENDIAN) -c $< -o $@ clean: $(Q)rm -f *.skel.h *.bpf.o *.linked*.o