1 # Makefile.riscv -- with config changes.
2 # Copyright 1990 W. Jolitz
3 # from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49
7 # RISCVTODO: copy pasted from aarch64, needs to be
8 # constructed from a machine description:
10 # Most changes should be made in the machine description
11 # /sys/riscv/conf/``machineid''
12 # after which you should do
14 # Generic makefile changes should be made in
15 # /sys/conf/Makefile.riscv
16 # after which config should be rerun for all machines.
19 # Which version of config(8) is required.
25 .include "$S/conf/kern.pre.mk"
27 INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
29 # Set the ELF LMA to the address that OpenSBI's fw_jump jumps to. This allows
30 # us to load the kernel with the -kernel flag in QEMU without having to embed
31 # it inside BBL or OpenSBI's fw_payload first.
32 # Note: For rv32 the start address is different (0x80400000).
33 # We set this value using --defsym rather than hardcoding it in ldscript.riscv
34 # so that different kernel configs can override the load address.
35 KERNEL_LMA?= 0x80200000
36 LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}'
38 .if !empty(DDB_ENABLED) || !empty(DTRACE_ENABLED) || !empty(HWPMC_ENABLED)
39 CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
56 .include "$S/conf/kern.post.mk"