xref: /freebsd/sys/conf/Makefile.riscv (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
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
4#
5# Makefile for FreeBSD
6#
7# RISCVTODO: copy pasted from aarch64, needs to be
8# constructed from a machine description:
9#	config machineid
10# Most changes should be made in the machine description
11#	/sys/riscv/conf/``machineid''
12# after which you should do
13#	 config machineid
14# Generic makefile changes should be made in
15#	/sys/conf/Makefile.riscv
16# after which config should be rerun for all machines.
17#
18
19# Which version of config(8) is required.
20%VERSREQ=	600012
21
22.if !defined(S)
23S=	../../..
24.endif
25.include "$S/conf/kern.pre.mk"
26
27INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
28
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.
35KERNEL_LMA?=	0x80200000
36LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}'
37
38.if !empty(DDB_ENABLED) || !empty(DTRACE_ENABLED) || !empty(HWPMC_ENABLED)
39CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
40.endif
41
42%BEFORE_DEPEND
43
44%OBJS
45
46%FILES.c
47
48%FILES.s
49
50%FILES.m
51
52%CLEAN
53
54%RULES
55
56.include "$S/conf/kern.post.mk"
57