Advertisement
Guest User

C Makefile for Arduino Assembly problem

a guest
Jan 22nd, 2013
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.57 KB | None | 0 0
  1. CFLAGS = -Os -mmcu=atmega168 -fverbose-asm -save-temps
  2. PROGNAME = led
  3.  
  4. RED = \e[0;31m
  5. NC = \e[0m # No color
  6.  
  7. all:
  8.     @echo -e '$(RED) -------------------- $(NC)'
  9.     @echo -e '$(RED) COMPILING $(NC)'
  10.     avr-gcc $(CFLAGS) -o $(PROGNAME).elf $(PROGNAME).c
  11.     @echo -e '$(RED) EXTRACTING IHEX $(NC)'
  12.     avr-objcopy -O ihex -R .eeprom $(PROGNAME).elf $(PROGNAME).hex
  13.     @echo -e '$(RED) REMOVING TEMPFILES $(NC)'
  14.     rm -f $(PROGNAME).i
  15.     rm -f $(PROGNAME).o
  16.     @echo -e '$(RED) FINISHED! $(NC)'
  17.    
  18. program:
  19.     avrdude -p m168 -P /dev/ttyUSB0 -c stk500v1 -b 19200 -u -U flash:w:$(PROGNAME).hex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement