aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2019-12-17 17:39:03 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2019-12-17 17:39:03 +0100
commit2d91eebbf1fc9335269207602b360ec485aaf7bb (patch)
tree90dde42016446ea8b89d634f4bcf2b1489396e0e /Makefile
parentb26d2337f46aace9f735794dfdec3fdf22f55606 (diff)
downloadrpi-MMU-example-2d91eebbf1fc9335269207602b360ec485aaf7bb.tar.gz
rpi-MMU-example-2d91eebbf1fc9335269207602b360ec485aaf7bb.zip
don't embed stage2 of bootloader as binary blob - use smart section naming
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 4 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index d1d66fa..35cc48c 100644
--- a/Makefile
+++ b/Makefile
@@ -30,17 +30,14 @@ PL_0_test.elf : PL0_test.o uart.o
kernel.elf : boot.o kernel.o uart.o PL_0_test_embeddable.o demo_functionality.o paging.o libkernel_renamed.o interrupt_vector.o interrupts.o
arm-none-eabi-gcc -T linker.ld -o $@ $(ELFFLAGS) $^
-loader_stage2.elf : loader_stage2.o uart.o
- arm-none-eabi-gcc -T loader_stage2.ld -o $@ $(ELFFLAGS) $^
+loader.elf : boot.o loader_stage1.o loader_stage2.o uart.o
+ arm-none-eabi-gcc -T loader_linker.ld -o $@ $(ELFFLAGS) $^
-loader_stage2.img : loader_stage2.elf
+loader.img : loader.elf
arm-none-eabi-objcopy $^ -O binary $@
+# check if the resulting image is not too big
test -n "$$(find $@ -size -16384c)" || exit -1
-loader.elf : boot.o loader_stage1.o loader_stage2_embeddable.o
- arm-none-eabi-gcc -T loader_stage1.ld -o $@ $(ELFFLAGS) $^
-
-
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^