main
Line | |
---|
1 | #Set vars
|
---|
2 | MCU=atmega48p
|
---|
3 | FCPU=16000000
|
---|
4 | COMPILE = 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 |
|
---|
10 | blinkdel.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 |
|
---|
20 | flash:
|
---|
21 | avrdude -c usbasp -p $(MCU) -Uflash:w:$(MCU).hex
|
---|
22 |
|
---|
23 | clean:
|
---|
24 | rm *.bin *.o *.hex
|
---|
Note:
See
TracBrowser
for help on using the repository browser.