summaryrefslogtreecommitdiff
path: root/Makefile
blob: fead60d2fd78ad66504bca156d2fdd0195c4bd18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
TARGET?=virt
BUILD?=debug
CROSS_COMPILE?=riscv64-unknown-elf- 
GDB_PORT?=1234
CFLAGS=-nostdlib -ffreestanding -mcmodel=medany -I${.CURDIR}/include 
.if ${BUILD}==debug
CFLAGS+=-ggdb
.endif
.export

sys: ${SRC} lib/libc/build/libc.a lib/libfdt/build/libfdt.a
	@echo "building kernel"
	(${MAKE} -C sys -e) 

lib/libc/build/libc.a: 
	@echo "building libc"
	(${MAKE} -C lib/libc -e)

lib/libfdt/build/libfdt.a: 
	@echo "building libfdt"
	(${MAKE} -C lib/libfdt -e)

debug: sys
	(${MAKE} -C sys -e debug) 

clean:
	(${MAKE} -C sys -e clean)
	(${MAKE} -C lib/libc -e clean)
	(${MAKE} -C lib/libfdt -e clean)

.PHONY: sys debug all clean