blob: 89e5d864e923461c40bf80f794d6f91e904bb9ab [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#
3# Makefile for the linux kernel.
4#
5
Sam Ravnborg51b563f2009-09-20 12:28:22 +02006CPPFLAGS_vmlinux.lds := -DTEXT_OFFSET=$(TEXT_OFFSET)
7AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Tim Bird376cfa82010-10-09 22:24:38 +05309ifdef CONFIG_FUNCTION_TRACER
Abhishek Sagar014c2572008-05-31 14:23:50 +053010CFLAGS_REMOVE_ftrace.o = -pg
Rabin Vincentd82227c2012-02-18 17:50:06 +010011CFLAGS_REMOVE_insn.o = -pg
Rabin Vincentb21d55e2012-02-18 17:50:51 +010012CFLAGS_REMOVE_patch.o = -pg
Abhishek Sagar014c2572008-05-31 14:23:50 +053013endif
14
Uwe Kleine-König4bf1fa52009-07-21 09:56:27 +010015CFLAGS_REMOVE_return_address.o = -pg
16
Linus Torvalds1da177e2005-04-16 15:20:36 -070017# Object file lists.
18
Uwe Kleine-König4477ca42013-03-21 21:02:37 +010019obj-y := elf.o entry-common.o irq.o opcodes.o \
Ben Dooksfb033c92019-11-04 18:15:15 +010020 process.o ptrace.o reboot.o \
Victor Kamensky574e2b52013-08-27 22:41:57 -070021 setup.o signal.o sigreturn_codes.o \
22 stacktrace.o sys_arm.o time.o traps.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
Ben Dooksfb033c92019-11-04 18:15:15 +010024ifneq ($(CONFIG_ARM_UNWIND),y)
25obj-$(CONFIG_FRAME_POINTER) += return_address.o
26endif
27
Nicolas Pitrebd51e2f2012-09-01 03:03:25 +010028obj-$(CONFIG_ATAGS) += atags_parse.o
29obj-$(CONFIG_ATAGS_PROC) += atags_proc.o
Nicolas Pitreaa783b62012-09-01 03:00:15 +010030obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o
Uwe Kleine-König73a65b32010-01-19 10:13:14 +010031
Uwe Kleine-König4477ca42013-03-21 21:02:37 +010032ifeq ($(CONFIG_CPU_V7M),y)
Uwe Kleine-König6a7d2c62013-08-27 21:15:02 +010033obj-y += entry-v7m.o v7m.o
Uwe Kleine-König4477ca42013-03-21 21:02:37 +010034else
35obj-y += entry-armv.o
36endif
37
Russell Kinga5b91772018-05-10 12:55:58 +010038obj-$(CONFIG_MMU) += bugs.o
Robert Leee1689792012-03-20 15:22:42 -050039obj-$(CONFIG_CPU_IDLE) += cpuidle.o
Russell King065909b2006-01-04 15:44:16 +000040obj-$(CONFIG_ISA_DMA_API) += dma.o
Dave Martindc2eb922011-05-23 12:22:10 +010041obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
Russell King84781322016-11-23 10:00:03 +000042obj-$(CONFIG_MODULES) += armksyms.o module.o
Ard Biesheuvel7d485f62014-11-24 16:54:35 +010043obj-$(CONFIG_ARM_MODULE_PLTS) += module-plts.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070044obj-$(CONFIG_ISA_DMA) += dma-isa.o
Russell King863dab42006-08-28 12:47:05 +010045obj-$(CONFIG_PCI) += bios32.o isa.o
Linus Torvalds1fdb24e2011-10-28 12:02:27 -070046obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
Sebastian Capella603fb422014-03-25 01:20:29 +010047obj-$(CONFIG_HIBERNATION) += hibernate.o
Jonathan Austin8006b4d2013-04-24 11:51:38 +010048obj-$(CONFIG_SMP) += smp.o
49ifdef CONFIG_MMU
50obj-$(CONFIG_SMP) += smp_tlb.o
51endif
Russell Kinga8cbcd92009-05-16 11:51:14 +010052obj-$(CONFIG_HAVE_ARM_SCU) += smp_scu.o
Russell Kingf32f4ce2009-05-16 12:14:21 +010053obj-$(CONFIG_HAVE_ARM_TWD) += smp_twd.o
Marc Zyngier022c03a2012-01-11 17:25:17 +000054obj-$(CONFIG_ARM_ARCH_TIMER) += arch_timer.o
Russell King82112372014-10-28 13:26:48 +000055obj-$(CONFIG_FUNCTION_TRACER) += entry-ftrace.o
Peter Zijlstra5a735582019-10-15 21:07:35 +020056obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o insn.o patch.o
57obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o insn.o patch.o
Rabin Vincent09f05d82012-02-18 17:52:41 +010058obj-$(CONFIG_JUMP_LABEL) += jump_label.o insn.o patch.o
Richard Purdiec587e4a2007-02-06 21:29:00 +010059obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
Wang Nanfca08f32015-01-09 10:19:49 +080060# Main staffs in KPROBES are in arch/arm/probes/ .
Wang Nan0dc016d2015-01-09 14:37:36 +080061obj-$(CONFIG_KPROBES) += patch.o insn.o
Nicolas Pitre687ad012006-01-14 16:35:31 +000062obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
Catalin Marinasd7f864b2008-04-18 22:43:06 +010063obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
Doug Anderson23a4e402014-04-22 15:14:51 -070064obj-$(CONFIG_KGDB) += kgdb.o patch.o
Catalin Marinasadf8b372009-02-12 13:56:34 +010065obj-$(CONFIG_ARM_UNWIND) += unwind.o
Linus Walleijbc581772009-09-15 17:30:37 +010066obj-$(CONFIG_HAVE_TCM) += tcm.o
Grant Likely9eb8f672011-04-28 14:27:20 -060067obj-$(CONFIG_OF) += devtree.o
Mika Westerberg67742c82010-05-10 09:26:19 +010068obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Leif Lindholm64d2dc32010-09-16 18:00:47 +010069obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o
Russell King283a1b92010-11-08 10:11:19 +000070CFLAGS_swp_emulate.o := -Wa,-march=armv7-a
Will Deacon19852e52010-09-03 10:44:33 +010071obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Lennert Buytenhekafe4b252006-12-03 18:51:14 +010073obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o
74obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o
Eric Miao40305a52009-02-26 09:34:35 +080075obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
Haojian Zhuangef6c8442010-11-24 11:54:25 +080076obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o
Sebastian Hesselbarthd93003e2014-04-24 22:58:30 +010077obj-$(CONFIG_CPU_PJ4B) += pj4-cp0.o
Lennert Buytenhekafe4b252006-12-03 18:51:14 +010078obj-$(CONFIG_IWMMXT) += iwmmxt.o
Mark Rutlandd39976f2014-09-29 17:15:32 +010079obj-$(CONFIG_PERF_EVENTS) += perf_regs.o perf_callchain.o
Mark Rutlandfa8ad782015-07-06 12:23:53 +010080obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_xscale.o perf_event_v6.o \
Mark Rutland29ba0f32015-05-26 17:23:38 +010081 perf_event_v7.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070082AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt
Vincent Guittotc9018aa2011-08-08 13:21:59 +010083obj-$(CONFIG_ARM_CPU_TOPOLOGY) += topology.o
Nathan Lynche5b61de2015-03-25 19:16:05 +010084obj-$(CONFIG_VDSO) += vdso.o
Ard Biesheuvelda58fb62015-09-24 13:49:52 -070085obj-$(CONFIG_EFI) += efi.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
87ifneq ($(CONFIG_ARCH_EBSA110),y)
88 obj-y += io.o
89endif
Stefano Stabellini02c24332015-11-23 10:32:57 +000090obj-$(CONFIG_PARAVIRT) += paravirt.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
Hyok S. Choi3b920ce2006-04-24 09:45:35 +010092head-y := head$(MMUEXT).o
Linus Torvalds1da177e2005-04-16 15:20:36 -070093obj-$(CONFIG_DEBUG_LL) += debug.o
Catalin Marinas93fd03a82009-12-09 10:02:18 +000094obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
Nicolas Pitreca8b5d92017-08-25 00:54:18 -040096# This is executed very early using a temporary stack when no memory allocator
97# nor global data is available. Everything has to be allocated on the stack.
98CFLAGS_head-inflate-data.o := $(call cc-option,-Wframe-larger-than=10240)
99obj-$(CONFIG_XIP_DEFLATED_DATA) += head-inflate-data.o
100
Dave Martin80c59da2012-02-09 08:47:17 -0800101obj-$(CONFIG_ARM_VIRT_EXT) += hyp-stub.o
Jean-Philippe Bruckerc7edd7f2016-02-19 11:04:45 +0100102AFLAGS_hyp-stub.o :=-Wa,-march=armv7-a
Stefano Stabellini05774082013-05-21 14:24:11 +0000103ifeq ($(CONFIG_ARM_PSCI),y)
Stefano Stabellini05774082013-05-21 14:24:11 +0000104obj-$(CONFIG_SMP) += psci_smp.o
105endif
Dave Martin80c59da2012-02-09 08:47:17 -0800106
Jens Wiklanderb329f952016-01-04 15:42:55 +0100107obj-$(CONFIG_HAVE_ARM_SMCCC) += smccc-call.o
108
Thomas Gleixner5290dc22012-05-03 09:02:50 +0000109extra-y := $(head-y) vmlinux.lds