Makefile 1000 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./ -ID:\Dev\Keil\ARM\INC\ST\STM32F0xx -ID:\Dev\Keil\ARM\CMSIS\Include -c -fno-common -O0 -g -mcpu=cortex-m0 -mthumb
  6. LFLAGS = -Tstm32f0.ld -nostartfiles
  7. ODFLAGS = -S
  8. all: test
  9. clean:
  10. -rm build\main.lst build\startup_stm32f0xx.o build\main.o build\main.elf build\main.lst build\main.bin
  11. test: main.elf
  12. @ echo "...copying"
  13. $(CP) -O binary build\main.elf build\main.bin
  14. $(CP) -O ihex build\main.elf build\main.hex
  15. $(OD) $(ODFLAGS) build\main.elf > build\main.lst
  16. main.elf: main.o startup.o stm32f0.ld
  17. @ echo "..linking"
  18. $(LD) $(LFLAGS) -o build\main.elf build\main.o build\startup_stm32f0xx.o
  19. main.o: source\main.c
  20. @ echo ".compiling"
  21. $(CC) $(CFLAGS) source\main.c -o build\main.o
  22. startup.o: source\startup_stm32f0xx.s
  23. @ echo ".compiling"
  24. $(CC) $(CFLAGS) source\startup_stm32f0xx.s -o build\startup_stm32f0xx.o