xref: /openbmc/linux/arch/riscv/kernel/Makefile (revision 4ce94eab)
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
11
12extra-y += head.o
13extra-y += vmlinux.lds
14
15obj-y	+= soc.o
16obj-y	+= cpu.o
17obj-y	+= cpufeature.o
18obj-y	+= entry.o
19obj-y	+= irq.o
20obj-y	+= process.o
21obj-y	+= ptrace.o
22obj-y	+= reset.o
23obj-y	+= setup.o
24obj-y	+= signal.o
25obj-y	+= syscall_table.o
26obj-y	+= sys_riscv.o
27obj-y	+= time.o
28obj-y	+= traps.o
29obj-y	+= riscv_ksyms.o
30obj-y	+= stacktrace.o
31obj-y	+= cacheinfo.o
32obj-y	+= patch.o
33obj-y	+= probes/
34obj-$(CONFIG_MMU) += vdso.o vdso/
35
36obj-$(CONFIG_RISCV_M_MODE)	+= traps_misaligned.o
37obj-$(CONFIG_FPU)		+= fpu.o
38obj-$(CONFIG_SMP)		+= smpboot.o
39obj-$(CONFIG_SMP)		+= smp.o
40obj-$(CONFIG_SMP)		+= cpu_ops.o
41obj-$(CONFIG_SMP)		+= cpu_ops_spinwait.o
42obj-$(CONFIG_MODULES)		+= module.o
43obj-$(CONFIG_MODULE_SECTIONS)	+= module-sections.o
44
45obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
46obj-$(CONFIG_DYNAMIC_FTRACE)	+= mcount-dyn.o
47
48obj-$(CONFIG_RISCV_BASE_PMU)	+= perf_event.o
49obj-$(CONFIG_PERF_EVENTS)	+= perf_callchain.o
50obj-$(CONFIG_HAVE_PERF_REGS)	+= perf_regs.o
51obj-$(CONFIG_RISCV_SBI)		+= sbi.o
52ifeq ($(CONFIG_RISCV_SBI), y)
53obj-$(CONFIG_SMP) += cpu_ops_sbi.o
54endif
55obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
56obj-$(CONFIG_KGDB)		+= kgdb.o
57
58obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
59
60obj-$(CONFIG_EFI)		+= efi.o
61