3 include $(SRCDIR)/config/aros.cfg
5 TARGETDIR := $(GENDIR)/$(CURDIR)
6 FILES := boot mmu kprintf support vc_mb serialdebug elf devicetree \
7 bc/vars bc/font8x14 bc/screen_fb vc_fb
8 USER_CFLAGS := -DUSE_UBOOT -ffixed-r8 -Wall -fno-builtin -O2 -mcpu=cortex-a7
10 USER_INCLUDES := -isystem $(SRCDIR)/$(CURDIR)/include -I$(SRCDIR)/rom/openfirmware
12 ARM_BSP := aros-$(AROS_TARGET_CPU)-bsp.rom
14 #MM- distfiles-raspi-armeb : distfiles-raspi-be
16 #MM distfiles-raspi-be : \
17 #MM kernel-raspi-armeb \
18 #MM kernel-package-raspi-armeb \
19 #MM distfiles-raspi-be-fw
21 #MM kernel-package-raspi-armeb: \
22 #MM linklibs-stdc-static \
24 #MM kernel-bootloader \
29 #MM kernel-expansion \
30 #MM kernel-openfirmware \
32 #MM kernel-cgxbootpic \
33 #MM kernel-intuition \
34 #MM kernel-partition \
47 #MM kernel-shellcommands \
48 #MM kernel-filesystem \
51 #MM kernel-fs-cdvdfs \
55 #MM kernel-processor \
56 #MM kernel-mbox-bcm2708 \
61 #MM kernel-hidd-mouse \
62 #MM kernel-usb-nopci \
63 #MM kernel-usb-romstrap-raspi \
69 # MM kernel-usb-usb2otg
71 #MM kernel-package-raspi-armeb-missing: \
74 RASPIFW_BRANCH := master
75 RASPIFW_URI := https://github.com/raspberrypi/firmware/blob/$(RASPIFW_BRANCH)/boot
76 RASPIFW_FILES := LICENCE.broadcom bootcode.bin fixup.dat start.elf
78 PKG_LIBS := aros partition utility oop graphics layers intuition keymap dos debug poseidon cgxbootpic
79 PKG_LIBS_ARCH := expansion
80 PKG_RSRC := openfirmware misc bootloader dosboot lddemon usbromstartup FileSystem shell shellcommands mbox
81 PKG_RSRC_ARCH := processor
82 PKG_DEVS := input gameport keyboard console
83 PKG_DEVS_ARCH := timer
84 PKG_HANDLERS := con ram cdrom sfs fat afs
85 PKG_HIDDS := gfx mouse keyboard hiddclass i2c vc4gfx
86 PKG_CLASSES := USB/hid USB/hub USB/bootmouse USB/bootkeyboard USB/massstorage
88 %make_package mmake=kernel-package-raspi-armeb file=$(AROSDIR)/$(ARM_BSP) \
89 libs=$(PKG_LIBS) arch_libs=$(PKG_LIBS_ARCH) res=$(PKG_RSRC) \
90 arch_res=$(PKG_RSRC_ARCH) devs=$(PKG_DEVS) arch_devs=$(PKG_DEVS_ARCH) \
91 handlers=$(PKG_HANDLERS) hidds=$(PKG_HIDDS) classes=$(PKG_CLASSES)
94 distfiles-raspi-be-fw:
95 $(foreach file, $(RASPIFW_FILES), $(shell wget -t 5 -T 15 -c "$(addprefix $(RASPIFW_URI)/, $(addsuffix ?raw=true, $(file)))" -O "$(addprefix $(AROSDIR)/, $(file))"))
98 distfiles-raspi-be-bootimg: $(AROSDIR)/aros-$(AROS_TARGET_CPU)-raspi.img
101 distfiles-raspi-be-bootimg-quick: $(AROSDIR)/aros-$(AROS_TARGET_CPU)-raspi.img
103 $(AROSDIR)/config.txt: $(AROSDIR)/$(ARM_BSP)
104 @printf "kernel=aros-$(AROS_TARGET_CPU)-raspi.img\ninitramfs $(ARM_BSP) 0x00800000" > $@
106 $(AROSDIR)/aros-armeb-raspi.img: $(TARGETDIR)/core.bin.o $(foreach f, $(FILES), $(TARGETDIR)/$(f).o $(TARGETDIR)/$(f).d)
107 $(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
108 $(TARGET_OBJCOPY) -O binary $(OSGENDIR)/boot/aros-armeb-raspi.img.elf $@
110 $(TARGETDIR)/core.bin.o: $(OSGENDIR)/boot/core.elf
111 cp $(OSGENDIR)/boot/core.elf $(TARGETDIR)/core.bin
112 cd $(TARGETDIR) && $(KERNEL_LD) $(KERNEL_LDFLAGS) --be8 -r --format binary --oformat elf32-bigarm core.bin -o $@
114 distfiles-raspi-be: $(DISTDIR)/aros$(AROS_TARGET_SUFFIX)-raspi-armeb.tar.bz2
116 $(DISTDIR)/aros$(AROS_TARGET_SUFFIX)-raspi-armeb.tar.bz2: $(AROSDIR)/aros-armeb-raspi.img $(AROSDIR)/$(ARM_BSP) $(AROSDIR)/config.txt
117 %mkdirs_q $(AROSDIR)/S
118 @$(CP) $(SRCDIR)/workbench/s/Startup-Sequence $(AROSDIR)/S/Startup-Sequence
119 @$(MKDIR) -p "$(DISTDIR)"
120 cd $(AROSDIR) && tar -cjf $@ ./
126 $(TARGETDIR)/%.o : %.c
129 $(TARGETDIR)/%.o : %.S
132 $(TARGETDIR)/%.d : %.c
135 DEPS := $(foreach f, $(FILES), $(TARGETDIR)/$(f).d)