Thomas Gleixner | ec8f24b | 2019-05-19 13:07:45 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 2 | # |
| 3 | # Makefile for the RISC-V Linux kernel |
| 4 | # |
| 5 | |
Alan Kao | 10626c3 | 2017-12-18 17:52:48 +0800 | [diff] [blame] | 6 | ifdef CONFIG_FTRACE |
Guo Ren | 67d9457 | 2020-12-17 16:01:39 +0000 | [diff] [blame] | 7 | CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) |
| 8 | CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) |
Guo Ren | 5ad84ad | 2020-12-17 16:01:40 +0000 | [diff] [blame] | 9 | CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) |
Alan Kao | 10626c3 | 2017-12-18 17:52:48 +0800 | [diff] [blame] | 10 | endif |
Nanyong Sun | a6a58ec | 2021-03-05 19:33:29 +0800 | [diff] [blame] | 11 | CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) |
Alan Kao | 10626c3 | 2017-12-18 17:52:48 +0800 | [diff] [blame] | 12 | |
Nick Kossifidis | fba8a86 | 2021-04-19 03:55:36 +0300 | [diff] [blame] | 13 | ifdef CONFIG_KEXEC |
Changbin Du | 030d6db | 2021-07-22 10:17:15 +0800 | [diff] [blame] | 14 | AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax) |
Nick Kossifidis | fba8a86 | 2021-04-19 03:55:36 +0300 | [diff] [blame] | 15 | endif |
| 16 | |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 17 | extra-y += head.o |
| 18 | extra-y += vmlinux.lds |
| 19 | |
Damien Le Moal | 335b139 | 2020-03-16 09:47:38 +0900 | [diff] [blame] | 20 | obj-y += soc.o |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 21 | obj-y += cpu.o |
| 22 | obj-y += cpufeature.o |
| 23 | obj-y += entry.o |
| 24 | obj-y += irq.o |
| 25 | obj-y += process.o |
| 26 | obj-y += ptrace.o |
| 27 | obj-y += reset.o |
| 28 | obj-y += setup.o |
| 29 | obj-y += signal.o |
| 30 | obj-y += syscall_table.o |
| 31 | obj-y += sys_riscv.o |
| 32 | obj-y += time.o |
| 33 | obj-y += traps.o |
| 34 | obj-y += riscv_ksyms.o |
| 35 | obj-y += stacktrace.o |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 36 | obj-y += cacheinfo.o |
Zong Li | 043cb41 | 2020-03-10 00:55:43 +0800 | [diff] [blame] | 37 | obj-y += patch.o |
Guo Ren | c22b0bc | 2020-12-17 16:01:42 +0000 | [diff] [blame] | 38 | obj-y += probes/ |
Christoph Hellwig | 6bd33e1 | 2019-10-28 13:10:41 +0100 | [diff] [blame] | 39 | obj-$(CONFIG_MMU) += vdso.o vdso/ |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 40 | |
Anup Patel | 2bc3fc8 | 2020-08-17 18:12:50 +0530 | [diff] [blame] | 41 | obj-$(CONFIG_RISCV_M_MODE) += traps_misaligned.o |
Alan Kao | 9671f70 | 2018-10-09 10:18:33 +0800 | [diff] [blame] | 42 | obj-$(CONFIG_FPU) += fpu.o |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 43 | obj-$(CONFIG_SMP) += smpboot.o |
| 44 | obj-$(CONFIG_SMP) += smp.o |
Atish Patra | 2875fe0 | 2020-03-17 18:11:40 -0700 | [diff] [blame] | 45 | obj-$(CONFIG_SMP) += cpu_ops.o |
Atish Patra | 2ffc48f | 2022-01-20 01:09:17 -0800 | [diff] [blame] | 46 | |
| 47 | obj-$(CONFIG_RISCV_BOOT_SPINWAIT) += cpu_ops_spinwait.o |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 48 | obj-$(CONFIG_MODULES) += module.o |
Zong Li | ab1ef68 | 2018-03-15 16:50:41 +0800 | [diff] [blame] | 49 | obj-$(CONFIG_MODULE_SECTIONS) += module-sections.o |
Alan Kao | c15ac4f | 2018-02-13 13:13:17 +0800 | [diff] [blame] | 50 | |
| 51 | obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o |
| 52 | obj-$(CONFIG_DYNAMIC_FTRACE) += mcount-dyn.o |
Palmer Dabbelt | fbe934d | 2017-07-10 18:08:08 -0700 | [diff] [blame] | 53 | |
Kefeng Wang | 48084c3 | 2020-05-07 23:04:45 +0800 | [diff] [blame] | 54 | obj-$(CONFIG_RISCV_BASE_PMU) += perf_event.o |
Mao Han | dbeb90b | 2019-08-29 14:57:00 +0800 | [diff] [blame] | 55 | obj-$(CONFIG_PERF_EVENTS) += perf_callchain.o |
Mao Han | 98a93b0 | 2019-09-05 11:46:35 +0800 | [diff] [blame] | 56 | obj-$(CONFIG_HAVE_PERF_REGS) += perf_regs.o |
Christoph Hellwig | 3320648 | 2019-10-28 13:10:35 +0100 | [diff] [blame] | 57 | obj-$(CONFIG_RISCV_SBI) += sbi.o |
Atish Patra | cfafe26 | 2020-03-17 18:11:43 -0700 | [diff] [blame] | 58 | ifeq ($(CONFIG_RISCV_SBI), y) |
| 59 | obj-$(CONFIG_SMP) += cpu_ops_sbi.o |
| 60 | endif |
Atish Patra | f1e5858 | 2020-03-17 18:11:44 -0700 | [diff] [blame] | 61 | obj-$(CONFIG_HOTPLUG_CPU) += cpu-hotplug.o |
Vincent Chen | fe89bd2 | 2020-04-16 10:38:05 +0800 | [diff] [blame] | 62 | obj-$(CONFIG_KGDB) += kgdb.o |
Nick Kossifidis | e53d281 | 2021-04-19 03:55:38 +0300 | [diff] [blame] | 63 | obj-$(CONFIG_KEXEC) += kexec_relocate.o crash_save_regs.o machine_kexec.o |
Nick Kossifidis | 5640975 | 2021-04-19 03:55:39 +0300 | [diff] [blame] | 64 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
Alan Kao | 178e9fc | 2018-04-20 07:27:49 +0800 | [diff] [blame] | 65 | |
Emil Renner Berthing | ebc00dd | 2020-07-14 09:40:44 +0200 | [diff] [blame] | 66 | obj-$(CONFIG_JUMP_LABEL) += jump_label.o |
| 67 | |
Atish Patra | b91540d | 2020-09-17 15:37:15 -0700 | [diff] [blame] | 68 | obj-$(CONFIG_EFI) += efi.o |