Blame view
tools/objtool/Makefile
1.85 KB
b24413180 License cleanup: ... |
1 |
# SPDX-License-Identifier: GPL-2.0 |
442f04c34 objtool: Add tool... |
2 |
include ../scripts/Makefile.include |
630e7a290 objtool: Use tool... |
3 |
include ../scripts/Makefile.arch |
442f04c34 objtool: Add tool... |
4 |
|
442f04c34 objtool: Add tool... |
5 6 7 |
ifeq ($(ARCH),x86_64) ARCH := x86 endif |
442f04c34 objtool: Add tool... |
8 |
|
c1d45c3ab objtool: Support ... |
9 |
# always use the host compiler |
14c47b54b objtool: Fix 64-b... |
10 11 12 13 14 |
HOSTCC ?= gcc HOSTLD ?= ld CC = $(HOSTCC) LD = $(HOSTLD) AR = ar |
c1d45c3ab objtool: Support ... |
15 |
|
442f04c34 objtool: Add tool... |
16 |
ifeq ($(srctree),) |
e19b7cee0 make use of make ... |
17 |
srctree := $(patsubst %/,%,$(dir $(CURDIR))) |
442f04c34 objtool: Add tool... |
18 19 |
srctree := $(patsubst %/,%,$(dir $(srctree))) endif |
c1d45c3ab objtool: Support ... |
20 |
SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/ |
e19b7cee0 make use of make ... |
21 |
LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/) |
c1d45c3ab objtool: Support ... |
22 |
LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a |
442f04c34 objtool: Add tool... |
23 24 25 |
OBJTOOL := $(OUTPUT)objtool OBJTOOL_IN := $(OBJTOOL)-in.o |
0603e3a92 objtool: Query pk... |
26 27 |
LIBELF_FLAGS := $(shell pkg-config libelf --cflags 2>/dev/null) LIBELF_LIBS := $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) |
442f04c34 objtool: Add tool... |
28 |
all: $(OBJTOOL) |
6a77cff81 objtool: Move syn... |
29 30 |
INCLUDES := -I$(srctree)/tools/include \ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ |
9eb719855 objtool: Fix cros... |
31 |
-I$(srctree)/tools/objtool/arch/$(ARCH)/include |
21ec3bf6a objtool: Disable ... |
32 |
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed |
0603e3a92 objtool: Query pk... |
33 34 |
CFLAGS += -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) |
442f04c34 objtool: Add tool... |
35 |
|
2e51f2624 objtool: Allow bu... |
36 |
# Allow old libelf to be used: |
9564a8cf4 Kbuild: fix # esc... |
37 |
elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr) |
2e51f2624 objtool: Allow bu... |
38 |
CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED) |
442f04c34 objtool: Add tool... |
39 |
AWK = awk |
60cbdf5d0 tools build: Fix ... |
40 |
export srctree OUTPUT CFLAGS SRCARCH AWK |
442f04c34 objtool: Add tool... |
41 42 43 44 45 46 |
include $(srctree)/tools/build/Makefile.include $(OBJTOOL_IN): fixdep FORCE @$(MAKE) $(build)=objtool $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN) |
0f908ccbe tools/objtool/Mak... |
47 |
@$(CONFIG_SHELL) ./sync-check.sh |
442f04c34 objtool: Add tool... |
48 49 50 51 |
$(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@ $(LIBSUBCMD): fixdep FORCE |
c1d45c3ab objtool: Support ... |
52 |
$(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT) |
442f04c34 objtool: Add tool... |
53 |
|
c1d45c3ab objtool: Support ... |
54 |
clean: |
442f04c34 objtool: Add tool... |
55 56 |
$(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL) $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete |
6a77cff81 objtool: Move syn... |
57 |
$(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep |
442f04c34 objtool: Add tool... |
58 59 60 61 |
FORCE: .PHONY: clean FORCE |