1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for the Linux/LoongArch kernel.
8 obj-y += head.o cpu-probe.o cacheinfo.o env.o setup.o entry.o genex.o \
9 traps.o irq.o idle.o process.o dma.o mem.o io.o reset.o switch.o \
10 elf.o syscall.o signal.o time.o topology.o inst.o ptrace.o vdso.o \
11 alternative.o unwind.o
13 obj-$(CONFIG_ACPI) += acpi.o
14 obj-$(CONFIG_EFI) += efi.o
16 obj-$(CONFIG_CPU_HAS_FPU) += fpu.o kfpu.o
18 obj-$(CONFIG_CPU_HAS_LBT) += lbt.o
20 obj-$(CONFIG_ARCH_STRICT_ALIGN) += unaligned.o
22 ifdef CONFIG_FUNCTION_TRACER
23 ifndef CONFIG_DYNAMIC_FTRACE
24 obj-y += mcount.o ftrace.o
25 CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
27 obj-y += mcount_dyn.o ftrace_dyn.o
28 CFLAGS_REMOVE_ftrace_dyn.o = $(CC_FLAGS_FTRACE)
30 CFLAGS_REMOVE_inst.o = $(CC_FLAGS_FTRACE)
31 CFLAGS_REMOVE_time.o = $(CC_FLAGS_FTRACE)
32 CFLAGS_REMOVE_perf_event.o = $(CC_FLAGS_FTRACE)
33 CFLAGS_REMOVE_rethook.o = $(CC_FLAGS_FTRACE)
34 CFLAGS_REMOVE_rethook_trampoline.o = $(CC_FLAGS_FTRACE)
37 KASAN_SANITIZE_efi.o := n
38 KASAN_SANITIZE_cpu-probe.o := n
39 KASAN_SANITIZE_traps.o := n
40 KASAN_SANITIZE_smp.o := n
41 KASAN_SANITIZE_vdso.o := n
43 obj-$(CONFIG_MODULES) += module.o module-sections.o
44 obj-$(CONFIG_STACKTRACE) += stacktrace.o
46 obj-$(CONFIG_PROC_FS) += proc.o
48 obj-$(CONFIG_SMP) += smp.o
50 obj-$(CONFIG_NUMA) += numa.o
52 obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
54 obj-$(CONFIG_RELOCATABLE) += relocate.o
56 obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
57 obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
59 obj-$(CONFIG_UNWINDER_GUESS) += unwind_guess.o
60 obj-$(CONFIG_UNWINDER_PROLOGUE) += unwind_prologue.o
62 obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_regs.o
63 obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o
65 obj-$(CONFIG_KGDB) += kgdb.o
66 obj-$(CONFIG_KPROBES) += kprobes.o
67 obj-$(CONFIG_RETHOOK) += rethook.o rethook_trampoline.o
68 obj-$(CONFIG_UPROBES) += uprobes.o
70 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
72 CPPFLAGS_vmlinux.lds := $(KBUILD_CFLAGS)