m68k: update build to support MultiBootSubDirSetup

Change-Id: Idbbbb089286ad7d76f61993670a20d240bfe773c
This commit is contained in:
François Revol 2018-11-10 20:30:10 +01:00
parent 9ad59bd841
commit 494acd2185
6 changed files with 217 additions and 202 deletions

View File

@ -323,7 +323,7 @@ rule KernelArchitectureSetup architecture
case m68k :
HAIKU_KERNEL_PLATFORM ?= atari_m68k ;
HAIKU_BOOT_TARGETS += atari_m68k ;
HAIKU_BOOT_TARGETS += amiga_m68k atari_m68k ;
switch $(HAIKU_KERNEL_PLATFORM) {
case atari_m68k :
{

View File

@ -20,6 +20,8 @@ BootstrapPackageRepository HaikuPortsCross
:
# source packages
binutils_bootstrap
gcc_bootstrap
libsolv_bootstrap
zlib_bootstrap
:

View File

@ -150,6 +150,71 @@ actions BuildUImageScript1
rm -f $(<).txt
}
# the bootsector on haiku_loader.amiga_m68k must be checksummed
rule ChecksumAmigaLoader
{
local haikuLoader = $(1) ;
local checksummer = <build>fixup_amiga_boot_checksum ;
Depends $(haikuLoader) : $(checksummer) ;
TARGET_CHECKSUM on $(haikuLoader) = $(checksummer) ;
}
actions ChecksumAmigaLoader bind TARGET_CHECKSUM
{
$(TARGET_CHECKSUM) $(1)
}
# the bootsector on haiku_loader.atari_m68k must be checksummed
rule ChecksumAtariLoader
{
local haikuLoader = $(1) ;
local checksummer = <build>fixup_tos_boot_checksum ;
Depends $(haikuLoader) : $(checksummer) ;
TARGET_CHECKSUM on $(haikuLoader) = $(checksummer) ;
}
actions ChecksumAtariLoader bind TARGET_CHECKSUM {
$(TARGET_CHECKSUM) $(1)
}
# atari_m68k: AUTO folder PRG target
# based on KernelLd
rule AtariBootPrgLd
{
# AtariBootPrgLd <name> : <objs> : <linkerscript> : <args> ;
LINK on $(1) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
LINKFLAGS on $(1) = $(4) ;
if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
# Remove any preset LINKLIBS
LINKLIBS on $(1) = ;
# TODO: Do we really want to invoke SetupKernel here? The objects should
# have been compiled with KernelObjects anyway, so we're doing that twice.
SetupKernel $(2) ;
# Show that we depend on the libraries we need
LocalClean clean : $(1) ;
LocalDepends all : $(1) ;
Depends $(1) : $(2) ;
MakeLocateDebug $(1) ;
}
actions AtariBootPrgLd
{
$(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" $(LINKLIBS) ;
}
local extraSources = ;
if $(TARGET_GCC_VERSION_$(TARGET_PACKAGING_ARCH)[1]) = 2 {
@ -265,6 +330,20 @@ for platform in [ MultiBootSubDirSetup ] {
-n 'Haiku $(TARGET_KERNEL_ARCH) floppyboot' ;
BuildUImageScript boot.scr : $(HAIKU_MMC_UBOOT_SCRIPT) ;
case amiga_m68k :
BuildBiosLoader haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader_$(TARGET_BOOT_PLATFORM) ;
ChecksumAmigaLoader haiku_loader.$(TARGET_BOOT_PLATFORM) ;
case atari_m68k :
BuildBiosLoader haiku_loader.$(TARGET_BOOT_PLATFORM) : boot_loader_$(TARGET_BOOT_PLATFORM) ;
ChecksumAtariLoader haiku_loader.$(TARGET_BOOT_PLATFORM) ;
AtariBootPrgLd haiku.prg :
boot_loader_$(TARGET_BOOT_PLATFORM)
: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_prg_$(TARGET_BOOT_PLATFORM).ld
: -Bstatic
;
case * :
Exit "Currently unsupported haiku_loader:" $(TARGET_BOOT_PLATFORM) ;
}

View File

@ -1,43 +1,57 @@
SubDir HAIKU_TOP src system boot arch m68k ;
DEFINES += _BOOT_MODE ;
local platform ;
for platform in [ MultiBootSubDirSetup amiga_m68k atari_m68k ] {
on $(platform) {
DEFINES += _BOOT_MODE ;
# TODO: Is there any reason to recompile arch_string.S here?
local librootArchObjects =
# <src!system!libroot!posix!string!arch!$(TARGET_ARCH)>arch_string.o
arch_string.S
;
local kernelArchSources =
arch_elf.cpp
;
local kernelLibArchObjects =
<src!system!kernel!lib!arch!$(TARGET_ARCH)>byteorder.o
<src!system!kernel!lib!arch!$(TARGET_ARCH)>memset.o
;
local librootStringArchSources =
arch_string.S
;
BootMergeObject boot_arch_$(TARGET_KERNEL_ARCH).o :
arch_elf.cpp
$(librootArchObjects)
:
:
$(kernelLibArchObjects)
;
local librootOsArchSources =
byteorder.S
;
BootMergeObject boot_arch_m68k_030.o :
mmu_030.cpp
: -Wno-unused -mcpu=68030
;
local librootStringGenericSources =
#memcpy.c
memset.c
;
BootMergeObject boot_arch_m68k_040.o :
mmu_040.cpp
: -Wno-unused -mcpu=68040 -Wa,-m68040
;
BootMergeObject [ FGristFiles boot_arch_$(TARGET_KERNEL_ARCH).o ] :
$(kernelArchSources)
$(librootStringArchSources)
$(librootOsArchSources)
$(librootStringGenericSources)
:
;
BootMergeObject boot_arch_m68k_060.o :
mmu_060.cpp
: -Wno-unused -mcpu=68060
;
BootMergeObject boot_arch_m68k_030.o :
mmu_030.cpp
: -Wno-unused -mcpu=68030
;
SEARCH on [ FGristFiles arch_elf.cpp ]
= [ FDirName $(HAIKU_TOP) src system kernel arch $(TARGET_KERNEL_ARCH) ] ;
BootMergeObject boot_arch_m68k_040.o :
mmu_040.cpp
: -Wno-unused -mcpu=68040 -Wa,-m68040
;
SEARCH on [ FGristFiles $(librootArchObjects) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix string arch $(TARGET_ARCH) ] ;
BootMergeObject boot_arch_m68k_060.o :
mmu_060.cpp
: -Wno-unused -mcpu=68060
;
SEARCH on [ FGristFiles $(kernelArchSources) ]
= [ FDirName $(HAIKU_TOP) src system kernel arch m68k ] ;
SEARCH on [ FGristFiles $(librootStringArchSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix string arch m68k ] ;
SEARCH on [ FGristFiles $(librootOsArchSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot os arch m68k ] ;
SEARCH on [ FGristFiles $(librootStringGenericSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix string arch generic ] ;
}
}

View File

@ -1,8 +1,8 @@
SubDir HAIKU_TOP src system boot platform amiga_m68k ;
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform amiga_m68k ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel boot platform amiga_m68k ] ;
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
UsePrivateHeaders [ FDirName graphics common ] ;
@ -17,74 +17,56 @@ UsePrivateHeaders [ FDirName storage ] ;
SubDirC++Flags $(defines) -fno-rtti ;
}
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
local platform ;
for platform in [ MultiBootSubDirSetup amiga_m68k ] {
on $(platform) {
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
BootMergeObject boot_platform_amiga_m68k_shell.o :
shell.S
: -Wa,--pcrel
;
BootMergeObject boot_platform_amiga_m68k_shell.o :
shell.S
: -Wa,--pcrel
;
BootMergeObject boot_platform_amiga_m68k_other.o :
# shell.S
start.cpp
rom_calls.cpp
debug.cpp
#bios.S
console.cpp
#serial.cpp
Handle.cpp
devices.cpp
keyboard.cpp
menu.cpp
mmu.cpp
cpu.cpp
#smp.cpp
#smp_trampoline.S
# support.S
video.cpp
#apm.cpp
BootMergeObject boot_platform_amiga_m68k_other.o :
# shell.S
start.cpp
rom_calls.cpp
debug.cpp
#bios.S
console.cpp
#serial.cpp
Handle.cpp
devices.cpp
keyboard.cpp
menu.cpp
mmu.cpp
cpu.cpp
#smp.cpp
#smp_trampoline.S
# support.S
video.cpp
#apm.cpp
# VESA/DDC EDID
#decode_edid.c
#dump_edid.c
# VESA/DDC EDID
#decode_edid.c
#dump_edid.c
: #-Wa,--pcrel
: boot_platform_generic.a
;
: #-Wa,--pcrel
: boot_platform_generic_amiga_m68k.a
;
BootMergeObject boot_platform_amiga_m68k.o :
: :
boot_platform_amiga_m68k_shell.o
boot_platform_amiga_m68k_other.o
boot_arch_m68k_030.o
boot_arch_m68k_040.o
;
# the bootsector in haiku_loader must be checksummed
rule ChecksumAmigaLoader
{
local haikuLoader = $(1) ;
local checksummer = <build>fixup_amiga_boot_checksum ;
Depends $(haikuLoader) : $(checksummer) ;
TARGET_CHECKSUM on $(haikuLoader) = $(checksummer) ;
BootMergeObject boot_platform_amiga_m68k.o :
: :
boot_platform_amiga_m68k_shell.o
boot_platform_amiga_m68k_other.o
boot_arch_m68k_030.o
boot_arch_m68k_040.o
;
}
}
actions ChecksumAmigaLoader bind TARGET_CHECKSUM
{
$(TARGET_CHECKSUM) $(1)
}
ChecksumAmigaLoader haiku_loader ;
SEARCH on [ FGristFiles $(genericPlatformSources) ]
= [ FDirName $(HAIKU_TOP) src system boot platform generic ] ;

View File

@ -1,6 +1,6 @@
SubDir HAIKU_TOP src system boot platform atari_m68k ;
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform $(TARGET_BOOT_PLATFORM) ;
SubDirHdrs $(HAIKU_TOP) headers private kernel boot platform atari_m68k ;
UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
@ -17,123 +17,61 @@ UsePrivateHeaders [ FDirName storage ] ;
SubDirC++Flags $(defines) -fno-rtti ;
}
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
local platform ;
for platform in [ MultiBootSubDirSetup atari_m68k ] {
on $(platform) {
#SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons accelerants common ] ;
BootMergeObject boot_platform_atari_m68k_shell.o :
shell.S
: -Wa,--pcrel
;
BootMergeObject boot_platform_atari_m68k_shell.o :
shell.S
: -Wa,--pcrel
;
# cpu-specific stuff
# should be moved to boot/arch/m68k/...
# TODO: add 020+68851 support
# cpu-specific stuff
# should be moved to boot/arch/m68k/...
# TODO: add 020+68851 support
BootMergeObject boot_platform_atari_m68k_other.o :
# shell.S
start.cpp
toscalls.cpp
debug.cpp
#bios.S
console.cpp
#serial.cpp
Handle.cpp
devices.cpp
keyboard.cpp
menu.cpp
mmu.cpp
cpu.cpp
#smp.cpp
#smp_trampoline.S
# support.S
video.cpp
#apm.cpp
BootMergeObject boot_platform_atari_m68k_other.o :
# shell.S
start.cpp
toscalls.cpp
debug.cpp
#bios.S
console.cpp
#serial.cpp
Handle.cpp
devices.cpp
keyboard.cpp
menu.cpp
mmu.cpp
cpu.cpp
#smp.cpp
#smp_trampoline.S
# support.S
video.cpp
#apm.cpp
# VESA/DDC EDID
#decode_edid.c
#dump_edid.c
# VESA/DDC EDID
#decode_edid.c
#dump_edid.c
: #-Wa,--pcrel
: boot_platform_generic.a
;
: #-Wa,--pcrel
: boot_platform_generic.a
;
BootMergeObject boot_platform_atari_m68k.o :
: :
boot_platform_atari_m68k_shell.o
boot_platform_atari_m68k_other.o
boot_arch_m68k_030.o
boot_arch_m68k_040.o
;
# the bootsector in haiku_loader must be checksummed
rule ChecksumAtariLoader
{
local haikuLoader = $(1) ;
local checksummer = <build>fixup_tos_boot_checksum ;
Depends $(haikuLoader) : $(checksummer) ;
TARGET_CHECKSUM on $(haikuLoader) = $(checksummer) ;
BootMergeObject boot_platform_atari_m68k.o :
: :
boot_platform_atari_m68k_shell.o
boot_platform_atari_m68k_other.o
boot_arch_m68k_030.o
boot_arch_m68k_040.o
;
}
}
actions ChecksumAtariLoader bind TARGET_CHECKSUM {
$(TARGET_CHECKSUM) $(1)
}
ChecksumAtariLoader haiku_loader ;
# AUTO folder PRG target
# based on KernelLd
rule AtariBootPrgLd
{
# AtariBootPrgLd <name> : <objs> : <linkerscript> : <args> ;
LINK on $(1) = $(TARGET_LD_$(TARGET_PACKAGING_ARCH)) ;
LINKFLAGS on $(1) = $(4) ;
if $(3) { LINKFLAGS on $(1) += --script=$(3) ; }
# Remove any preset LINKLIBS
LINKLIBS on $(1) = ;
# TODO: Do we really want to invoke SetupKernel here? The objects should
# have been compiled with KernelObjects anyway, so we're doing that twice.
SetupKernel $(2) ;
# Show that we depend on the libraries we need
LocalClean clean : $(1) ;
LocalDepends all : $(1) ;
Depends $(1) : $(2) ;
MakeLocateDebug $(1) ;
}
actions AtariBootPrgLd
{
$(LINK) $(LINKFLAGS) -o "$(1)" "$(2)" $(LINKLIBS) ;
}
AtariBootPrgLd haiku.prg :
boot_loader_$(TARGET_BOOT_PLATFORM)
: $(HAIKU_TOP)/src/system/ldscripts/$(TARGET_ARCH)/boot_prg_$(TARGET_BOOT_PLATFORM).ld
: -Bstatic
;
SEARCH on [ FGristFiles $(genericPlatformSources) ]
= [ FDirName $(HAIKU_TOP) src system boot platform generic ] ;