blob: 612556faa527f583cf6fc3bc9a737adcaa18a105 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -07002#
3# Makefile for the RISC-V Linux kernel
4#
5
Alan Kao10626c32017-12-18 17:52:48 +08006ifdef CONFIG_FTRACE
Guo Ren67d94572020-12-17 16:01:39 +00007CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
8CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE)
Guo Ren5ad84ad2020-12-17 16:01:40 +00009CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE)
Alan Kao10626c32017-12-18 17:52:48 +080010endif
Nanyong Suna6a58ec2021-03-05 19:33:29 +080011CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,)
Alan Kao10626c32017-12-18 17:52:48 +080012
Nick Kossifidisfba8a862021-04-19 03:55:36 +030013ifdef CONFIG_KEXEC
Changbin Du030d6db2021-07-22 10:17:15 +080014AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
Nick Kossifidisfba8a862021-04-19 03:55:36 +030015endif
16
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070017extra-y += head.o
18extra-y += vmlinux.lds
19
Damien Le Moal335b1392020-03-16 09:47:38 +090020obj-y += soc.o
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070021obj-y += cpu.o
22obj-y += cpufeature.o
23obj-y += entry.o
24obj-y += irq.o
25obj-y += process.o
26obj-y += ptrace.o
27obj-y += reset.o
28obj-y += setup.o
29obj-y += signal.o
30obj-y += syscall_table.o
31obj-y += sys_riscv.o
32obj-y += time.o
33obj-y += traps.o
34obj-y += riscv_ksyms.o
35obj-y += stacktrace.o
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070036obj-y += cacheinfo.o
Zong Li043cb412020-03-10 00:55:43 +080037obj-y += patch.o
Guo Renc22b0bc2020-12-17 16:01:42 +000038obj-y += probes/
Christoph Hellwig6bd33e12019-10-28 13:10:41 +010039obj-$(CONFIG_MMU) += vdso.o vdso/
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070040
Anup Patel2bc3fc82020-08-17 18:12:50 +053041obj-$(CONFIG_RISCV_M_MODE) += traps_misaligned.o
Alan Kao9671f702018-10-09 10:18:33 +080042obj-$(CONFIG_FPU) += fpu.o
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070043obj-$(CONFIG_SMP) += smpboot.o
44obj-$(CONFIG_SMP) += smp.o
Atish Patra2875fe02020-03-17 18:11:40 -070045obj-$(CONFIG_SMP) += cpu_ops.o
Atish Patra2ffc48f2022-01-20 01:09:17 -080046
47obj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070048obj-$(CONFIG_MODULES) += module.o
Zong Liab1ef682018-03-15 16:50:41 +080049obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o
Alan Kaoc15ac4f2018-02-13 13:13:17 +080050
51obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
52obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o
Palmer Dabbeltfbe934d2017-07-10 18:08:08 -070053
Kefeng Wang48084c32020-05-07 23:04:45 +080054obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o
Mao Handbeb90b2019-08-29 14:57:00 +080055obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o
Mao Han98a93b02019-09-05 11:46:35 +080056obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o
Christoph Hellwig33206482019-10-28 13:10:35 +010057obj-$(CONFIG_RISCV_SBI) += sbi.o
Atish Patracfafe262020-03-17 18:11:43 -070058ifeq ($(CONFIG_RISCV_SBI), y)
59obj-$(CONFIG_SMP) += cpu_ops_sbi.o
60endif
Atish Patraf1e58582020-03-17 18:11:44 -070061obj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o
Vincent Chenfe89bd22020-04-16 10:38:05 +080062obj-$(CONFIG_KGDB) += kgdb.o
Nick Kossifidise53d2812021-04-19 03:55:38 +030063obj-$(CONFIG_KEXEC) += kexec_relocate.o crash_save_regs.o machine_kexec.o
Nick Kossifidis56409752021-04-19 03:55:39 +030064obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
Alan Kao178e9fc2018-04-20 07:27:49 +080065
Emil Renner Berthingebc00dd2020-07-14 09:40:44 +020066obj-$(CONFIG_JUMP_LABEL) += jump_label.o
67
Atish Patrab91540d2020-09-17 15:37:15 -070068obj-$(CONFIG_EFI) += efi.o