Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.66 KB | None | 0 0
  1. # http://www.micahcarrick.com/avr-tutorial-digital-output.html
  2.  
  3. PROJECT=led
  4. SOURCES=main.c
  5. CROSS_COMPILE=avr-
  6. CC=$(CROSS_COMPILE)gcc
  7. OBJCOPY=$(CROSS_COMPILE)objcopy
  8. MMCU=attiny2313a
  9. CFLAGS=-mmcu=$(MMCU) -Wall -Os
  10.  
  11. DUDE_MCU=t2313
  12. DUDE_PRG=usbasp
  13.  
  14. all: hex
  15.  
  16. hex: out
  17.     $(OBJCOPY) -j .text -O ihex $(PROJECT).out $(PROJECT).hex
  18.  
  19. out: $(SOURCES)
  20.     $(CC) $(CFLAGS) -o $(PROJECT).out $(SOURCES)
  21.  
  22. flash:
  23.     avrdude -p $(DUDE_MCU) -c $(DUDE_PRG) -e -U flash:w:$(PROJECT).hex
  24.  
  25. fuses:
  26.     @echo "Do nothing. This feature is not implemented yet"
  27.  
  28. shell:
  29.     avrdude -p $(DUDE_MCU) -c $(DUDE_PRG) -t
  30.  
  31. clean:
  32.     rm -f $(PROJECT).out
  33.     rm -f $(PROJECT).hex
  34.  
  35. .PHONY: clean
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement