aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorWojtek Kosior <kwojtus@protonmail.com>2020-01-13 13:08:38 +0100
committerWojtek Kosior <kwojtus@protonmail.com>2020-01-13 13:08:38 +0100
commit63b45f687868af38d21930790f0d0e517b50b2e2 (patch)
treed5e5350feee6cb2645d41592cd481bd45ebef535 /Makefile
parent1af7591e37d09ddcd734ea07d0e999cf61c8bc5e (diff)
downloadrpi-MMU-example-63b45f687868af38d21930790f0d0e517b50b2e2.tar.gz
rpi-MMU-example-63b45f687868af38d21930790f0d0e517b50b2e2.zip
shorten linking in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 12 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index a44eea2..3463d25 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ PL_0_TEST_OBJECTS=PL0_utils.o svc.o PL0_test.o strings.o io.o
LOADER_STAGE2_OBJECTS=uart.o strings.o io.o loader_stage2.o
-RAMFS_FILES=PL_0_test.img
+RAMFS_FILES=PL0_test.img
all : kernel.img
@@ -28,26 +28,24 @@ VPATH=$(src)
%_embeddable.o : %.img
arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm $^ $@
-PL_0_test.elf : PL0_test.ld $(PL_0_TEST_OBJECTS)
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(PL_0_TEST_OBJECTS)
+%.elf : %.ld
+ arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(filter %.o,$^)
-kernel_stage1.o : kernel_stage1.S kernel_stage2.img
- arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
+PL0_test.elf : $(PL_0_TEST_OBJECTS)
-kernel.elf : kernel_stage1.ld kernel_stage1.o
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) kernel_stage1.o
+kernel.elf : kernel_stage1.o
-kernel_stage2.elf : kernel_stage2.ld $(KERNEL_STAGE2_OBJECTS)
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(KERNEL_STAGE2_OBJECTS)
+kernel_stage2.elf : $(KERNEL_STAGE2_OBJECTS)
-loader_stage2.elf : loader_stage2_linker.ld $(LOADER_STAGE2_OBJECTS)
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(LOADER_STAGE2_OBJECTS)
+loader_stage2.elf : $(LOADER_STAGE2_OBJECTS)
-loader_stage1.o : loader_stage1.S loader_stage2.img
+loader.elf : loader_stage1.o
+
+kernel_stage1.o : kernel_stage1.S kernel_stage2.img
arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
-loader.elf : loader_stage1_linker.ld loader_stage1.o
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) loader_stage1.o
+loader_stage1.o : loader_stage1.S loader_stage2.img
+ arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
qemu-elf : kernel.elf
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^