1SubDir HAIKU_TOP src tools bfs_shell ;
2
3SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems bfs ] ;
4
5# prevent inclusion of HaikuBuildCompatibility.h and BSD headers
6DEFINES += HAIKU_BUILD_COMPATIBILITY_H __STRICT_ANSI__ ;
7
8# set some additional defines
9{
10	local defines =
11		#BFS_BIG_ENDIAN_ONLY
12		FS_SHELL
13		;
14
15	if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
16		# GCC2 doesn't compile BFS correctly with -O2 or more
17		OPTIM = -O1 ;
18	}
19
20	defines = [ FDefines $(defines) ] ;
21
22	local c++flags = ;
23	if $(HOST_CC_IS_LEGACY_GCC) != 1 {
24		c++flags += -std=c++11 ;
25	}
26
27	SubDirCcFlags $(defines) -Wno-multichar ;
28	SubDirC++Flags $(defines) -Wno-multichar -fno-rtti ;
29	SubDirC++Flags $(defines) $(c++flags) -Wno-multichar -fno-rtti ;
30}
31
32# platform specific libraries
33local fsShellCommandLibs ;
34if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
35	fsShellCommandLibs = $(HOST_NETWORK_LIBS) ;
36}
37
38UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ;
39
40if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
41	UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ;
42	UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ;
43}
44
45UsePrivateHeaders shared storage ;
46UsePrivateHeaders fs_shell ;
47UseHeaders [ FDirName $(HAIKU_TOP) headers private ] : true ;
48UseHeaders [ FDirName $(HAIKU_TOP) src tools fs_shell ] ;
49
50local bfsSource =
51	bfs_disk_system.cpp
52	BlockAllocator.cpp
53	BPlusTree.cpp
54	Attribute.cpp
55	CheckVisitor.cpp
56	Debug.cpp
57	DeviceOpener.cpp
58	FileSystemVisitor.cpp
59	Index.cpp
60	Inode.cpp
61	Journal.cpp
62	Query.cpp
63	QueryParserUtils.cpp
64	ResizeVisitor.cpp
65	Volume.cpp
66
67	kernel_interface.cpp
68;
69
70BuildPlatformMergeObject <build>bfs.o : $(bfsSource) ;
71
72BuildPlatformMain <build>bfs_shell
73	:
74	additional_commands.cpp
75	command_checkfs.cpp
76	command_resizefs.cpp
77	:
78	<build>bfs.o
79	<build>fs_shell.a $(HOST_LIBSUPC++) $(HOST_LIBSTDC++)
80	$(HOST_LIBROOT) $(fsShellCommandLibs)
81;
82
83BuildPlatformMain <build>bfs_fuse
84	:
85	:
86	<build>bfs.o
87	<build>fuse_module.a
88	$(HOST_LIBSUPC++) $(HOST_LIBSTDC++)
89	$(HOST_STATIC_LIBROOT) $(fsShellCommandLibs) fuse
90;
91
92SEARCH on [ FGristFiles DeviceOpener.cpp QueryParserUtils.cpp ]
93	+= [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;
94