blob: 391bf7e1ba2f7a8830c5f82c91652babac700d41 [file] [log] [blame]
Paul Mackerras14cf11a2005-09-26 16:04:21 +10001#
2# Makefile for the linux kernel.
3#
4
Roland McGrath80fdf472007-12-20 03:58:00 -08005CFLAGS_ptrace.o += -DUTS_MACHINE='"$(UTS_MACHINE)"'
6
Michael Ellermanba55bd72009-06-09 20:48:51 +00007subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
8
Stephen Rothwellbd142b72005-09-30 13:51:25 +10009ifeq ($(CONFIG_PPC64),y)
Stephen Rothwell08a644e2007-11-07 16:13:29 +110010CFLAGS_prom_init.o += -mno-minimal-toc
Stephen Rothwellbd142b72005-09-30 13:51:25 +100011endif
Stephen Rothwellcabb5582005-09-30 16:16:52 +100012ifeq ($(CONFIG_PPC32),y)
Paul Mackerras9b6b5632005-10-06 12:06:20 +100013CFLAGS_prom_init.o += -fPIC
Paul Mackerrasb3491262005-10-06 13:24:50 +100014CFLAGS_btext.o += -fPIC
Stephen Rothwellcabb5582005-09-30 16:16:52 +100015endif
Paul Mackerras9b6b5632005-10-06 12:06:20 +100016
Steven Rostedt606576c2008-10-06 19:06:12 -040017ifdef CONFIG_FUNCTION_TRACER
Steven Rostedt4e491d12008-05-14 23:49:44 -040018# Do not trace early boot code
Tony Breeds7563dc62008-09-02 16:50:38 +100019CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
20CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
21CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
Steven Rostedtf1eecf02008-11-26 15:54:46 -050022CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog
Steven Rostedt6794c782009-02-09 21:10:27 -080023# do not trace tracer code
Tony Breeds7563dc62008-09-02 16:50:38 +100024CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog
Steven Rostedt6794c782009-02-09 21:10:27 -080025# timers used by tracing
26CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog
Steven Rostedt4e491d12008-05-14 23:49:44 -040027endif
28
Matthew Wilcox64ac24e2008-03-07 21:55:58 -050029obj-y := cputable.o ptrace.o syscalls.o \
Paul Mackerras624cee32006-01-12 21:22:34 +110030 irq.o align.o signal_32.o pmc.o vdso.o \
Benjamin Herrenschmidt22e38f22007-06-04 15:15:49 +100031 init_task.o process.o systbl.o idle.o \
Michael Ellerman698193d2010-11-08 17:31:36 +000032 signal.o sysfs.o cacheinfo.o time.o \
33 prom.o traps.o setup-common.o \
34 udbg.o misc.o io.o dma.o \
35 misc_$(CONFIG_WORD_SIZE).o vdso32/
Roland McGrath01e31db2008-01-02 17:03:11 -080036obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
Paul Mackerras8568daa2006-02-10 16:02:20 +110037 signal_64.o ptrace32.o \
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +000038 paca.o nvram_64.o firmware.o
K.Prasad5aae8a52010-06-15 11:35:19 +053039obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +000040obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_ppc970.o cpu_setup_pa6t.o
Benjamin Herrenschmidt24cc67d2011-01-20 18:50:55 +110041obj-$(CONFIG_PPC_BOOK3S_64) += cpu_setup_power7.o
Paul Mackerras549e8152008-08-30 11:43:47 +100042obj64-$(CONFIG_RELOCATABLE) += reloc_64.o
Benjamin Herrenschmidt34d97e02010-07-14 14:12:16 +100043obj-$(CONFIG_PPC_BOOK3E_64) += exceptions-64e.o idle_book3e.o
Benjamin Herrenschmidt76b4eda2011-04-14 22:32:01 +000044obj-$(CONFIG_PPC_A2) += cpu_setup_a2.o
Benjamin Herrenschmidta7f290d2005-11-11 21:15:21 +110045obj-$(CONFIG_PPC64) += vdso64/
Benjamin Herrenschmidte821ea72009-06-02 21:17:37 +000046obj-$(CONFIG_ALTIVEC) += vecemu.o
Paul Mackerrasf39224a2006-04-18 21:49:11 +100047obj-$(CONFIG_PPC_970_NAP) += idle_power4.o
Benjamin Herrenschmidt948cf672011-01-24 18:42:41 +110048obj-$(CONFIG_PPC_P7_NAP) += idle_power7.o
Grant Likely94c09312010-06-08 07:48:14 -060049obj-$(CONFIG_PPC_OF) += of_platform.o prom_parse.o
Domen Puncer6f668282007-09-21 00:00:11 +100050obj-$(CONFIG_PPC_CLOCK) += clock.o
Benjamin Herrenschmidt188917e2009-09-24 19:29:13 +000051procfs-y := proc_powerpc.o
David Gibsond3d21762005-11-10 15:26:20 +110052obj-$(CONFIG_PROC_FS) += $(procfs-y)
Stephen Rothwellbed59272007-03-04 17:04:44 +110053rtaspci-$(CONFIG_PPC64)-$(CONFIG_PCI) := rtas_pci.o
54obj-$(CONFIG_PPC_RTAS) += rtas.o rtas-rtc.o $(rtaspci-y-y)
Benjamin Herrenschmidt3d541c42009-09-24 19:30:05 +000055obj-$(CONFIG_PPC_RTAS_DAEMON) += rtasd.o
Paul Mackerrasf4fcbbe2005-11-03 14:41:19 +110056obj-$(CONFIG_RTAS_FLASH) += rtas_flash.o
57obj-$(CONFIG_RTAS_PROC) += rtas-proc.o
David Gibsond3d21762005-11-10 15:26:20 +110058obj-$(CONFIG_LPARCFG) += lparcfg.o
Stephen Rothwell58046012005-10-24 14:22:37 +100059obj-$(CONFIG_IBMVIO) += vio.o
Heiko J Schickd7a30102005-11-16 08:56:43 +010060obj-$(CONFIG_IBMEBUS) += ibmebus.o
Paul Mackerras8ad200d2005-11-04 13:28:58 +110061obj-$(CONFIG_GENERIC_TBSYNC) += smp-tbsync.o
Michael Ellerman0cc47462005-12-04 18:39:37 +110062obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Mahesh Salgaonkareb39c882012-02-16 01:14:22 +000063obj-$(CONFIG_FA_DUMP) += fadump.o
Kumar Gala4490c062010-10-08 08:32:11 -050064ifeq ($(CONFIG_PPC32),y)
Kumar Galafc4033b2008-06-18 16:26:52 -050065obj-$(CONFIG_E500) += idle_e500.o
Kumar Gala4490c062010-10-08 08:32:11 -050066endif
Paul Mackerras9b781722006-03-27 19:15:26 +110067obj-$(CONFIG_6xx) += idle_6xx.o l2cr_6xx.o cpu_setup_6xx.o
68obj-$(CONFIG_TAU) += tau_6xx.o
Anton Vorontsov90103f92010-05-17 22:56:52 +040069obj-$(CONFIG_HIBERNATION) += swsusp.o suspend.o
70ifeq ($(CONFIG_FSL_BOOKE),y)
71obj-$(CONFIG_HIBERNATION) += swsusp_booke.o
72else
73obj-$(CONFIG_HIBERNATION) += swsusp_$(CONFIG_WORD_SIZE).o
74endif
Stephen Rothwell2578bfa2007-09-21 10:16:20 +100075obj64-$(CONFIG_HIBERNATION) += swsusp_asm64.o
Kumar Galaf0c426b2008-06-21 02:31:01 +100076obj-$(CONFIG_MODULES) += module.o module_$(CONFIG_WORD_SIZE).o
Paul Mackerras26f571d2007-10-04 11:02:09 +100077obj-$(CONFIG_44x) += cpu_setup_44x.o
Kumar Gala4490c062010-10-08 08:32:11 -050078obj-$(CONFIG_PPC_FSL_BOOK3E) += cpu_setup_fsl_booke.o dbell.o
Benjamin Herrenschmidt89c81792010-07-09 15:31:28 +100079obj-$(CONFIG_PPC_BOOK3E_64) += dbell.o
Michael Ellermanac5f89c2011-06-29 19:16:59 +000080obj-$(CONFIG_JUMP_LABEL) += jump_label.o
Paul Mackerras40ef8cb2005-10-10 22:50:37 +100081
Benjamin Herrenschmidt2d27cfd2009-07-23 23:15:59 +000082extra-y := head_$(CONFIG_WORD_SIZE).o
Josh Boyer15f65272007-08-20 07:27:07 -050083extra-$(CONFIG_40x) := head_40x.o
Paul Mackerras14cf11a2005-09-26 16:04:21 +100084extra-$(CONFIG_44x) := head_44x.o
85extra-$(CONFIG_FSL_BOOKE) := head_fsl_booke.o
86extra-$(CONFIG_8xx) := head_8xx.o
Paul Mackerras14cf11a2005-09-26 16:04:21 +100087extra-y += vmlinux.lds
88
Suzuki Poulose9c5f7d32011-12-14 22:58:12 +000089obj-$(CONFIG_RELOCATABLE_PPC32) += reloc_32.o
90
Stephen Rothwell2578bfa2007-09-21 10:16:20 +100091obj-$(CONFIG_PPC32) += entry_32.o setup_32.o
Becky Bruce4fc665b2008-09-12 10:34:46 +000092obj-$(CONFIG_PPC64) += dma-iommu.o iommu.o
Jason Wessel17ce4522008-07-23 11:30:15 -050093obj-$(CONFIG_KGDB) += kgdb.o
Benjamin Herrenschmidt28794d32009-03-10 17:53:27 +000094obj-$(CONFIG_PPC_OF_BOOT_TRAMPOLINE) += prom_init.o
Paul Mackerras20c8c212005-09-28 20:28:14 +100095obj-$(CONFIG_MODULES) += ppc_ksyms.o
Paul Mackerras9b6b5632005-10-06 12:06:20 +100096obj-$(CONFIG_BOOTX_TEXT) += btext.o
Paul Mackerras5ad57072005-11-05 10:33:55 +110097obj-$(CONFIG_SMP) += smp.o
Paul Mackerras7568cb42005-11-14 17:30:17 +110098obj-$(CONFIG_KPROBES) += kprobes.o
Paul Mackerras13b8a272006-01-10 16:19:05 +110099obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
Christoph Hellwigfd3e0bb2008-04-17 14:35:00 +1000100obj-$(CONFIG_STACKTRACE) += stacktrace.o
Becky Bruceec3cf2e2009-05-14 12:42:28 +0000101obj-$(CONFIG_SWIOTLB) += dma-swiotlb.o
Benjamin Herrenschmidt4c75a6f2006-11-11 17:24:53 +1100102
Stephen Rothwell2578bfa2007-09-21 10:16:20 +1000103pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
104obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
Grant Likelyfbe65442009-08-25 20:07:11 +0000105 pci-common.o pci_of_scan.o
Michael Ellermandf87ef52007-05-08 12:58:34 +1000106obj-$(CONFIG_PCI_MSI) += msi.o
Stephen Rothwell2578bfa2007-09-21 10:16:20 +1000107obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o \
108 machine_kexec_$(CONFIG_WORD_SIZE).o
Al Viroc0803792006-08-31 19:02:42 -0400109obj-$(CONFIG_AUDIT) += audit.o
110obj64-$(CONFIG_AUDIT) += compat_audit.o
Stephen Rothwellcabb5582005-09-30 16:16:52 +1000111
Michael Ellerman3cc30d02011-04-11 21:25:01 +0000112obj-$(CONFIG_PPC_IO_WORKAROUNDS) += io-workarounds.o
113
Steven Rostedt4e491d12008-05-14 23:49:44 -0400114obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
Steven Rostedt6794c782009-02-09 21:10:27 -0800115obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
Ian Munsie02424d82011-02-02 17:27:24 +0000116obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
Scott Wood9d6df3f2010-02-25 18:04:33 -0600117obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
Scott Wooda1110652010-02-25 18:09:45 -0600118
Scott Wood9d6df3f2010-02-25 18:04:33 -0600119obj-$(CONFIG_PPC_PERF_CTRS) += perf_event.o
Paul Mackerras105988c2009-06-17 21:50:04 +1000120obj64-$(CONFIG_PPC_PERF_CTRS) += power4-pmu.o ppc970-pmu.o power5-pmu.o \
121 power5+-pmu.o power6-pmu.o power7-pmu.o
Paul Mackerras73259272009-06-17 21:53:51 +1000122obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o
Steven Rostedt4e491d12008-05-14 23:49:44 -0400123
Scott Wooda1110652010-02-25 18:09:45 -0600124obj-$(CONFIG_FSL_EMB_PERF_EVENT) += perf_event_fsl_emb.o
125obj-$(CONFIG_FSL_EMB_PERF_EVENT_E500) += e500-pmu.o
126
Scott Wood5dd57a12007-09-18 15:29:35 -0500127obj-$(CONFIG_8XX_MINIMAL_FPEMU) += softemu8xx.o
128
Benjamin Herrenschmidt4cb3cee2006-11-11 17:25:10 +1100129ifneq ($(CONFIG_PPC_INDIRECT_IO),y)
Benjamin Herrenschmidt68a64352006-11-13 09:27:39 +1100130obj-y += iomap.o
Benjamin Herrenschmidt4cb3cee2006-11-11 17:25:10 +1100131endif
132
Paul Mackerras437a58d2005-11-18 15:43:34 +1100133obj-$(CONFIG_PPC64) += $(obj64-y)
Paul Mackerras73259272009-06-17 21:53:51 +1000134obj-$(CONFIG_PPC32) += $(obj32-y)
Paul Mackerras437a58d2005-11-18 15:43:34 +1100135
Anton Vorontsov73753312008-12-17 10:09:01 +0000136ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
Anton Vorontsov322b4392008-12-17 10:08:55 +0000137obj-y += ppc_save_regs.o
138endif
139
Alexander Grafd17051c2010-07-29 14:47:57 +0200140obj-$(CONFIG_KVM_GUEST) += kvm.o kvm_emul.o
Alexander Graf2a342ed2010-07-29 14:47:48 +0200141
Michael Ellermana15098c2009-08-09 19:02:51 +0000142# Disable GCOV in odd or sensitive code
143GCOV_PROFILE_prom_init.o := n
144GCOV_PROFILE_ftrace.o := n
145GCOV_PROFILE_machine_kexec_64.o := n
146GCOV_PROFILE_machine_kexec_32.o := n
147GCOV_PROFILE_kprobes.o := n
148
David Gibson25c8a782005-10-27 16:27:25 +1000149extra-$(CONFIG_PPC_FPU) += fpu.o
Benjamin Herrenschmidte821ea72009-06-02 21:17:37 +0000150extra-$(CONFIG_ALTIVEC) += vector.o
Stephen Rothwell640768e2005-10-28 12:51:45 +1000151extra-$(CONFIG_PPC64) += entry_64.o
Stephen Rothwell0a4690c2008-01-07 16:12:44 +1100152
153extra-y += systbl_chk.i
154$(obj)/systbl.o: systbl_chk
155
156quiet_cmd_systbl_chk = CALL $<
157 cmd_systbl_chk = $(CONFIG_SHELL) $< $(obj)/systbl_chk.i
158
159PHONY += systbl_chk
160systbl_chk: $(src)/systbl_chk.sh $(obj)/systbl_chk.i
161 $(call cmd,systbl_chk)
Kumar Galae4ccde02008-02-12 02:32:00 +1100162
Michael Ellerman7719ed72009-06-11 02:12:28 +0000163ifeq ($(CONFIG_PPC_OF_BOOT_TRAMPOLINE),y)
Michael Ellerman5c02cd22008-04-24 12:08:22 +1000164$(obj)/built-in.o: prom_init_check
165
166quiet_cmd_prom_init_check = CALL $<
167 cmd_prom_init_check = $(CONFIG_SHELL) $< "$(NM)" "$(obj)/prom_init.o"
168
169PHONY += prom_init_check
170prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o
171 $(call cmd,prom_init_check)
Michael Ellerman7719ed72009-06-11 02:12:28 +0000172endif
Michael Ellerman5c02cd22008-04-24 12:08:22 +1000173
Kumar Galae4ccde02008-02-12 02:32:00 +1100174clean-files := vmlinux.lds