1 # SPDX-License-Identifier: GPL-2.0 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 LIBBPF_INCLUDE = $(srctree)/tools/lib !! 3 LIBBPF_SRCS = $(srctree)/tools/lib/bpf/ >> 4 LIBBPF_OUT = $(abspath $(obj))/libbpf >> 5 LIBBPF_A = $(LIBBPF_OUT)/libbpf.a >> 6 LIBBPF_DESTDIR = $(LIBBPF_OUT) >> 7 LIBBPF_INCLUDE = $(LIBBPF_DESTDIR)/include >> 8 >> 9 # Although not in use by libbpf's Makefile, set $(O) so that the "dummy" test >> 10 # in tools/scripts/Makefile.include always succeeds when building the kernel >> 11 # with $(O) pointing to a relative path, as in "make O=build bindeb-pkg". >> 12 $(LIBBPF_A): | $(LIBBPF_OUT) >> 13 $(Q)$(MAKE) -C $(LIBBPF_SRCS) O=$(LIBBPF_OUT)/ OUTPUT=$(LIBBPF_OUT)/ \ >> 14 DESTDIR=$(LIBBPF_DESTDIR) prefix= \ >> 15 $(LIBBPF_OUT)/libbpf.a install_headers >> 16 >> 17 libbpf_hdrs: $(LIBBPF_A) >> 18 >> 19 .PHONY: libbpf_hdrs >> 20 >> 21 $(LIBBPF_OUT): >> 22 $(call msg,MKDIR,$@) >> 23 $(Q)mkdir -p $@ >> 24 >> 25 userccflags += -I $(srctree)/tools/include/ -I $(srctree)/tools/include/uapi \ >> 26 -I $(LIBBPF_INCLUDE) -Wno-unused-result >> 27 >> 28 userprogs := bpf_preload_umd >> 29 >> 30 clean-files := libbpf/ >> 31 >> 32 $(obj)/iterators/iterators.o: | libbpf_hdrs >> 33 >> 34 bpf_preload_umd-objs := iterators/iterators.o >> 35 bpf_preload_umd-userldlibs := $(LIBBPF_A) -lelf -lz >> 36 >> 37 $(obj)/bpf_preload_umd: $(LIBBPF_A) >> 38 >> 39 $(obj)/bpf_preload_umd_blob.o: $(obj)/bpf_preload_umd 4 40 5 obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o 41 obj-$(CONFIG_BPF_PRELOAD_UMD) += bpf_preload.o 6 CFLAGS_bpf_preload_kern.o += -I$(LIBBPF_INCLUD !! 42 bpf_preload-objs += bpf_preload_kern.o bpf_preload_umd_blob.o 7 bpf_preload-objs += bpf_preload_kern.o <<
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.