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 38f504f610SAugustin 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 5038f62644SIngo Weinhold posix_gnu_wcsmbs.o 5138f62644SIngo Weinhold posix_stdlib.o 5238f62644SIngo Weinhold posix_string.o 53831486a2STravis Geiselbrecht posix_string_arch_$(TARGET_ARCH).o 5438f62644SIngo Weinhold posix_sys.o 5538f62644SIngo Weinhold posix_time.o 5638f62644SIngo Weinhold posix_unistd.o 5772cf60a5SOliver Tappe posix_wchar.o 585af32e75SAxel Dörfler ; 59b0944c78SIngo Weinhold librootObjects = $(librootObjects:G=$(architecture)) ; 605af32e75SAxel Dörfler 61448671a3SIngo Weinhold local librootDebugObjects = 62448671a3SIngo Weinhold posix_malloc_debug.o 63448671a3SIngo Weinhold ; 64b0944c78SIngo Weinhold librootDebugObjects = $(librootDebugObjects:G=$(architecture)) ; 65448671a3SIngo Weinhold 66448671a3SIngo Weinhold local librootNoDebugObjects = 67448671a3SIngo Weinhold posix_malloc.o 68448671a3SIngo Weinhold ; 69b0944c78SIngo Weinhold librootNoDebugObjects = $(librootNoDebugObjects:G=$(architecture)) ; 70448671a3SIngo Weinhold 71b0944c78SIngo Weinhold local libroot = [ MultiArchDefaultGristFiles libroot.so ] ; 72b0944c78SIngo Weinhold local librootDebug = $(libroot:B=libroot_debug) ; 73353d20c0SIngo Weinhold 74b0944c78SIngo Weinhold DONT_LINK_AGAINST_LIBROOT on $(libroot) = true ; 75b0944c78SIngo Weinhold DONT_LINK_AGAINST_LIBROOT on $(librootDebug) = true ; 76ef3966e8SIngo Weinhold 77b0944c78SIngo Weinhold SetVersionScript $(libroot) : libroot_versions ; 78b0944c78SIngo Weinhold SetVersionScript $(librootDebug) : libroot_versions ; 79b0944c78SIngo Weinhold 80b0944c78SIngo Weinhold SharedLibrary $(libroot) 8138f62644SIngo Weinhold : 8238f62644SIngo Weinhold libroot_init.c 8338f62644SIngo Weinhold : 84b0944c78SIngo Weinhold $(librootObjects) 85b0944c78SIngo Weinhold $(librootNoDebugObjects) 86220d0402SOliver Tappe [ TargetStaticLibsupc++ ] 87220d0402SOliver Tappe [ TargetLibgcc ] 88448671a3SIngo Weinhold ; 89448671a3SIngo Weinhold 90b0944c78SIngo Weinhold # Use the standard libroot.so soname, so when the debug version is 91b0944c78SIngo Weinhold # pre-loaded it prevents the standard version to be loaded as well. 92b0944c78SIngo Weinhold HAIKU_SONAME on $(librootDebug) = libroot.so ; 93448671a3SIngo Weinhold 94b0944c78SIngo Weinhold SharedLibrary $(librootDebug) 95448671a3SIngo Weinhold : 96448671a3SIngo Weinhold libroot_init.c 97448671a3SIngo Weinhold : 98b0944c78SIngo Weinhold $(librootObjects) 99b0944c78SIngo Weinhold $(librootDebugObjects) 100220d0402SOliver Tappe [ TargetStaticLibsupc++ ] 101220d0402SOliver Tappe [ TargetLibgcc ] 1025af32e75SAxel Dörfler ; 1034fecb09fSAugustin Cavalier 104*6f92b552SAlexander von Gluck IV # These are defined in POSIX for c99 support, so fake'em 105*6f92b552SAlexander von Gluck IV StaticLibrary [ MultiArchDefaultGristFiles libc.a ] : empty.c ; 1064fecb09fSAugustin Cavalier StaticLibrary [ MultiArchDefaultGristFiles libm.a ] : empty.c ; 1074fecb09fSAugustin Cavalier StaticLibrary [ MultiArchDefaultGristFiles libpthread.a ] : empty.c ; 1085af32e75SAxel Dörfler 109b0944c78SIngo Weinhold # Copy libroot.so and update the copy's revision section. We link 110b0944c78SIngo Weinhold # everything against the original, but the copy will end up on the disk 111b0944c78SIngo Weinhold # image (this way we avoid unnecessary dependencies). The copy will be 112b0944c78SIngo Weinhold # located in a subdirectory. 113a4e0c1d4SIngo Weinhold if $(TARGET_PLATFORM) = haiku { 114b0944c78SIngo Weinhold local targetDir = [ FDirName $(TARGET_DEBUG_$(DEBUG)_LOCATE_TARGET) 115b0944c78SIngo Weinhold revisioned ] ; 116b0944c78SIngo Weinhold local revisionedLibroot = [ MultiArchDefaultGristFiles 117b0944c78SIngo Weinhold libroot.so : revisioned ] ; 118b0944c78SIngo Weinhold local revisionedLibrootDebug 119b0944c78SIngo Weinhold = $(librootDebug:G=$(revisionedLibroot:G)) ; 120448671a3SIngo Weinhold 121b0944c78SIngo Weinhold MakeLocate $(revisionedLibroot) : $(targetDir) ; 122b0944c78SIngo Weinhold CopySetHaikuRevision $(revisionedLibroot) : $(libroot) ; 123b0944c78SIngo Weinhold 124b0944c78SIngo Weinhold MakeLocate $(revisionedLibrootDebug) : $(targetDir) ; 125b0944c78SIngo Weinhold CopySetHaikuRevision $(revisionedLibrootDebug) : $(librootDebug) ; 126a4e0c1d4SIngo Weinhold } 127b0944c78SIngo Weinhold } 128b0944c78SIngo Weinhold} 129a4e0c1d4SIngo Weinhold 130a3f66598SOliver TappeSubInclude HAIKU_TOP src system libroot add-ons ; 131338b8dc3SIngo WeinholdSubInclude HAIKU_TOP src system libroot os ; 132338b8dc3SIngo WeinholdSubInclude HAIKU_TOP src system libroot posix ; 133b2883f6aSOliver TappeSubInclude HAIKU_TOP src system libroot stubbed ; 134