1SubDir HAIKU_TOP src system boot arch riscv64 ;
2
3SubDirC++Flags -fno-rtti ;
4
5# Optimizations create infinite recursion otherwise.
6SubDirCcFlags -fno-builtin ;
7
8local librootArchSources =
9	byteorder.S
10;
11
12local librootGenericSources =
13	memcpy.c
14	memset.c
15;
16
17local kernelArchDriverSources =
18	arch_elf.cpp
19	arch_uart_sifive.cpp
20	sbi_syscalls.S
21;
22
23local kernelGenericDriverSources =
24	debug_uart.cpp
25	debug_uart_8250.cpp
26;
27
28local platform ;
29for platform in [ MultiBootSubDirSetup efi riscv ] {
30	on $(platform) {
31		BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] :
32			$(kernelArchDriverSources)
33			$(kernelGenericDriverSources)
34
35			$(librootArchSources)
36			$(librootGenericSources)
37
38			arch_cpu.cpp
39			: # additional flags
40			:
41			$(kernelArchObjects)
42		;
43
44		SEARCH on [ FGristFiles $(librootArchSources) ]
45			= [ FDirName $(HAIKU_TOP) src system libroot os arch riscv64 ] ;
46		SEARCH on [ FGristFiles $(librootGenericSources) ]
47			= [ FDirName $(HAIKU_TOP) src system libroot posix string arch generic ] ;
48
49		SEARCH on [ FGristFiles $(kernelArchDriverSources) ]
50			= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH_DIR) ] ;
51		SEARCH on [ FGristFiles $(kernelGenericDriverSources) ]
52			= [ FDirName $(HAIKU_TOP) src system kernel arch generic ] ;
53		SEARCH on [ FGristFiles $(kernelDebugSources) ]
54			= [ FDirName $(HAIKU_TOP) src system kernel debug ] ;
55	}
56}
57