xref: /openbmc/linux/arch/riscv/kernel/Makefile (revision 1c4b5ecb)
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
46
47obj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o
48obj-$(CONFIG_MODULES)		+= module.o
49obj-$(CONFIG_MODULE_SECTIONS)	+= module-sections.o
50
51obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
52obj-$(CONFIG_DYNAMIC_FTRACE)	+= mcount-dyn.o
53
54obj-$(CONFIG_RISCV_BASE_PMU)	+= perf_event.o
55obj-$(CONFIG_PERF_EVENTS)	+= perf_callchain.o
56obj-$(CONFIG_HAVE_PERF_REGS)	+= perf_regs.o
57obj-$(CONFIG_RISCV_SBI)		+= sbi.o
58ifeq ($(CONFIG_RISCV_SBI), y)
59obj-$(CONFIG_SMP) += cpu_ops_sbi.o
60endif
61obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
62obj-$(CONFIG_KGDB)		+= kgdb.o
63obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
64obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
65
66obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
67
68obj-$(CONFIG_EFI)		+= efi.o
69