Advertisement
teplofizik

makefile (f0ledblinkgnu)

Nov 9th, 2012
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.98 KB | None | 0 0
  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.  
  6. CFLAGS  =  -I./ -ID:\Dev\Keil\ARM\INC\ST\STM32F0xx -ID:\Dev\Keil\ARM\CMSIS\Include -c -fno-common -O0 -g -mcpu=cortex-m0 -mthumb
  7. LFLAGS  = -Tstm32f0.ld -nostartfiles
  8. ODFLAGS = -S
  9.  
  10. all: test
  11.  
  12. clean:
  13.     -rm build\main.lst build\startup_stm32f0xx.o build\main.o build\main.elf build\main.lst build\main.bin
  14.  
  15. test: main.elf
  16.     @ echo "...copying"
  17.     $(CP) -O binary build\main.elf build\main.bin
  18.         $(CP) -O ihex build\main.elf build\main.hex
  19.     $(OD) $(ODFLAGS) build\main.elf > build\main.lst
  20.  
  21. main.elf: main.o startup.o stm32f0.ld
  22.     @ echo "..linking"
  23.     $(LD) $(LFLAGS) -o build\main.elf build\main.o build\startup_stm32f0xx.o
  24.  
  25. main.o: source\main.c
  26.     @ echo ".compiling"
  27.     $(CC) $(CFLAGS) source\main.c -o build\main.o
  28.  
  29. startup.o: source\startup_stm32f0xx.s
  30.     @ echo ".compiling"
  31.     $(CC) $(CFLAGS) source\startup_stm32f0xx.s -o build\startup_stm32f0xx.o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement