SubDir TOP bfs-on-genode ;


# When cross-building from a Haiku host we may rely on
# contents from "haiku_source-r1~beta1_hrev52295_96-1-any.hpkg"
# xxxx We should host the files ourselves instead.. xxx
HaiSrc = /boot/system/sources/haiku ;


SetupHeadersHoG ;

SubDirHdrs  $(GenodeRepos)/libports/include/fuse ;  # fuse_fs_main.cc needs libfuse/fuse.h
SubDirHdrs  $(HaiSrc)/headers/private/fs_shell ;    # init.cc needs fssh_module.h et al

SEARCH_SOURCE +=
	$(GenodeRepos)/libports/src/server/fuse_fs  # Genode's fuse_fs_main.cc
	$(SUBDIR)/libports-src-lib-bfs  # our init.cc
	;

LOCATE_ToBuildFolder = server/fuse_fs ;
	# make GenodeExecutable rule locate the "bfs_fuse_fs/" folder inside the "server/fuse_fs" parent folder
	# (so as to inter-operate with gmake build; this is not strictly needed in pure jam builds)


GenodeExecutable bfs_fuse_fs :
	fuse_fs_main.cc
	init.cc
	;
LinkLibraries bfs_fuse_fs :
	bfs_shell
	build_libroot
	;
#NEEDLIBS on bfs_fuse_fs +=  $libs/libfuse/libfuse.lib.a ;
Depends bfs_fuse_fs : $(GenodeBuild)/var/libcache/libfuse/libfuse.lib.a ;
UNDEFS on bfs_fuse_fs +=  $(GenodeBuild)/var/libcache/libfuse/libfuse.lib.a ;
	# we append to UNDEFS rather than NEEDLIBS (the latter gets weird expanding)



# build .a libraries:
# - bfs_shell
# - build_libroot
SubInclude TOP bfs-on-genode contrib_haiku-add-ons-kernel-file_systems-bfs ;
SubInclude TOP bfs-on-genode contrib_haiku-build-libroot ;

