1
0

Makefile 432 B

1234567891011121314151617181920212223
  1. ARM-CC ?= arm-none-eabi-gcc
  2. ARM-LD ?= arm-none-eabi-ld
  3. all: test.elf
  4. CFLAGS := -nostdlib -nostartfiles -ffreestanding -g -I.. -std=c99
  5. OBJS = loader.o main.o
  6. .PHONY: clean
  7. test.elf: $(OBJS) linker.ld
  8. $(ARM-CC) -nostdlib $(OBJS) -Wl,-T,linker.ld -Wl,-z,max-page-size=0x1000 -o $@ -lgcc
  9. clean:
  10. $(RM) -f $(OBJS) test.elf
  11. %.o: %.c Makefile
  12. $(ARM-CC) $(CFLAGS) -c $< -o $@
  13. %.o: %.s Makefile
  14. $(ARM-CC) $(ASFLAGS) -c $< -o $@