1338b8dc3SIngo WeinholdSubDir HAIKU_TOP src system libroot ; 25af32e75SAxel Dörfler 319d40f9eSIngo WeinholdUsePrivateHeaders libroot runtime_loader ; 4b0944c78SIngo Weinhold 5b0944c78SIngo Weinholdlocal architectureObject ; 6b0944c78SIngo Weinholdfor architectureObject in [ MultiArchSubDirSetup ] { 7b0944c78SIngo Weinhold on $(architectureObject) { 8b0944c78SIngo Weinhold local architecture = $(TARGET_PACKAGING_ARCH) ; 9b0944c78SIngo Weinhold 106b202f4eSIngo Weinhold UsePrivateSystemHeaders ; 115af32e75SAxel Dörfler 12220d0402SOliver Tappe local libgccAsSingleObject ; 13220d0402SOliver Tappe if $(architecture) = x86_gcc2 { 14220d0402SOliver Tappe libgccAsSingleObject 15220d0402SOliver Tappe = <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o ; 164d550826SFrançois Revol # One object to link them all... 174d550826SFrançois Revol TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH) on 184d550826SFrançois Revol <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o = 194d550826SFrançois Revol [ on <$(architecture)>libroot_libgcc_$(TARGET_ARCH).o 204d550826SFrançois Revol return $(TARGET_LDFLAGS_$(TARGET_PACKAGING_ARCH)) ] 214d550826SFrançois Revol --whole-archive ; 22220d0402SOliver Tappe MergeObject $(libgccAsSingleObject) : : [ TargetLibgcc ] ; 23220d0402SOliver Tappe } 245e0e2739SFrançois Revol 2538f62644SIngo Weinhold local librootObjects = 26220d0402SOliver Tappe $(libgccAsSingleObject) 274d550826SFrançois Revol 2838f62644SIngo Weinhold os_main.o 2938f62644SIngo Weinhold os_arch_$(TARGET_ARCH).o 3038f62644SIngo Weinhold 3138f62644SIngo Weinhold posix_arch_$(TARGET_ARCH).o 3238f62644SIngo Weinhold posix_crypt.o 3338f62644SIngo Weinhold posix_locale.o 3438f62644SIngo Weinhold posix_main.o 3538f62644SIngo Weinhold posix_pthread.o 3638f62644SIngo Weinhold posix_signal.o 3738f62644SIngo Weinhold posix_stdio.o 38*f504f610SAugustin Cavalier posix_musl.o 3938f62644SIngo Weinhold posix_gnu_arch_$(TARGET_ARCH).o 4038f62644SIngo Weinhold posix_gnu_ctype.o 4138f62644SIngo Weinhold posix_gnu_ext.o 4287e239b9SJérôme Duval posix_gnu_iconv.o 4338f62644SIngo Weinhold posix_gnu_libio.o 4438f62644SIngo Weinhold posix_gnu_locale.o 45a8344698SJérôme Duval posix_gnu_math.o 4687e239b9SJérôme Duval posix_gnu_misc.o 4738f62644SIngo Weinhold posix_gnu_regex.o 4838f62644SIngo Weinhold posix_gnu_stdio.o 4938f62644SIngo Weinhold posix_gnu_stdlib.o 50cc87b419SJérôme Duval posix_gnu_string.o 5138f62644SIngo Weinhold posix_gnu_wcsmbs.o 5238f62644SIngo Weinhold posix_stdlib.o 5338f62644SIngo Weinhold posix_string.o 54831486a2STravis Geiselbrecht posix_string_arch_$(TARGET_ARCH).o 5538f62644SIngo Weinhold posix_sys.o 5638f62644SIngo Weinhold posix_time.o 5738f62644SIngo Weinhold posix_unistd.o 5872cf60a5SOliver Tappe posix_wchar.o 595af32e75SAxel Dörfler ; 60b0944c78SIngo Weinhold librootObjects = $(librootObjects:G=$(architecture)) ; 615af32e75SAxel Dörfler 62448671a3SIngo Weinhold local librootDebugObjects = 63448671a3SIngo Weinhold posix_malloc_debug.o 64448671a3SIngo Weinhold ; 65b0944c78SIngo Weinhold librootDebugObjects = $(librootDebugObjects:G=$(architecture)) ; 66448671a3SIngo Weinhold 67448671a3SIngo Weinhold local librootNoDebugObjects = 68448671a3SIngo Weinhold posix_malloc.o 69448671a3SIngo Weinhold ; 70b0944c78SIngo Weinhold librootNoDebugObjects = $(librootNoDebugObjects:G=$(architecture)) ; 71448671a3SIngo Weinhold 72b0944c78SIngo Weinhold local libroot = [ MultiArchDefaultGristFiles libroot.so ] ; 73b0944c78SIngo Weinhold local librootDebug = $(libroot:B=libroot_debug) ; 74353d20c0SIngo Weinhold 75b0944c78SIngo Weinhold DONT_LINK_AGAINST_LIBROOT on $(libroot) = true ; 76b0944c78SIngo Weinhold DONT_LINK_AGAINST_LIBROOT on $(librootDebug) = true ; 77ef3966e8SIngo Weinhold 78b0944c78SIngo Weinhold SetVersionScript $(libroot) : libroot_versions ; 79b0944c78SIngo Weinhold SetVersionScript $(librootDebug) : libroot_versions ; 80b0944c78SIngo Weinhold 81b0944c78SIngo Weinhold SharedLibrary $(libroot) 8238f62644SIngo Weinhold : 8338f62644SIngo Weinhold libroot_init.c 8438f62644SIngo Weinhold : 85b0944c78SIngo Weinhold $(librootObjects) 86b0944c78SIngo Weinhold $(librootNoDebugObjects) 87220d0402SOliver Tappe [ TargetStaticLibsupc++ ] 88220d0402SOliver Tappe [ TargetLibgcc ] 89448671a3SIngo Weinhold ; 90448671a3SIngo Weinhold 91b0944c78SIngo Weinhold # Use the standard libroot.so soname, so when the debug version is 92b0944c78SIngo Weinhold # pre-loaded it prevents the standard version to be loaded as well. 93b0944c78SIngo Weinhold HAIKU_SONAME on $(librootDebug) = libroot.so ; 94448671a3SIngo Weinhold 95b0944c78SIngo Weinhold SharedLibrary $(librootDebug) 96448671a3SIngo Weinhold : 97448671a3SIngo Weinhold libroot_init.c 98448671a3SIngo Weinhold : 99b0944c78SIngo Weinhold $(librootObjects) 100b0944c78SIngo Weinhold $(librootDebugObjects) 101220d0402SOliver Tappe [ TargetStaticLibsupc++ ] 102220d0402SOliver Tappe [ TargetLibgcc ] 1035af32e75SAxel Dörfler ; 1044fecb09fSAugustin Cavalier 1054fecb09fSAugustin Cavalier StaticLibrary [ MultiArchDefaultGristFiles libm.a ] : empty.c ; 1064fecb09fSAugustin Cavalier StaticLibrary [ MultiArchDefaultGristFiles libpthread.a ] : empty.c ; 1075af32e75SAxel Dörfler 108b0944c78SIngo Weinhold # Copy libroot.so and update the copy's revision section. We link 109b0944c78SIngo Weinhold # everything against the original, but the copy will end up on the disk 110b0944c78SIngo Weinhold # image (this way we avoid unnecessary dependencies). The copy will be 111b0944c78SIngo Weinhold # located in a subdirectory. 112a4e0c1d4SIngo Weinhold if $(TARGET_PLATFORM) = haiku { 113b0944c78SIngo Weinhold local targetDir = [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) 114b0944c78SIngo Weinhold revisioned ] ; 115b0944c78SIngo Weinhold local revisionedLibroot = [ MultiArchDefaultGristFiles 116b0944c78SIngo Weinhold libroot.so : revisioned ] ; 117b0944c78SIngo Weinhold local revisionedLibrootDebug 118b0944c78SIngo Weinhold = $(librootDebug:G=$(revisionedLibroot:G)) ; 119448671a3SIngo Weinhold 120b0944c78SIngo Weinhold MakeLocate $(revisionedLibroot) : $(targetDir) ; 121b0944c78SIngo Weinhold CopySetHaikuRevision $(revisionedLibroot) : $(libroot) ; 122b0944c78SIngo Weinhold 123b0944c78SIngo Weinhold MakeLocate $(revisionedLibrootDebug) : $(targetDir) ; 124b0944c78SIngo Weinhold CopySetHaikuRevision $(revisionedLibrootDebug) : $(librootDebug) ; 125a4e0c1d4SIngo Weinhold } 126b0944c78SIngo Weinhold } 127b0944c78SIngo Weinhold} 128a4e0c1d4SIngo Weinhold 129a3f66598SOliver TappeSubInclude HAIKU_TOP src system libroot add-ons ; 130338b8dc3SIngo WeinholdSubInclude HAIKU_TOP src system libroot os ; 131338b8dc3SIngo WeinholdSubInclude HAIKU_TOP src system libroot posix ; 132b2883f6aSOliver TappeSubInclude HAIKU_TOP src system libroot stubbed ; 133