xref: /freebsd/sys/conf/Makefile.riscv (revision 734e82fe33aa764367791a7d603b383996c6b40b)
1# Makefile.riscv -- with config changes.
2# Copyright 1990 W. Jolitz
3#	from: @(#)Makefile.i386	7.1 5/10/91
4#	from FreeBSD: src/sys/conf/Makefile.i386,v 1.255 2002/02/20 23:35:49
5#
6# Makefile for FreeBSD
7#
8# RISCVTODO: copy pasted from aarch64, needs to be
9# constructed from a machine description:
10#	config machineid
11# Most changes should be made in the machine description
12#	/sys/riscv/conf/``machineid''
13# after which you should do
14#	 config machineid
15# Generic makefile changes should be made in
16#	/sys/conf/Makefile.riscv
17# after which config should be rerun for all machines.
18#
19
20# Which version of config(8) is required.
21%VERSREQ=	600012
22
23.if !defined(S)
24S=	../../..
25.endif
26.include "$S/conf/kern.pre.mk"
27
28INCLUDES+= -I$S/contrib/libfdt -I$S/contrib/device-tree/include
29
30# Set the ELF LMA to the address that OpenSBI's fw_jump jumps to. This allows
31# us to load the kernel with the -kernel flag in QEMU without having to embed
32# it inside BBL or OpenSBI's fw_payload first.
33# Note: For rv32 the start address is different (0x80400000).
34# We set this value using --defsym rather than hardcoding it in ldscript.riscv
35# so that different kernel configs can override the load address.
36KERNEL_LMA?=	0x80200000
37LDFLAGS+= --defsym='kernel_lma=${KERNEL_LMA}'
38
39.if !empty(DDB_ENABLED) || !empty(DTRACE_ENABLED) || !empty(HWPMC_ENABLED)
40CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
41.endif
42
43# hack because genassym.c includes sys/bus.h which includes these.
44genassym.o: bus_if.h device_if.h
45
46%BEFORE_DEPEND
47
48%OBJS
49
50%FILES.c
51
52%FILES.s
53
54%FILES.m
55
56%CLEAN
57
58%RULES
59
60.include "$S/conf/kern.post.mk"
61