diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-13 15:22:41 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-13 15:22:41 +0100 |
commit | edc3e0a9eefbf7dceb00f80e0f4a35c4ff0839e9 (patch) | |
tree | 2f67af839d96173aa349b9c550e4ed7e6f495fdc /build/Makefile | |
parent | e7444762ffff742bfccf70cb3493d8e52833f990 (diff) | |
download | rpi-MMU-example-edc3e0a9eefbf7dceb00f80e0f4a35c4ff0839e9.tar.gz rpi-MMU-example-edc3e0a9eefbf7dceb00f80e0f4a35c4ff0839e9.zip |
use MAKE variables
Diffstat (limited to 'build/Makefile')
-rw-r--r-- | build/Makefile | 19 |
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) |