source: avrstuff/blinkled/Makefile@ 4fbae10

main
Last change on this file since 4fbae10 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
Line 
1#Set vars
2MCU=atmega48p
3FCPU=16000000
4COMPILE = avr-gcc -Wall -Os -std=c99 -mmcu=$(MCU) -DF_CPU=20000000
5
6#Rules
7$(MCU).hex: blinkdel.bin
8 avr-objcopy -j .text -j .data -O ihex $^ $@
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:
18 $(COMPILE) -mmcu=$(MCU) -std=c99 -c $< -o $@
19
20flash:
21 avrdude -c usbasp -p $(MCU) -Uflash:w:$(MCU).hex
22
23clean:
24 rm *.bin *.o *.hex
Note: See TracBrowser for help on using the repository browser.