# SPDX-License-Identifier: GPL-2.0 include ../scripts/Makefile.include include ../scripts/Makefile.arch ifeq ($(ARCH),x86_64) ARCH := x86 endif # always use the host compiler AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR))) srctree := $(patsubst %/,%,$(dir $(srctree))) endif SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/) LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a OBJTOOL := $(OUTPUT)objtool OBJTOOL_IN := $(OBJTOOL)-in.o LIBELF_FLAGS := $(shell pkg-config libelf --cflags 2>/dev/null) LIBELF_LIBS := $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) all: $(OBJTOOL) INCLUDES := -I$(srctree)/tools/include \ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ -I$(srctree)/tools/objtool/arch/$(ARCH)/include WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed CFLAGS := -Wall -Werror $(WARNINGS) -fomit-frame-pointer -O2 -g $(INCLUDES) $(LIBELF_FLAGS) LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) # Allow old libelf to be used: elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) AWK = awk export srctree OUTPUT CFLAGS SRCARCH AWK include $(srctree)/tools/build/Makefile.include $(OBJTOOL_IN): fixdep FORCE @$(MAKE) $(build)=objtool $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN) @$(CONFIG_SHELL) ./sync-check.sh $(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@ $(LIBSUBCMD): fixdep FORCE $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT) clean: $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL) $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep FORCE: .PHONY: clean FORCE
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
arch | Folder | 0755 |
|
|
.builtin-check.o.cmd | File | 6.92 KB | 0644 |
|
.builtin-orc.o.cmd | File | 7.18 KB | 0644 |
|
.check.o.cmd | File | 7.8 KB | 0644 |
|
.elf.o.cmd | File | 8.11 KB | 0644 |
|
.exec-cmd.o.cmd | File | 6.16 KB | 0644 |
|
.fixdep-in.o.cmd | File | 435 B | 0644 |
|
.fixdep.o.cmd | File | 4.9 KB | 0644 |
|
.fixdep.o.d | File | 4.03 KB | 0644 |
|
.help.o.cmd | File | 6.64 KB | 0644 |
|
.libstring.o.cmd | File | 5.59 KB | 0644 |
|
.libsubcmd-in.o.cmd | File | 1.25 KB | 0644 |
|
.objtool-in.o.cmd | File | 1.8 KB | 0644 |
|
.objtool.o.cmd | File | 6.12 KB | 0644 |
|
.orc_dump.o.cmd | File | 8.03 KB | 0644 |
|
.orc_gen.o.cmd | File | 7.73 KB | 0644 |
|
.pager.o.cmd | File | 6.52 KB | 0644 |
|
.parse-options.o.cmd | File | 5.95 KB | 0644 |
|
.run-command.o.cmd | File | 7.62 KB | 0644 |
|
.sigchain.o.cmd | File | 5.63 KB | 0644 |
|
.special.o.cmd | File | 7.62 KB | 0644 |
|
.str_error_r.o.cmd | File | 4.24 KB | 0644 |
|
.subcmd-config.o.cmd | File | 1.93 KB | 0644 |
|
Makefile | File | 1.82 KB | 0644 |
|
builtin-check.o | File | 10.9 KB | 0644 |
|
builtin-orc.o | File | 10.13 KB | 0644 |
|
check.o | File | 184.4 KB | 0644 |
|
elf.o | File | 80.44 KB | 0644 |
|
exec-cmd.o | File | 177.27 KB | 0644 |
|
fixdep | File | 12.77 KB | 0755 |
|
fixdep-in.o | File | 5.19 KB | 0644 |
|
fixdep.o | File | 5.18 KB | 0644 |
|
help.o | File | 216.61 KB | 0644 |
|
libstring.o | File | 9.08 KB | 0644 |
|
libsubcmd-in.o | File | 766.18 KB | 0644 |
|
libsubcmd.a | File | 766.99 KB | 0644 |
|
objtool | File | 548.66 KB | 0755 |
|
objtool-in.o | File | 488.15 KB | 0644 |
|
objtool.o | File | 20.34 KB | 0644 |
|
orc_dump.o | File | 31.46 KB | 0644 |
|
orc_gen.o | File | 35.63 KB | 0644 |
|
pager.o | File | 158.31 KB | 0644 |
|
parse-options.o | File | 219.55 KB | 0644 |
|
run-command.o | File | 190.51 KB | 0644 |
|
sigchain.o | File | 120.23 KB | 0644 |
|
special.o | File | 30.27 KB | 0644 |
|
str_error_r.o | File | 7.8 KB | 0644 |
|
subcmd-config.o | File | 23.94 KB | 0644 |
|
sync-check.sh | File | 584 B | 0755 |
|