1# SPDX-License-Identifier: GPL-2.0 2 3LIBBPF_SRCS = $(srctree)/tools/lib/bpf/ 4LIBBPF_A = $(obj)/libbpf.a 5LIBBPF_OUT = $(abspath $(obj)) 6 7# Although not in use by libbpf's Makefile, set $(O) so that the "dummy" test 8# in tools/scripts/Makefile.include always succeeds when building the kernel 9# with $(O) pointing to a relative path, as in "make O=build bindeb-pkg". 10$(LIBBPF_A): 11 $(Q)$(MAKE) -C $(LIBBPF_SRCS) O=$(LIBBPF_OUT)/ OUTPUT=$(LIBBPF_OUT)/ $(LIBBPF_OUT)/libbpf.a 12 13userccflags += -I$(LIBBPF_OUT) -I $(srctree)/tools/include/ \ 14 -I $(srctree)/tools/include/uapi \ 15 -I $(srctree)/tools/lib/ -Wno-unused-result 16 17userprogs := bpf_preload_umd 18 19clean-files := $(userprogs) libbpf_version.h bpf_helper_defs.h FEATURE-DUMP.libbpf staticobjs/ feature/ 20 21$(obj)/iterators/iterators.o: $(LIBBPF_A) 22 23bpf_preload_umd-objs := iterators/iterators.o 24bpf_preload_umd-userldlibs := $(LIBBPF_A) -lelf -lz 25 26$(obj)/bpf_preload_umd: $(LIBBPF_A) 27 28$(obj)/bpf_preload_umd_blob.o: $(obj)/bpf_preload_umd 29 30obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o 31bpf_preload-objs += bpf_preload_kern.o bpf_preload_umd_blob.o 32