SubDir HAIKU_TOP src tests add-ons kernel file_systems bfs mkbfs ;

SubDirHdrs $(HAIKU_TOP) src tests add-ons kernel file_systems fs_shell ;
SubDirHdrs $(HAIKU_TOP) src tests add-ons kernel file_systems bfs r5 ;
UsePrivateHeaders [ FDirName kernel ] ;

{
	# set CHECK_MALLOC to something when doing tests against memory corruption
	local malloc_debug_defines ;
	local malloc_debug_flags ;
	if $(CHECK_MALLOC) {
		malloc_debug_defines = _NO_INLINE_ASM ;
		malloc_debug_flags = -fcheck-memory-usage ;
	}

	local defines = [ FDefines USER
		UNSAFE_GET_VNODE
		#BFS_BIG_ENDIAN_ONLY
		$(malloc_debug_defines) ] ;
	SubDirCcFlags $(defines) -fno-exceptions -fno-rtti $(malloc_debug_flags) ;
	SubDirC++Flags $(defines) -fno-exceptions -fno-rtti $(malloc_debug_flags) ;
}

SimpleTest mkbfs :
	mkbfs.cpp

	cache.c
	kernel.c
	sl.c
	sysdep.c
	rootfs.c
	errors.cpp

	Volume.cpp BPlusTree.cpp Inode.cpp Index.cpp Query.cpp Journal.cpp
	BlockAllocator.cpp kernel_interface_r5.cpp Utility.cpp BufferPool.cpp
	Debug.cpp
	:
	;

SimpleTest allocationGroups :
	allocationGroups.cpp
	;

# Tell Jam where to find these sources
SEARCH on [ FGristFiles
		Volume.cpp BPlusTree.cpp Inode.cpp Index.cpp Query.cpp Journal.cpp
		BlockAllocator.cpp kernel_interface_r5.cpp Utility.cpp BufferPool.cpp
		Debug.cpp
	] = [ FDirName $(HAIKU_TOP) src tests add-ons kernel file_systems bfs r5 ] ;

SEARCH on [ FGristFiles
		fsh.c rootfs.c initfs.c kernel.c cache.c sl.c stub.c tracker.cpp
		sysdep.c hexdump.c argv.c errors.cpp
	] = [ FDirName $(HAIKU_TOP) src tests add-ons kernel file_systems fs_shell ] ;

SEARCH on [ FGristFiles
		kernel_cpp.cpp
	] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
