xref: /linux/arch/riscv/kernel/Makefile (revision a6a58ecf98c3f6d95123ee3e66ccb6f7672c6e68)
1# SPDX-License-Identifier: GPL-2.0-only
2#
3# Makefile for the RISC-V Linux kernel
4#
5
6ifdef CONFIG_FTRACE
7CFLAGS_REMOVE_ftrace.o	= $(CC_FLAGS_FTRACE)
8CFLAGS_REMOVE_patch.o	= $(CC_FLAGS_FTRACE)
9CFLAGS_REMOVE_sbi.o	= $(CC_FLAGS_FTRACE)
10endif
11CFLAGS_syscall_table.o	+= $(call cc-option,-Wno-override-init,)
12
13extra-y += head.o
14extra-y += vmlinux.lds
15
16obj-y	+= soc.o
17obj-y	+= cpu.o
18obj-y	+= cpufeature.o
19obj-y	+= entry.o
20obj-y	+= irq.o
21obj-y	+= process.o
22obj-y	+= ptrace.o
23obj-y	+= reset.o
24obj-y	+= setup.o
25obj-y	+= signal.o
26obj-y	+= syscall_table.o
27obj-y	+= sys_riscv.o
28obj-y	+= time.o
29obj-y	+= traps.o
30obj-y	+= riscv_ksyms.o
31obj-y	+= stacktrace.o
32obj-y	+= cacheinfo.o
33obj-y	+= patch.o
34obj-y	+= probes/
35obj-$(CONFIG_MMU) += vdso.o vdso/
36
37obj-$(CONFIG_RISCV_M_MODE)	+= traps_misaligned.o
38obj-$(CONFIG_FPU)		+= fpu.o
39obj-$(CONFIG_SMP)		+= smpboot.o
40obj-$(CONFIG_SMP)		+= smp.o
41obj-$(CONFIG_SMP)		+= cpu_ops.o
42obj-$(CONFIG_SMP)		+= cpu_ops_spinwait.o
43obj-$(CONFIG_MODULES)		+= module.o
44obj-$(CONFIG_MODULE_SECTIONS)	+= module-sections.o
45
46obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
47obj-$(CONFIG_DYNAMIC_FTRACE)	+= mcount-dyn.o
48
49obj-$(CONFIG_RISCV_BASE_PMU)	+= perf_event.o
50obj-$(CONFIG_PERF_EVENTS)	+= perf_callchain.o
51obj-$(CONFIG_HAVE_PERF_REGS)	+= perf_regs.o
52obj-$(CONFIG_RISCV_SBI)		+= sbi.o
53ifeq ($(CONFIG_RISCV_SBI), y)
54obj-$(CONFIG_SMP) += cpu_ops_sbi.o
55endif
56obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
57obj-$(CONFIG_KGDB)		+= kgdb.o
58
59obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
60
61obj-$(CONFIG_EFI)		+= efi.o
62