SubDir HAIKU_TOP src tests add-ons kernel file_systems udf udf_shell ;

SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems udf ] ;

# prevent inclusion of HaikuBuildCompatibility.h and _BSD_SOURCE headers
DEFINES += HAIKU_BUILD_COMPATIBILITY_H __STRICT_ANSI__ ;

# set some additional defines
{
	local defines =
		FS_SHELL
		;

	if $(TARGET_PACKAGING_ARCH) = x86_gcc2 {
		# GCC2 doesn't compile BFS correctly with -O2 or more
		OPTIM = -O1 ;
	}

	defines = [ FDefines $(defines) ] ;
	SubDirCcFlags $(defines) -Wno-multichar ;
	SubDirC++Flags $(defines) -Wno-multichar -fno-rtti ;
}

# platform specific libraries
local fsShellCommandLibs ;
if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
	fsShellCommandLibs = $(HOST_NETWORK_LIBS) ;
}

UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ;

if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) {
	UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ;
	UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ;
}

UsePrivateHeaders shared storage ;
UsePrivateHeaders fs_shell ;
UseHeaders [ FDirName $(HAIKU_TOP) headers private ] : true ;
UseHeaders [ FDirName $(HAIKU_TOP) src tools fs_shell ] ;

BuildPlatformMain <build>udf_shell
	:
	crc_table.cpp
	DString.cpp
	Icb.cpp
	MetadataPartition.cpp
	PhysicalPartition.cpp
	Recognition.cpp
	SparablePartition.cpp
	UdfDebug.cpp
	UdfString.cpp
	UdfStructures.cpp
	Utils.cpp
	VirtualPartition.cpp
	Volume.cpp
	kernel_interface.cpp
	:
	<build>fs_shell.a $(HOST_LIBSUPC++) $(HOST_LIBSTDC++)
	$(HOST_LIBROOT) $(fsShellCommandLibs)
;

SEARCH on [ FGristFiles crc_table.cpp ]
	+= [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;
