aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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