aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvetch <vetch97@gmail.com>2019-10-15 16:03:49 +0200
committervetch <vetch97@gmail.com>2019-10-15 16:03:49 +0200
commit29f996e03b36f6cd390d99ff260ab251e19a6e69 (patch)
tree37097a9b2952e3976e6d1f36bb44e29a0217579f
parente20129720adb334f46e329bfbe7090ee7188caac (diff)
downloadrpi-MMU-example-29f996e03b36f6cd390d99ff260ab251e19a6e69.tar.gz
rpi-MMU-example-29f996e03b36f6cd390d99ff260ab251e19a6e69.zip
Added ELFFLAGS
-rw-r--r--Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 67aa3e0..adb74d0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,7 @@
CFLAGS=-mcpu=cortex-a7 -ffreestanding -std=gnu99 -Wall -Wextra -I.
+ELFFLAGS=-ffreestanding -O2 -nostdlib -lgcc -I.
+
all : kernel7.img
kernel.o : kernel.c
@@ -12,7 +14,7 @@ boot.o : boot.S
arm-none-eabi-as -mcpu=cortex-a7 $^ -o $@
kernel.elf : boot.o kernel.o uart.o
- arm-none-eabi-gcc -T linker.ld -o $@ -ffreestanding -O2 -nostdlib $^ -lgcc -I.
+ arm-none-eabi-gcc -T linker.ld -o $@ $(ELFFLAGS) $^
kernel7.img : kernel.elf
arm-none-eabi-objcopy $^ -O binary $@
@@ -21,7 +23,7 @@ loader_stage2.o : loader_stage2.c
arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
loader_stage2.elf : loader_stage2.o uart.o
- arm-none-eabi-gcc -T loader_stage2.ld -o $@ -ffreestanding -O2 -nostdlib $^ -lgcc
+ arm-none-eabi-gcc -T loader_stage2.ld -o $@ $(ELFFLAGS) $^
loader_stage2.img : loader_stage2.elf
arm-none-eabi-objcopy $^ -O binary $@
@@ -33,7 +35,7 @@ loader_stage1.o : loader_stage1.c
arm-none-eabi-gcc $(CFLAGS) -c $^ -o $@
loader.elf : boot.o loader_stage1.o loader_stage2_embeddable.o
- arm-none-eabi-gcc -T loader_stage1.ld -o $@ -ffreestanding -O2 -nostdlib $^ -lgcc
+ arm-none-eabi-gcc -T loader_stage1.ld -o $@ $(ELFFLAGS) $^
loader.img : loader.elf
arm-none-eabi-objcopy $^ -O binary $@