aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2019-10-03 17:57:43 +0200
committervetch <vetch97@gmail.com>2019-10-03 17:57:43 +0200
commit41ad4c6268b0292464802d88ac6835d21e69cabb (patch)
tree400b789ec9e84ad2a108db51a4cbf7f43a2f4631 /Makefile
parentc0f127091eec7a9c975389fda5f49c63eccb3d3a (diff)
downloadrpi-MMU-example-41ad4c6268b0292464802d88ac6835d21e69cabb.tar.gz
rpi-MMU-example-41ad4c6268b0292464802d88ac6835d21e69cabb.zip
changes in Makefile, modularize kernel
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 8ad7c03..b1b15c4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,18 @@
+CFLAGS=-mcpu=cortex-a7 -ffreestanding -std=gnu99 -Wall -Wextra -I.
+
all : kernel7.img
kernel.o : kernel.c
- arm-none-eabi-gcc -mcpu=cortex-a7 -ffreestanding -std=gnu99 -c -Wall -Wextra $^ -o $@
+ arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
+
+uart.o : uart.c
+ arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
boot.o : boot.S
- arm-none-eabi-as -mcpu=cortex-a7 boot.S -o boot.o
+ arm-none-eabi-as -mcpu=cortex-a7 $^ -o $@
-kernel.elf : boot.o kernel.o
- arm-none-eabi-gcc -T linker.ld -o $@ -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc
+kernel.elf : boot.o kernel.o uart.o
+ arm-none-eabi-gcc -T linker.ld -o $@ -ffreestanding -O2 -nostdlib boot.o kernel.o uart.o -lgcc -I.
kernel7.img : kernel.elf
arm-none-eabi-objcopy $^ -O binary $@
@@ -19,6 +24,6 @@ qemu-bin : kernel7.img
qemu-system-arm -m 256 -M raspi2 -serial stdio -kernel $^
clean :
- -rm kernel7.img kernel.elf boot.o kernel.o
+ -rm kernel7.img kernel.elf boot.o kernel.o uart.o
.PHONY: all qemu-elf qemu-bin clean