mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 15:13:55 +08:00
Merge branch 'kbuild/resolve_btfids: Invoke resolve_btfids'
Jiri Olsa says: ==================== hi, resolve_btfids tool is used during the kernel build, so we should clean it on kernel's make clean. v2 changes: - add Song's acks on patches 1 and 4 (others changed) [Song] - add missing / [Andrii] - change srctree variable initialization [Andrii] - shifted ifdef for clean target [Andrii] thanks, jirka ==================== Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
This commit is contained in:
commit
ee5cc0363e
7
Makefile
7
Makefile
@ -1086,6 +1086,11 @@ ifdef CONFIG_STACK_VALIDATION
|
||||
endif
|
||||
endif
|
||||
|
||||
PHONY += resolve_btfids_clean
|
||||
|
||||
resolve_btfids_clean:
|
||||
$(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(abspath $(objtree))/tools/bpf/resolve_btfids clean
|
||||
|
||||
ifdef CONFIG_BPF
|
||||
ifdef CONFIG_DEBUG_INFO_BTF
|
||||
ifeq ($(has_libelf),1)
|
||||
@ -1495,7 +1500,7 @@ vmlinuxclean:
|
||||
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
|
||||
$(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean)
|
||||
|
||||
clean: archclean vmlinuxclean
|
||||
clean: archclean vmlinuxclean resolve_btfids_clean
|
||||
|
||||
# mrproper - Delete all generated files, including .config
|
||||
#
|
||||
|
2
tools/bpf/resolve_btfids/.gitignore
vendored
2
tools/bpf/resolve_btfids/.gitignore
vendored
@ -1,4 +1,2 @@
|
||||
/FEATURE-DUMP.libbpf
|
||||
/bpf_helper_defs.h
|
||||
/fixdep
|
||||
/resolve_btfids
|
||||
|
@ -2,11 +2,7 @@
|
||||
include ../../scripts/Makefile.include
|
||||
include ../../scripts/Makefile.arch
|
||||
|
||||
ifeq ($(srctree),)
|
||||
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
|
||||
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
srctree := $(patsubst %/,%,$(dir $(srctree)))
|
||||
endif
|
||||
srctree := $(abspath $(CURDIR)/../../../)
|
||||
|
||||
ifeq ($(V),1)
|
||||
Q =
|
||||
@ -22,28 +18,29 @@ AR = $(HOSTAR)
|
||||
CC = $(HOSTCC)
|
||||
LD = $(HOSTLD)
|
||||
ARCH = $(HOSTARCH)
|
||||
RM ?= rm
|
||||
|
||||
OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
|
||||
|
||||
LIBBPF_SRC := $(srctree)/tools/lib/bpf/
|
||||
SUBCMD_SRC := $(srctree)/tools/lib/subcmd/
|
||||
|
||||
BPFOBJ := $(OUTPUT)/libbpf.a
|
||||
SUBCMDOBJ := $(OUTPUT)/libsubcmd.a
|
||||
BPFOBJ := $(OUTPUT)/libbpf/libbpf.a
|
||||
SUBCMDOBJ := $(OUTPUT)/libsubcmd/libsubcmd.a
|
||||
|
||||
BINARY := $(OUTPUT)/resolve_btfids
|
||||
BINARY_IN := $(BINARY)-in.o
|
||||
|
||||
all: $(BINARY)
|
||||
|
||||
$(OUTPUT):
|
||||
$(OUTPUT) $(OUTPUT)/libbpf $(OUTPUT)/libsubcmd:
|
||||
$(call msg,MKDIR,,$@)
|
||||
$(Q)mkdir -p $(OUTPUT)
|
||||
$(Q)mkdir -p $(@)
|
||||
|
||||
$(SUBCMDOBJ): fixdep FORCE
|
||||
$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT)
|
||||
$(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
|
||||
$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
|
||||
|
||||
$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)
|
||||
$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(OUTPUT)/libbpf
|
||||
$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
|
||||
|
||||
CFLAGS := -g \
|
||||
@ -57,24 +54,27 @@ LIBS = -lelf -lz
|
||||
export srctree OUTPUT CFLAGS Q
|
||||
include $(srctree)/tools/build/Makefile.include
|
||||
|
||||
$(BINARY_IN): fixdep FORCE
|
||||
$(BINARY_IN): fixdep FORCE | $(OUTPUT)
|
||||
$(Q)$(MAKE) $(build)=resolve_btfids
|
||||
|
||||
$(BINARY): $(BPFOBJ) $(SUBCMDOBJ) $(BINARY_IN)
|
||||
$(call msg,LINK,$@)
|
||||
$(Q)$(CC) $(BINARY_IN) $(LDFLAGS) -o $@ $(BPFOBJ) $(SUBCMDOBJ) $(LIBS)
|
||||
|
||||
libsubcmd-clean:
|
||||
$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT) clean
|
||||
clean_objects := $(wildcard $(OUTPUT)/*.o \
|
||||
$(OUTPUT)/.*.o.cmd \
|
||||
$(OUTPUT)/.*.o.d \
|
||||
$(OUTPUT)/libbpf \
|
||||
$(OUTPUT)/libsubcmd \
|
||||
$(OUTPUT)/resolve_btfids)
|
||||
|
||||
libbpf-clean:
|
||||
$(Q)$(MAKE) -C $(LIBBPF_SRC) OUTPUT=$(OUTPUT) clean
|
||||
|
||||
clean: libsubcmd-clean libbpf-clean fixdep-clean
|
||||
ifneq ($(clean_objects),)
|
||||
clean: fixdep-clean
|
||||
$(call msg,CLEAN,$(BINARY))
|
||||
$(Q)$(RM) -f $(BINARY); \
|
||||
$(RM) -rf $(if $(OUTPUT),$(OUTPUT),.)/feature; \
|
||||
find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM)
|
||||
$(Q)$(RM) -rf $(clean_objects)
|
||||
else
|
||||
clean:
|
||||
endif
|
||||
|
||||
tags:
|
||||
$(call msg,GEN,,tags)
|
||||
|
Loading…
Reference in New Issue
Block a user