xref: /openbmc/linux/arch/riscv/kernel/Makefile (revision 78c5335b)
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
13ifdef CONFIG_KEXEC
14AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
15endif
16
17extra-y += head.o
18extra-y += vmlinux.lds
19
20obj-y	+= soc.o
21obj-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
36obj-y	+= cacheinfo.o
37obj-y	+= patch.o
38obj-y	+= probes/
39obj-$(CONFIG_MMU) += vdso.o vdso/
40
41obj-$(CONFIG_RISCV_M_MODE)	+= traps_misaligned.o
42obj-$(CONFIG_FPU)		+= fpu.o
43obj-$(CONFIG_SMP)		+= smpboot.o
44obj-$(CONFIG_SMP)		+= smp.o
45obj-$(CONFIG_SMP)		+= cpu_ops.o
46obj-$(CONFIG_SMP)		+= cpu_ops_spinwait.o
47obj-$(CONFIG_MODULES)		+= module.o
48obj-$(CONFIG_MODULE_SECTIONS)	+= module-sections.o
49
50obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
51obj-$(CONFIG_DYNAMIC_FTRACE)	+= mcount-dyn.o
52
53obj-$(CONFIG_RISCV_BASE_PMU)	+= perf_event.o
54obj-$(CONFIG_PERF_EVENTS)	+= perf_callchain.o
55obj-$(CONFIG_HAVE_PERF_REGS)	+= perf_regs.o
56obj-$(CONFIG_RISCV_SBI)		+= sbi.o
57ifeq ($(CONFIG_RISCV_SBI), y)
58obj-$(CONFIG_SMP) += cpu_ops_sbi.o
59endif
60obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
61obj-$(CONFIG_KGDB)		+= kgdb.o
62obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
63obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
64
65obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
66
67obj-$(CONFIG_EFI)		+= efi.o
68