blob: 6c6cce937dd81bf75cf850001dd61f673412f1db [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Paul Mackerras14cf11a2005-09-26 16:04:21 +10002#
3# Makefile for the linux kernel.
4#
5
Roland McGrath80fdf472007-12-20 03:58:00 -08006CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
7
Michael Ellermanba55bd72009-06-09 20:48:51 +00008subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
9
Stephen Rothwellbd142b72005-09-30 13:51:25 +100010ifeq ($(CONFIG_PPC64),y)
Anton Blanchard1fbe9cf2012-11-26 17:41:08 +000011CFLAGS_prom_init.o += $(NO_MINIMAL_TOC)
Stephen Rothwellbd142b72005-09-30 13:51:25 +100012endif
Stephen Rothwellcabb5582005-09-30 16:16:52 +100013ifeq ($(CONFIG_PPC32),y)
Paul Mackerras9b6b5632005-10-06 12:06:20 +100014CFLAGS_prom_init.o += -fPIC
Paul Mackerrasb3491262005-10-06 13:24:50 +100015CFLAGS_btext.o += -fPIC
Stephen Rothwellcabb5582005-09-30 16:16:52 +100016endif
Paul Mackerras9b6b5632005-10-06 12:06:20 +100017
Emese Revfy38addce2016-06-20 20:41:19 +020018CFLAGS_cputable.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
Andrew Donnellaneac6f8b2016-12-06 17:27:59 +110019CFLAGS_prom_init.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
Emese Revfy38addce2016-06-20 20:41:19 +020020CFLAGS_btext.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
21CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN)
22
Steven Rostedt606576c2008-10-06 19:06:12 -040023ifdef CONFIG_FUNCTION_TRACER
Steven Rostedt4e491d12008-05-14 23:49:44 -040024# Do not trace early boot code
Torsten Duwe9a7841a2016-03-03 15:26:58 +110025CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
26CFLAGS_REMOVE_prom_init.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
27CFLAGS_REMOVE_btext.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
28CFLAGS_REMOVE_prom.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
Steven Rostedt4e491d12008-05-14 23:49:44 -040029endif
30
Matthew Wilcox64ac24e2008-03-07 21:55:58 -050031obj-y := cputable.o ptrace.o syscalls.o \
Paul Mackerras624cee32006-01-12 21:22:34 +110032 irq.o align.o signal_32.o pmc.o vdso.o \
Thomas Gleixnerb0ce50a2012-05-03 09:02:57 +000033 process.o systbl.o idle.o \
Michael Ellerman698193d2010-11-08 17:31:36 +000034 signal.o sysfs.o cacheinfo.o time.o \
35 prom.o traps.o setup-common.o \
Michael Ellerman68201fb2016-08-11 16:03:14 +100036 udbg.o misc.o io.o dma.o misc_$(BITS).o \
Kevin Hao52d99622015-03-12 20:32:50 +080037 of_platform.o prom_parse.o
Roland McGrath01e31db2008-01-02 17:03:11 -080038obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
Paul Mackerras8568daa2006-02-10 16:02:20 +110039 signal_64.o ptrace32.o \
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +000040 paca.o nvram_64.o firmware.o
Michael Ellermane0d00592015-05-11 20:01:02 +100041obj-$(CONFIG_VDSO32) += vdso32/
Nicholas Piggin75eb7672017-08-01 22:00:52 +100042obj-$(CONFIG_PPC_WATCHDOG) += watchdog.o
K.Prasad5aae8a52010-06-15 11:35:19 +053043obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +000044obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
Michael Neulingcd5daaf2012-10-30 19:34:13 +000045obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power.o
Paolo Bonzini7c379522016-08-11 15:07:43 +020046obj-$(CONFIG_PPC_BOOK3S_64) += mce.o mce_power.o
Benjamin Herrenschmidt34d97e02010-07-14 14:12:16 +100047obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
Benjamin Herrenschmidta7f290d2005-11-11 21:15:21 +110048obj-$(CONFIG_PPC64) += vdso64/
Benjamin Herrenschmidte821ea72009-06-02 21:17:37 +000049obj-$(CONFIG_ALTIVEC) += vecemu.o
Paul Mackerrasf39224a2006-04-18 21:49:11 +100050obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
Shreyas B. Prabhu83289f92016-07-08 11:50:45 +053051obj-$(CONFIG_PPC_P7_NAP) += idle_book3s.o
Benjamin Herrenschmidt188917e2009-09-24 19:29:13 +000052procfs-y := proc_powerpc.o
David Gibsond3d21762005-11-10 15:26:20 +110053obj-$(CONFIG_PROC_FS) += $(procfs-y)
Stephen Rothwellbed59272007-03-04 17:04:44 +110054rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o
55obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y-y)
Benjamin Herrenschmidt3d541c42009-09-24 19:30:05 +000056obj-$(CONFIG_PPC_RTAS_DAEMON) += rtasd.o
Paul Mackerrasf4fcbbe2005-11-03 14:41:19 +110057obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
58obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
Nicholas Piggin5a61ef72017-05-09 13:16:52 +100059obj-$(CONFIG_PPC_DT_CPU_FTRS) += dt_cpu_ftrs.o
Gavin Shan317f06d2013-06-20 13:20:52 +080060obj-$(CONFIG_EEH) += eeh.o eeh_pe.o eeh_dev.o eeh_cache.o \
61 eeh_driver.o eeh_event.o eeh_sysfs.o
Paul Mackerras8ad200d2005-11-04 13:28:58 +110062obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
Michael Ellerman0cc47462005-12-04 18:39:37 +110063obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Mahesh Salgaonkareb39c8802012-02-16 01:14:22 +000064obj-$(CONFIG_FA_DUMP) += fadump.o
Kumar Gala4490c062010-10-08 08:32:11 -050065ifeq ($(CONFIG_PPC32),y)
Kumar Galafc4033b2008-06-18 16:26:52 -050066obj-$(CONFIG_E500) += idle_e500.o
Kumar Gala4490c062010-10-08 08:32:11 -050067endif
Paul Mackerras9b781722006-03-27 19:15:26 +110068obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
69obj-$(CONFIG_TAU) += tau_6xx.o
Anton Vorontsov90103f92010-05-17 22:56:52 +040070obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
71ifeq ($(CONFIG_FSL_BOOKE),y)
72obj-$(CONFIG_HIBERNATION) += swsusp_booke.o
73else
Michael Ellerman68201fb2016-08-11 16:03:14 +100074obj-$(CONFIG_HIBERNATION) += swsusp_$(BITS).o
Anton Vorontsov90103f92010-05-17 22:56:52 +040075endif
Stephen Rothwell2578bfa2007-09-21 10:16:20 +100076obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o
Michael Ellerman68201fb2016-08-11 16:03:14 +100077obj-$(CONFIG_MODULES) += module.o module_$(BITS).o
Paul Mackerras26f571d2007-10-04 11:02:09 +100078obj-$(CONFIG_44x) += cpu_setup_44x.o
Ian Munsie440bc682012-11-14 18:49:49 +000079obj-$(CONFIG_PPC_FSL_BOOK3E) += cpu_setup_fsl_booke.o
80obj-$(CONFIG_PPC_DOORBELL) += dbell.o
Michael Ellermanac5f89c2011-06-29 19:16:59 +000081obj-$(CONFIG_JUMP_LABEL) += jump_label.o
Paul Mackerras40ef8cb2005-10-10 22:50:37 +100082
Michael Ellerman68201fb2016-08-11 16:03:14 +100083extra-y := head_$(BITS).o
Josh Boyer15f65272007-08-20 07:27:07 -050084extra-$(CONFIG_40x) := head_40x.o
Paul Mackerras14cf11a2005-09-26 16:04:21 +100085extra-$(CONFIG_44x) := head_44x.o
86extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
Christophe Leroy968159c2017-08-08 13:58:54 +020087extra-$(CONFIG_PPC_8xx) := head_8xx.o
Paul Mackerras14cf11a2005-09-26 16:04:21 +100088extra-y += vmlinux.lds
89
Michael Ellerman68201fb2016-08-11 16:03:14 +100090obj-$(CONFIG_RELOCATABLE) += reloc_$(BITS).o
Suzuki Poulose9c5f7d32011-12-14 22:58:12 +000091
Stephen Rothwell2578bfa2007-09-21 10:16:20 +100092obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
Becky Bruce4fc665b2008-09-12 10:34:46 +000093obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
Jason Wessel17ce4522008-07-23 11:30:15 -050094obj-$(CONFIG_KGDB) += kgdb.o
Paul Mackerras9b6b5632005-10-06 12:06:20 +100095obj-$(CONFIG_BOOTX_TEXT) += btext.o
Paul Mackerras5ad57072005-11-05 10:33:55 +110096obj-$(CONFIG_SMP) += smp.o
Paul Mackerras7568cb42005-11-14 17:30:17 +110097obj-$(CONFIG_KPROBES) += kprobes.o
Anju T51c9c082017-02-08 15:20:51 +053098obj-$(CONFIG_OPTPROBES) += optprobes.o optprobes_head.o
Naveen N. Raoead514d2017-04-19 18:22:26 +053099obj-$(CONFIG_KPROBES_ON_FTRACE) += kprobes-ftrace.o
Ananth N Mavinakayanahalli8b7b80b2012-08-23 21:31:32 +0000100obj-$(CONFIG_UPROBES) += uprobes.o
Paul Mackerras13b8a272006-01-10 16:19:05 +1100101obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
Christoph Hellwigfd3e0bb2008-04-17 14:35:00 +1000102obj-$(CONFIG_STACKTRACE) += stacktrace.o
Becky Bruceec3cf2e2009-05-14 12:42:28 +0000103obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o
Benjamin Herrenschmidt4c75a6f2006-11-11 17:24:53 +1100104
Gavin Shan317f06d2013-06-20 13:20:52 +0800105pci64-$(CONFIG_PPC64) += pci_dn.o pci-hotplug.o isa-bridge.o
Michael Ellerman68201fb2016-08-11 16:03:14 +1000106obj-$(CONFIG_PCI) += pci_$(BITS).o $(pci64-y) \
Grant Likelyfbe65442009-08-25 20:07:11 +0000107 pci-common.o pci_of_scan.o
Michael Ellermandf87ef52007-05-08 12:58:34 +1000108obj-$(CONFIG_PCI_MSI) += msi.o
Thiago Jung Bauermannda665882016-11-29 23:45:50 +1100109obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o crash.o \
Michael Ellerman68201fb2016-08-11 16:03:14 +1000110 machine_kexec_$(BITS).o
Thiago Jung Bauermanna0458282016-11-29 23:45:51 +1100111obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file_$(BITS).o kexec_elf_$(BITS).o
Thiago Jung Bauermann467d2782016-12-19 16:22:32 -0800112ifeq ($(CONFIG_HAVE_IMA_KEXEC)$(CONFIG_IMA),yy)
113obj-y += ima_kexec.o
114endif
115
Al Viroc0803792006-08-31 19:02:42 -0400116obj-$(CONFIG_AUDIT) += audit.o
117obj64-$(CONFIG_AUDIT) += compat_audit.o
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000118
Michael Ellerman3cc30d02011-04-11 21:25:01 +0000119obj-$(CONFIG_PPC_IO_WORKAROUNDS) += io-workarounds.o
120
Naveen N. Rao7853f9c2017-04-25 19:25:53 +0530121obj-y += trace/
Scott Wooda1110652010-02-25 18:09:45 -0600122
Benjamin Herrenschmidtecd73cc2013-07-15 13:03:08 +1000123ifneq ($(CONFIG_PPC_INDIRECT_PIO),y)
Benjamin Herrenschmidt68a64352006-11-13 09:27:39 +1100124obj-y += iomap.o
Benjamin Herrenschmidt4cb3cee2006-11-11 17:25:10 +1100125endif
126
Michael Neuling98ae22e2013-02-13 16:21:35 +0000127obj64-$(CONFIG_PPC_TRANSACTIONAL_MEM) += tm.o
128
Paul Mackerras437a58d2005-11-18 15:43:34 +1100129obj-$(CONFIG_PPC64) += $(obj64-y)
Paul Mackerras73259272009-06-17 21:53:51 +1000130obj-$(CONFIG_PPC32) += $(obj32-y)
Paul Mackerras437a58d2005-11-18 15:43:34 +1100131
Thiago Jung Bauermannda665882016-11-29 23:45:50 +1100132ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC_CORE),)
Anton Vorontsov322b4392008-12-17 10:08:55 +0000133obj-y += ppc_save_regs.o
134endif
135
Liu Yu-B132012e1ae9c2012-03-15 10:52:13 +0000136obj-$(CONFIG_EPAPR_PARAVIRT) += epapr_paravirt.o epapr_hcalls.o
Alexander Grafd17051c2010-07-29 14:47:57 +0200137obj-$(CONFIG_KVM_GUEST) += kvm.o kvm_emul.o
Alexander Graf2a342ed2010-07-29 14:47:48 +0200138
Daniel Axtensbf76f732016-01-20 15:00:58 -0800139# Disable GCOV & sanitizers in odd or sensitive code
Michael Ellermana15098c2009-08-09 19:02:51 +0000140GCOV_PROFILE_prom_init.o := n
Daniel Axtensbf76f732016-01-20 15:00:58 -0800141UBSAN_SANITIZE_prom_init.o := n
Michael Ellermana15098c2009-08-09 19:02:51 +0000142GCOV_PROFILE_machine_kexec_64.o := n
Daniel Axtensbf76f732016-01-20 15:00:58 -0800143UBSAN_SANITIZE_machine_kexec_64.o := n
Michael Ellermana15098c2009-08-09 19:02:51 +0000144GCOV_PROFILE_machine_kexec_32.o := n
Daniel Axtensbf76f732016-01-20 15:00:58 -0800145UBSAN_SANITIZE_machine_kexec_32.o := n
Michael Ellermana15098c2009-08-09 19:02:51 +0000146GCOV_PROFILE_kprobes.o := n
Daniel Axtensbf76f732016-01-20 15:00:58 -0800147UBSAN_SANITIZE_kprobes.o := n
Naveen N. Raoead514d2017-04-19 18:22:26 +0530148GCOV_PROFILE_kprobes-ftrace.o := n
149UBSAN_SANITIZE_kprobes-ftrace.o := n
Daniel Axtensbf76f732016-01-20 15:00:58 -0800150UBSAN_SANITIZE_vdso.o := n
Michael Ellermana15098c2009-08-09 19:02:51 +0000151
David Gibson25c8a782005-10-27 16:27:25 +1000152extra-$(CONFIG_PPC_FPU) += fpu.o
Benjamin Herrenschmidte821ea72009-06-02 21:17:37 +0000153extra-$(CONFIG_ALTIVEC) += vector.o
Stephen Rothwell640768e2005-10-28 12:51:45 +1000154extra-$(CONFIG_PPC64) += entry_64.o
Anton Blanchard5ac47f72012-11-26 17:39:03 +0000155extra-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
Stephen Rothwell0a4690c2008-01-07 16:12:44 +1100156
157extra-y += systbl_chk.i
158$(obj)/systbl.o: systbl_chk
159
160quiet_cmd_systbl_chk = CALL $<
161 cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
162
163PHONY += systbl_chk
164systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
165 $(call cmd,systbl_chk)
Kumar Galae4ccde02008-02-12 02:32:00 +1100166
Michael Ellerman7719ed72009-06-11 02:12:28 +0000167ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y)
Michael Ellerman5c02cd22008-04-24 12:08:22 +1000168$(obj)/built-in.o: prom_init_check
169
170quiet_cmd_prom_init_check = CALL $<
171 cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" "$(obj)/prom_init.o"
172
173PHONY += prom_init_check
174prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o
175 $(call cmd,prom_init_check)
Michael Ellerman7719ed72009-06-11 02:12:28 +0000176endif
Michael Ellerman5c02cd22008-04-24 12:08:22 +1000177
Kumar Galae4ccde02008-02-12 02:32:00 +1100178clean-files := vmlinux.lds