1SubDir HAIKU_TOP src system boot arch x86 ; 2 3local defines = $(DEFINES) ; 4 5local platform ; 6for platform in [ MultiBootSubDirSetup bios_ia32 efi pxe_ia32 ] { 7 on $(platform) { 8 SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ; 9 10 DEFINES = $(defines) ; 11 DEFINES += _BOOT_MODE ; 12 13 if $(TARGET_BOOT_PLATFORM) = efi { 14 if $(TARGET_ARCH) = x86_64 { 15 DEFINES += BOOT_SUPPORT_ELF64 ; 16 } else { 17 DEFINES += BOOT_SUPPORT_ELF32 ; 18 } 19 } else { 20 DEFINES += BOOT_SUPPORT_ELF64 ; 21 DEFINES += BOOT_SUPPORT_ELF32 ; 22 } 23 24 local kernelArchSources = 25 arch_elf.cpp 26 ; 27 28 local kernelArchSpecificSources ; 29 local kernelLibArchSpecificSources ; 30 if $(TARGET_ARCH) = x86_64 && $(TARGET_BOOT_PLATFORM) = efi { 31 kernelArchSpecificSources = cpuid.cpp ; 32 kernelLibArchSpecificSources = arch_string.cpp ; 33 } else { 34 kernelArchSpecificSources = cpuid.S ; 35 kernelLibArchSpecificSources = arch_string.S ; 36 } 37 38 local librootOsArchSources = 39 byteorder.S 40 ; 41 42 BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] : 43 $(kernelArchSources) 44 $(kernelArchSpecificSources) 45 $(kernelLibArchSpecificSources) 46 $(librootOsArchSources) 47 arch_cpu.cpp 48 arch_hpet.cpp 49 : -std=c++11 # additional flags 50 ; 51 52 SEARCH on [ FGristFiles $(kernelArchSources) ] 53 = [ FDirName $(HAIKU_TOP) src system kernel arch x86 ] ; 54 55 if $(TARGET_ARCH) = x86_64 && $(TARGET_BOOT_PLATFORM) = efi { 56 SEARCH on [ FGristFiles $(kernelArchSpecificSources) ] 57 = [ FDirName $(HAIKU_TOP) src system kernel arch x86 64 ] ; 58 SEARCH on [ FGristFiles $(kernelLibArchSpecificSources) ] 59 = [ FDirName $(HAIKU_TOP) src system libroot posix string arch x86_64 ] ; 60 } else { 61 SEARCH on [ FGristFiles $(kernelArchSpecificSources) ] 62 = [ FDirName $(HAIKU_TOP) src system kernel arch x86 32 ] ; 63 SEARCH on [ FGristFiles $(kernelLibArchSpecificSources) ] 64 = [ FDirName $(HAIKU_TOP) src system kernel lib arch x86 ] ; 65 } 66 SEARCH on [ FGristFiles $(librootOsArchSources) ] 67 = [ FDirName $(HAIKU_TOP) src system libroot os arch x86 ] ; 68 } 69} 70