commit 9892400136ad2c93740c17fae21c1f45bef2fb07 parent 460c5bdcd2450ba2a93830cdc9922d0296c0525d Author: parazyd <parazyd@dyne.org> Date: Thu, 28 Jan 2021 11:40:35 +0100 Add initial Makefile. Diffstat:
A | Makefile | | | 52 | ++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 52 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile @@ -0,0 +1,51 @@ +.POSIX: + +TC="aarch64-linux-gnu-" + +KERNEL_URL = https://github.com/raspberrypi/linux +KERNEL_BRANCH = rpi-5.11.y +KERNEL_SRC = linux-raspberrypi +IMAGEGZ = $(KERNEL_SRC)/arch/arm64/boot/Image.gz + +FIRMWARE_URL = https://github.com/raspberrypi/firmware +FIRMWARE_BRANCH = master +FIRMWARE_SRC = firmware + +AOE_URL = https://github.com/OpenAoE/aoetools +AOE_BRANCH = master +AOE_SRC = aoetools + +all: boot/kernel8.img bin/aoe-stat boot/bootcode.bin + +$(KERNEL_SRC): + git clone --depth 1 -b $(KERNEL_BRANCH) $(KERNEL_URL) $@ + +$(FIRMWARE_SRC): + git clone --depth 1 -b $(FIRMWARE_BRANCH) $(FIRMWARE_URL) $@ + +$(AOE_SRC): + git clone --depth 1 -b $(AOE_BRANCH) $(AOE_URL) $@ + +boot/bootcode.bin: $(FIRMWARE_SRC) + mkdir -p boot + cp $(FIRMWARE_SRC)/start* boot + cp $(FIRMWARE_SRC)/fixup* boot + cp $(FIRMWARE_SRC)/LICENCE.broadcom boot + cp $(FIRMWARE_SRC)/COPYING.linux boot + +$(IMAGEGZ): $(KERNEL_SRC) + cp -f pi3.config $(KERNEL_SRC)/.config + $(MAKE) -C $(KERNEL_SRC) ARCH=arm64 CROSS_COMPILE=$(TC) oldconfig + $(MAKE) -C $(KERNEL_SRC) ARCH=arm64 CROSS_COMPILE=$(TC) + +boot/kernel8.img: $(IMAGEGZ) + mkdir -p boot + cp $(KERNEL_SRC)/arch/arm64/boot/Image.gz $@ + +bin/aoe-stat: $(AOE_SRC) + sed -e 's@^CFLAGS =.*@CFLAGS = -Os -s -static@' -i $(AOE_SRC)/Makefile + sed -e 's@^SBINDIR =.*@SBINDIR = ${PREFIX}/bin@' -i $(AOE_SRC)/Makefile + $(MAKE) -C $(AOE_SRC) CC=$(TC)gcc + $(MAKE) -C $(AOE_SRC) CC=$(TC)gcc PREFIX=$(CURDIR) install + +.PHONY: all+ \ No newline at end of file