Makefile 911 B

12345678910111213141516171819202122232425262728293031
  1. CC = arm-none-eabi-gcc
  2. LD = arm-none-eabi-ld -v
  3. CP = arm-none-eabi-objcopy
  4. OD = arm-none-eabi-objdump
  5. CFLAGS = -I./ -I./lib -I./inc -c -fno-common -O0 -g -mcpu=cortex-m0 -mthumb
  6. LFLAGS = -Tstm32f0.ld -nostartfiles
  7. ODFLAGS = -S
  8. all: test
  9. clean: -rm build/main.lst build/startup_stm32f0xx.o build/main.o build/main.elf build/main.lst build/main.bin
  10. test: main.elf
  11. @ echo "...copying"
  12. $(CP) -O binary build/main.elf build/main.bin
  13. $(CP) -O ihex build/main.elf build/main.hex
  14. $(OD) $(ODFLAGS) build/main.elf > build/main.lst
  15. main.elf: main.o startup.o stm32f0.ld
  16. @ echo "..linking"
  17. $(LD) $(LFLAGS) -o build/main.elf build/main.o build/startup_stm32f0xx.o
  18. main.o: source/main.c
  19. @ echo ".compiling"
  20. $(CC) $(CFLAGS) source/main.c -o build/main.o
  21. startup.o: source/startup_stm32f0xx.s
  22. @ echo ".compiling"
  23. $(CC) $(CFLAGS) source/startup_stm32f0xx.s -o build/startup_stm32f0xx.o