source: avrstuff/blinkled/Makefile@ 38a6d09

main
Last change on this file since 38a6d09 was 4fbae10, checked in by Adrien Destugues <pulkomandy@…>, 10 years ago

Make it easier to use blinkdel with various AVRs.

git-svn-id: svn://pulkomandy.tk/avrstuff@97 c6672c3c-f6b6-47f9-9001-1fd6b12fecbe

  • Property mode set to 100644
File size: 447 bytes
RevLine 
[26d7f34]1#Set vars
[4fbae10]2MCU=atmega48p
3FCPU=16000000
[df91872]4COMPILE = avr-gcc -Wall -Os -std=c99 -mmcu=$(MCU) -DF_CPU=20000000
[26d7f34]5
6#Rules
[4fbae10]7$(MCU).hex: blinkdel.bin
8 avr-objcopy -j .text -j .data -O ihex $^ $@
[26d7f34]9
10blinkdel.bin: main.o
11 $(COMPILE) main.o -o blinkdel.bin
12
13#Generic rules
14.S.o:
15 $(COMPILE) -x assembler-with-cpp -c $< -o $@
16
17.c.o:
[4fbae10]18 $(COMPILE) -mmcu=$(MCU) -std=c99 -c $< -o $@
[26d7f34]19
20flash:
[4fbae10]21 avrdude -c usbasp -p $(MCU) -Uflash:w:$(MCU).hex
[26d7f34]22
23clean:
24 rm *.bin *.o *.hex
Note: See TracBrowser for help on using the repository browser.