3 include $(SRCDIR)/config/aros.cfg
5 TARGETDIR := $(GENDIR)/$(CURDIR)
6 FILES := boot mmu kprintf support vc_mb serialdebug elf devicetree
7 USER_CFLAGS := -DUSE_UBOOT -ffixed-r8 -Wall -fno-builtin -O2 -mcpu=cortex-a7
9 USER_INCLUDES := -isystem $(SRCDIR)/$(CURDIR)/include
11 ARM_BSP := aros-$(AROS_TARGET_CPU)-bsp.rom
13 #MM- distfiles-raspi-armeb : distfiles-raspi-be
15 #MM distfiles-raspi-be : \
16 #MM kernel-raspi-armeb \
17 #MM kernel-package-raspi-armeb \
18 #MM distfiles-raspi-be-fw
20 #MM kernel-package-raspi-armeb: \
21 #MM linklibs-stdc-static \
24 #MM kernel-package-raspi-armeb-missing: \
27 RASPIFW_BRANCH := next
28 RASPIFW_URI := https://github.com/raspberrypi/firmware/blob/$(RASPIFW_BRANCH)/boot
29 RASPIFW_FILES := LICENCE.broadcom bootcode.bin fixup.dat start.elf
41 %make_package mmake=kernel-package-raspi-armeb file=$(AROSDIR)/$(ARM_BSP) \
42 libs=$(PKG_LIBS) arch_libs=$(PKG_LIBS_ARCH) res=$(PKG_RSRC) \
43 arch_res=$(PKG_RSRC_ARCH) devs=$(PKG_DEVS) arch_devs=$(PKG_DEVS_ARCH) \
44 handlers=$(PKG_HANDLERS) hidds=$(PKG_HIDDS) classes=$(PKG_CLASSES)
47 distfiles-raspi-be-fw:
48 $(foreach file, $(RASPIFW_FILES), $(shell wget -t 5 -T 15 -c "$(addprefix $(RASPIFW_URI)/, $(addsuffix ?raw=true, $(file)))" -O "$(addprefix $(AROSDIR)/, $(file))"))
51 distfiles-raspi-be-bootimg: $(AROSDIR)/aros-$(AROS_TARGET_CPU)-raspi.img
54 distfiles-raspi-be-bootimg-quick: $(AROSDIR)/aros-$(AROS_TARGET_CPU)-raspi.img
56 $(AROSDIR)/config.txt: $(AROSDIR)/$(ARM_BSP)
57 @printf "kernel=aros-$(AROS_TARGET_CPU)-raspi.img\ninitramfs $(ARM_BSP) 0x00800000" > $@
59 $(AROSDIR)/aros-armeb-raspi.img: $(TARGETDIR)/core.bin.o $(foreach f, $(FILES), $(TARGETDIR)/$(f).o $(TARGETDIR)/$(f).d)
60 $(KERNEL_LD) --be8 --format elf32-bigarm -s --entry=bootstrap --script=$(SRCDIR)/$(CURDIR)/ldscript.lds $(foreach f, $(FILES), $(TARGETDIR)/$(f).o) $ $(TARGETDIR)/core.bin.o -L$(AROS_LIB) -lstdc.static -laeabi -o $(OSGENDIR)/boot/aros-armeb-raspi.img.elf
61 $(TARGET_OBJCOPY) -O binary $(OSGENDIR)/boot/aros-armeb-raspi.img.elf $@
63 $(TARGETDIR)/core.bin.o: $(OSGENDIR)/boot/core.elf
64 cp $(OSGENDIR)/boot/core.elf $(TARGETDIR)/core.bin
65 cd $(TARGETDIR) && $(KERNEL_LD) $(KERNEL_LDFLAGS) --be8 -r --format binary --oformat elf32-bigarm core.bin -o $@
67 distfiles-raspi-be: $(DISTDIR)/aros$(AROS_TARGET_SUFFIX)-raspi-armeb.tar.bz2
69 $(DISTDIR)/aros$(AROS_TARGET_SUFFIX)-raspi-armeb.tar.bz2: $(AROSDIR)/aros-armeb-raspi.img $(AROSDIR)/$(ARM_BSP) $(AROSDIR)/config.txt
70 %mkdirs_q $(AROSDIR)/S
71 @$(CP) $(SRCDIR)/workbench/s/Startup-Sequence $(AROSDIR)/S/Startup-Sequence
72 @$(MKDIR) -p "$(DISTDIR)"
73 cd $(AROSDIR) && tar -cjf $@ ./
79 $(TARGETDIR)/%.o : %.c
82 $(TARGETDIR)/%.o : %.S
85 $(TARGETDIR)/%.d : %.c
88 DEPS := $(foreach f, $(FILES), $(TARGETDIR)/$(f).d)