1SubDir HAIKU_TOP src build libroot ; 2 3UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; 4UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; 5UseHeaders [ FDirName $(HAIKU_TOP) headers build os app ] : true ; 6UseHeaders [ FDirName $(HAIKU_TOP) headers build os drivers ] : true ; 7UseHeaders [ FDirName $(HAIKU_TOP) headers build os kernel ] : true ; 8UseHeaders [ FDirName $(HAIKU_TOP) headers build os interface ] : true ; 9UseHeaders [ FDirName $(HAIKU_TOP) headers build os storage ] : true ; 10UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ; 11 12UsePrivateBuildHeaders kernel libroot system ; 13 14{ 15 local defines = [ FDefines 16 HAIKU_BUILD_ATTRIBUTES_DIR="\\\"$(HAIKU_BUILD_ATTRIBUTES_DIR)\\\"" 17 _HAIKU_BUILD_DONT_REMAP_FD_FUNCTIONS=1 18 ] ; 19 SubDirCcFlags $(defines) ; 20 SubDirC++Flags $(defines) ; 21 22 defines = [ FDefines 23 HAIKU_BUILD_GENERATED_DIRECTORY="\\\"$(HAIKU_OUTPUT_DIR)\\\"" 24 ] ; 25 ObjectC++Flags find_directory.cpp : $(defines) ; 26 27 defines = [ FDefines BUILDING_HAIKU_ERROR_MAPPER=1 ] ; 28 ObjectC++Flags errors.cpp : $(defines) ; 29 30 defines = [ FDefines KMESSAGE_CONTAINER_ONLY=1 ] ; 31 ObjectC++Flags KMessage.cpp : $(defines) ; 32} 33 34# locate the library 35MakeLocate libroot_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ; 36 37# darwin already has strlcpy and strlcat in libSystem 38local strlSources ; 39if $(HOST_PLATFORM) != darwin { 40 strlSources = strlcpy.c strlcat.c ; 41} 42 43if $(HOST_PLATFORM) = cygwin || $(HOST_PLATFORM) = sunos { 44 strlSources += stpcpy.c strcasestr.c ; 45} 46 47local hostPlatformSources ; 48if $(HOST_PLATFORM) = freebsd { 49 hostPlatformSources = fs_freebsd.cpp ; 50} 51 52if $(HOST_PLATFORM) = darwin { 53 hostPlatformSources = fs_darwin.cpp ; 54} 55 56local librootSources = 57 atomic.cpp 58 byteorder.cpp 59 errors.cpp 60 find_directory.cpp 61 fs.cpp 62 fs_attr.cpp 63 fs_descriptors.cpp 64 misc.cpp 65 sem.cpp 66 thread.cpp 67 SHA256.cpp 68 69 $(hostPlatformSources) 70 71 driver_settings.cpp 72 73 $(strlSources) 74 strnlen.cpp 75 76 KMessage.cpp 77; 78 79USES_BE_API on [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] = true ; 80 81BuildPlatformSharedLibrary libroot_build.so : 82 $(librootSources) 83 : 84 $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) 85; 86 87# TODO: This doesn't work with the function remapping. 88BuildPlatformStaticLibrary libroot_build.a : 89 : 90 [ FGristFiles $(librootSources:S=$(SUFOBJ)) ] 91; 92 93USES_BE_API on [ FGristFiles function_remapper$(SUFOBJ) ] = true ; 94 95BuildPlatformStaticLibraryPIC libroot_build_function_remapper.a : 96 function_remapper.cpp 97; 98 99SEARCH on [ FGristFiles driver_settings.cpp ] 100 = [ FDirName $(HAIKU_TOP) src system libroot os ] ; 101SEARCH on [ FGristFiles $(strlSources) strnlen.cpp ] 102 = [ FDirName $(HAIKU_TOP) src system libroot posix string ] ; 103SEARCH on [ FGristFiles SHA256.cpp ] 104 = [ FDirName $(HAIKU_TOP) src system libroot posix crypt ] ; 105SEARCH on [ FGristFiles KMessage.cpp ] 106 = [ FDirName $(HAIKU_TOP) src system kernel messaging ] ; 107