Makefile 554 B

123456789101112131415161718192021222324252627282930313233
  1. BIN2C = ../../../../src/helper/bin2char.sh
  2. CROSS_COMPILE ?= arm-none-eabi-
  3. CC=$(CROSS_COMPILE)gcc
  4. OBJCOPY=$(CROSS_COMPILE)objcopy
  5. OBJDUMP=$(CROSS_COMPILE)objdump
  6. CFLAGS = -static -nostartfiles -mlittle-endian -Wa,-EL
  7. LDFLAGS = -Tdebug_handler.ld
  8. all: debug_handler.inc
  9. .PHONY: clean
  10. .INTERMEDIATE: debug_handler.elf
  11. debug_handler.elf: protocol.h
  12. %.elf: %.S
  13. $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@
  14. %.lst: %.elf
  15. $(OBJDUMP) -S $< > $@
  16. %.bin: %.elf
  17. $(OBJCOPY) -Obinary $< $@
  18. %.inc: %.bin
  19. $(BIN2C) < $< > $@
  20. clean:
  21. -rm -f *.elf *.lst *.bin *.inc