xref: /openbmc/linux/arch/riscv/mm/Makefile (revision 59c9160a)
1# SPDX-License-Identifier: GPL-2.0-only
2
3CFLAGS_init.o := -mcmodel=medany
4ifdef CONFIG_RELOCATABLE
5CFLAGS_init.o += -fno-pie
6endif
7
8ifdef CONFIG_FTRACE
9CFLAGS_REMOVE_init.o = $(CC_FLAGS_FTRACE)
10CFLAGS_REMOVE_cacheflush.o = $(CC_FLAGS_FTRACE)
11endif
12
13KCOV_INSTRUMENT_init.o := n
14
15obj-y += init.o
16obj-$(CONFIG_MMU) += extable.o fault.o pageattr.o pgtable.o
17obj-y += cacheflush.o
18obj-y += context.o
19obj-y += pmem.o
20
21ifeq ($(CONFIG_MMU),y)
22obj-$(CONFIG_SMP) += tlbflush.o
23endif
24obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
25obj-$(CONFIG_PTDUMP_CORE) += ptdump.o
26obj-$(CONFIG_KASAN)   += kasan_init.o
27
28ifdef CONFIG_KASAN
29KASAN_SANITIZE_kasan_init.o := n
30KASAN_SANITIZE_init.o := n
31ifdef CONFIG_DEBUG_VIRTUAL
32KASAN_SANITIZE_physaddr.o := n
33endif
34endif
35
36obj-$(CONFIG_DEBUG_VIRTUAL) += physaddr.o
37obj-$(CONFIG_RISCV_DMA_NONCOHERENT) += dma-noncoherent.o
38obj-$(CONFIG_RISCV_NONSTANDARD_CACHE_OPS) += cache-ops.o
39