提交 ee5cc036 编写于 作者: A Andrii Nakryiko

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: NAndrii Nakryiko <andrii@kernel.org>
...@@ -1086,6 +1086,11 @@ ifdef CONFIG_STACK_VALIDATION ...@@ -1086,6 +1086,11 @@ ifdef CONFIG_STACK_VALIDATION
endif endif
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_BPF
ifdef CONFIG_DEBUG_INFO_BTF ifdef CONFIG_DEBUG_INFO_BTF
ifeq ($(has_libelf),1) ifeq ($(has_libelf),1)
...@@ -1495,7 +1500,7 @@ vmlinuxclean: ...@@ -1495,7 +1500,7 @@ vmlinuxclean:
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean
$(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) 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 # mrproper - Delete all generated files, including .config
# #
......
/FEATURE-DUMP.libbpf
/bpf_helper_defs.h
/fixdep /fixdep
/resolve_btfids /resolve_btfids
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
include ../../scripts/Makefile.include include ../../scripts/Makefile.include
include ../../scripts/Makefile.arch include ../../scripts/Makefile.arch
ifeq ($(srctree),) srctree := $(abspath $(CURDIR)/../../../)
srctree := $(patsubst %/,%,$(dir $(CURDIR)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
srctree := $(patsubst %/,%,$(dir $(srctree)))
endif
ifeq ($(V),1) ifeq ($(V),1)
Q = Q =
...@@ -22,28 +18,29 @@ AR = $(HOSTAR) ...@@ -22,28 +18,29 @@ AR = $(HOSTAR)
CC = $(HOSTCC) CC = $(HOSTCC)
LD = $(HOSTLD) LD = $(HOSTLD)
ARCH = $(HOSTARCH) ARCH = $(HOSTARCH)
RM ?= rm
OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/ OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
LIBBPF_SRC := $(srctree)/tools/lib/bpf/ LIBBPF_SRC := $(srctree)/tools/lib/bpf/
SUBCMD_SRC := $(srctree)/tools/lib/subcmd/ SUBCMD_SRC := $(srctree)/tools/lib/subcmd/
BPFOBJ := $(OUTPUT)/libbpf.a BPFOBJ := $(OUTPUT)/libbpf/libbpf.a
SUBCMDOBJ := $(OUTPUT)/libsubcmd.a SUBCMDOBJ := $(OUTPUT)/libsubcmd/libsubcmd.a
BINARY := $(OUTPUT)/resolve_btfids BINARY := $(OUTPUT)/resolve_btfids
BINARY_IN := $(BINARY)-in.o BINARY_IN := $(BINARY)-in.o
all: $(BINARY) all: $(BINARY)
$(OUTPUT): $(OUTPUT) $(OUTPUT)/libbpf $(OUTPUT)/libsubcmd:
$(call msg,MKDIR,,$@) $(call msg,MKDIR,,$@)
$(Q)mkdir -p $(OUTPUT) $(Q)mkdir -p $(@)
$(SUBCMDOBJ): fixdep FORCE $(SUBCMDOBJ): fixdep FORCE | $(OUTPUT)/libsubcmd
$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT) $(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 $@) $(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(abspath $(dir $@))/ $(abspath $@)
CFLAGS := -g \ CFLAGS := -g \
...@@ -57,24 +54,27 @@ LIBS = -lelf -lz ...@@ -57,24 +54,27 @@ LIBS = -lelf -lz
export srctree OUTPUT CFLAGS Q export srctree OUTPUT CFLAGS Q
include $(srctree)/tools/build/Makefile.include include $(srctree)/tools/build/Makefile.include
$(BINARY_IN): fixdep FORCE $(BINARY_IN): fixdep FORCE | $(OUTPUT)
$(Q)$(MAKE) $(build)=resolve_btfids $(Q)$(MAKE) $(build)=resolve_btfids
$(BINARY): $(BPFOBJ) $(SUBCMDOBJ) $(BINARY_IN) $(BINARY): $(BPFOBJ) $(SUBCMDOBJ) $(BINARY_IN)
$(call msg,LINK,$@) $(call msg,LINK,$@)
$(Q)$(CC) $(BINARY_IN) $(LDFLAGS) -o $@ $(BPFOBJ) $(SUBCMDOBJ) $(LIBS) $(Q)$(CC) $(BINARY_IN) $(LDFLAGS) -o $@ $(BPFOBJ) $(SUBCMDOBJ) $(LIBS)
libsubcmd-clean: clean_objects := $(wildcard $(OUTPUT)/*.o \
$(Q)$(MAKE) -C $(SUBCMD_SRC) OUTPUT=$(OUTPUT) clean $(OUTPUT)/.*.o.cmd \
$(OUTPUT)/.*.o.d \
libbpf-clean: $(OUTPUT)/libbpf \
$(Q)$(MAKE) -C $(LIBBPF_SRC) OUTPUT=$(OUTPUT) clean $(OUTPUT)/libsubcmd \
$(OUTPUT)/resolve_btfids)
clean: libsubcmd-clean libbpf-clean fixdep-clean ifneq ($(clean_objects),)
clean: fixdep-clean
$(call msg,CLEAN,$(BINARY)) $(call msg,CLEAN,$(BINARY))
$(Q)$(RM) -f $(BINARY); \ $(Q)$(RM) -rf $(clean_objects)
$(RM) -rf $(if $(OUTPUT),$(OUTPUT),.)/feature; \ else
find $(if $(OUTPUT),$(OUTPUT),.) -name \*.o -or -name \*.o.cmd -or -name \*.o.d | xargs $(RM) clean:
endif
tags: tags:
$(call msg,GEN,,tags) $(call msg,GEN,,tags)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册