xref: /linux/arch/riscv/kernel/Makefile (revision e64f737ad70fee4a3c57d147fc511e5d5014b5dd)
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-$(CONFIG_RISCV_ALTERNATIVE) += alternative.o
22obj-y	+= cpu.o
23obj-y	+= cpufeature.o
24obj-y	+= entry.o
25obj-y	+= irq.o
26obj-y	+= process.o
27obj-y	+= ptrace.o
28obj-y	+= reset.o
29obj-y	+= setup.o
30obj-y	+= signal.o
31obj-y	+= syscall_table.o
32obj-y	+= sys_riscv.o
33obj-y	+= time.o
34obj-y	+= traps.o
35obj-y	+= riscv_ksyms.o
36obj-y	+= stacktrace.o
37obj-y	+= cacheinfo.o
38obj-y	+= patch.o
39obj-y	+= probes/
40obj-$(CONFIG_MMU) += vdso.o vdso/
41
42obj-$(CONFIG_RISCV_M_MODE)	+= traps_misaligned.o
43obj-$(CONFIG_FPU)		+= fpu.o
44obj-$(CONFIG_SMP)		+= smpboot.o
45obj-$(CONFIG_SMP)		+= smp.o
46obj-$(CONFIG_SMP)		+= cpu_ops.o
47
48obj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o
49obj-$(CONFIG_MODULES)		+= module.o
50obj-$(CONFIG_MODULE_SECTIONS)	+= module-sections.o
51
52obj-$(CONFIG_CPU_PM)		+= suspend_entry.o suspend.o
53
54obj-$(CONFIG_FUNCTION_TRACER)	+= mcount.o ftrace.o
55obj-$(CONFIG_DYNAMIC_FTRACE)	+= mcount-dyn.o
56
57obj-$(CONFIG_TRACE_IRQFLAGS)	+= trace_irq.o
58
59obj-$(CONFIG_PERF_EVENTS)	+= perf_callchain.o
60obj-$(CONFIG_HAVE_PERF_REGS)	+= perf_regs.o
61obj-$(CONFIG_RISCV_SBI)		+= sbi.o
62ifeq ($(CONFIG_RISCV_SBI), y)
63obj-$(CONFIG_SMP) += cpu_ops_sbi.o
64endif
65obj-$(CONFIG_HOTPLUG_CPU)	+= cpu-hotplug.o
66obj-$(CONFIG_KGDB)		+= kgdb.o
67obj-$(CONFIG_KEXEC)		+= kexec_relocate.o crash_save_regs.o machine_kexec.o
68obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
69
70obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o
71
72obj-$(CONFIG_EFI)		+= efi.o
73