aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/Makefile19
1 files changed, 13 insertions, 6 deletions
diff --git a/build/Makefile b/build/Makefile
index ac6c818..4a145e9 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -2,10 +2,17 @@ HOST_CC ?= gcc
HOST_CFLAGS ?= -Wall -std=gnu99 -I../src/lib/rs232 -O3
-ARM_CC ?= arm-none-eabi-gcc
+ARM_BASE ?= arm-none-eabi
+
+ARM_CC ?= $(ARM_BASE)-gcc
ARM_CFLAGS ?= -mcpu=cortex-a7 -ffreestanding -std=gnu11 -Wall -Wextra $(addprefix -I, $(dirs))
-ELFFLAGS ?= -nostdlib -lgcc
+
+ARM_AS ?= $(ARM_BASE)-as
+
+ARM_OBJCOPY ?= $(ARM_BASE)-objcopy
+
+ARM_ELFFLAGS ?= -nostdlib -lgcc
KERNEL_STAGE2_OBJECTS := setup.o interrupt_vector.o interrupts.o uart.o demo_functionality.o paging.o ramfs_embeddable.o ramfs.o strings.o io.o atags.o scheduler.o
@@ -35,16 +42,16 @@ echo :
$(ARM_CC) $(ARM_CFLAGS),$(HOST_CC) $(HOST_CFLAGS)) -c $< -o $@
%.img : %.elf
- arm-none-eabi-objcopy $^ -O binary $@
+ $(ARM_OBJCOPY) $^ -O binary $@
%.o: %.S
- arm-none-eabi-as -mcpu=cortex-a7 $< -o $@
+ $(ARM_AS) -mcpu=cortex-a7 $< -o $@
%_embeddable.o : %.img
- arm-none-eabi-objcopy -I binary -O elf32-littlearm -B arm $^ $@
+ $(ARM_OBJCOPY) -I binary -O elf32-littlearm -B arm $^ $@
%.elf : %.ld
- arm-none-eabi-gcc -T $< -o $@ $(ELFFLAGS) $(filter %.o,$^)
+ $(ARM_CC) -T $< -o $@ $(ARM_ELFFLAGS) $(filter %.o,$^)
PL0_test.elf : $(PL_0_TEST_OBJECTS)