PCI: pciehp: Avoid implicit fallthroughs in switch statements
[linux/fpc-iii.git] / tools / objtool / Makefile
blobf76d9914686a238a976b7230b4c21b9a20092fbe
1 # SPDX-License-Identifier: GPL-2.0
2 include ../scripts/Makefile.include
3 include ../scripts/Makefile.arch
5 ifeq ($(ARCH),x86_64)
6 ARCH := x86
7 endif
9 # always use the host compiler
10 HOSTCC ?= gcc
11 HOSTLD ?= ld
12 CC = $(HOSTCC)
13 LD = $(HOSTLD)
14 AR = ar
16 ifeq ($(srctree),)
17 srctree := $(patsubst %/,%,$(dir $(CURDIR)))
18 srctree := $(patsubst %/,%,$(dir $(srctree)))
19 endif
21 SUBCMD_SRCDIR = $(srctree)/tools/lib/subcmd/
22 LIBSUBCMD_OUTPUT = $(if $(OUTPUT),$(OUTPUT),$(CURDIR)/)
23 LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a
25 OBJTOOL := $(OUTPUT)objtool
26 OBJTOOL_IN := $(OBJTOOL)-in.o
28 all: $(OBJTOOL)
30 INCLUDES := -I$(srctree)/tools/include \
31 -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
32 -I$(srctree)/tools/objtool/arch/$(ARCH)/include
33 WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
34 CFLAGS += -Werror $(WARNINGS) $(HOSTCFLAGS) -g $(INCLUDES)
35 LDFLAGS += -lelf $(LIBSUBCMD) $(HOSTLDFLAGS)
37 # Allow old libelf to be used:
38 elfshdr := $(shell echo '$(pound)include <libelf.h>' | $(CC) $(CFLAGS) -x c -E - | grep elf_getshdr)
39 CFLAGS += $(if $(elfshdr),,-DLIBELF_USE_DEPRECATED)
41 AWK = awk
42 export srctree OUTPUT CFLAGS SRCARCH AWK
43 include $(srctree)/tools/build/Makefile.include
45 $(OBJTOOL_IN): fixdep FORCE
46 @$(MAKE) $(build)=objtool
48 $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
49 @$(CONFIG_SHELL) ./sync-check.sh
50 $(QUIET_LINK)$(CC) $(OBJTOOL_IN) $(LDFLAGS) -o $@
53 $(LIBSUBCMD): fixdep FORCE
54 $(Q)$(MAKE) -C $(SUBCMD_SRCDIR) OUTPUT=$(LIBSUBCMD_OUTPUT)
56 clean:
57 $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
58 $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
59 $(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
61 FORCE:
63 .PHONY: clean FORCE