1 |
# makefile, written by kaklik |
1 |
# makefile, written by kaklik |
2 |
MCU=atmega8 |
2 |
MCU=atmega8 |
3 |
CC=avr-gcc |
3 |
CC=avr-gcc |
4 |
OBJCOPY=avr-objcopy |
4 |
OBJCOPY=avr-objcopy |
5 |
# optimize for size: |
5 |
# optimize for size: |
6 |
CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues |
6 |
CFLAGS=-g -mmcu=$(MCU) -Wall -Wstrict-prototypes -Os -mcall-prologues |
7 |
#------------------- |
7 |
#------------------- |
8 |
all: DOGFINDER_TX.hex |
8 |
all: DOGFINDER_TX.hex |
9 |
#------------------- |
9 |
#------------------- |
10 |
help: |
10 |
help: |
11 |
@echo "Usage: make all|load|load_pre|rdfuses|wrfuse1mhz|wrfuse4mhz|wrfusecrystal" |
11 |
@echo "Usage: make all|load|load_pre|rdfuses|wrfuse1mhz|wrfuse4mhz|wrfusecrystal" |
12 |
@echo "Warning: you will not be able to undo wrfusecrystal unless you connect an" |
12 |
@echo "Warning: you will not be able to undo wrfusecrystal unless you connect an" |
13 |
@echo " external crystal! uC is dead after wrfusecrystal if you do not" |
13 |
@echo " external crystal! uC is dead after wrfusecrystal if you do not" |
14 |
@echo " have an external crystal." |
14 |
@echo " have an external crystal." |
15 |
#------------------- |
15 |
#------------------- |
16 |
DOGFINDER_TX.hex : DOGFINDER_TX.out |
16 |
DOGFINDER_TX.hex : DOGFINDER_TX.out |
17 |
$(OBJCOPY) -R .eeprom -O ihex DOGFINDER_TX.out DOGFINDER_TX.hex |
17 |
$(OBJCOPY) -R .eeprom -O ihex DOGFINDER_TX.out DOGFINDER_TX.hex |
18 |
DOGFINDER_TX.out : DOGFINDER_TX.o |
18 |
DOGFINDER_TX.out : DOGFINDER_TX.o |
19 |
$(CC) $(CFLAGS) -o DOGFINDER_TX.out -Wl,-Map,DOGFINDER_TX.map DOGFINDER_TX.o |
19 |
$(CC) $(CFLAGS) -o DOGFINDER_TX.out -Wl,-Map,DOGFINDER_TX.map DOGFINDER_TX.o |
20 |
DOGFINDER_TX.o : DOGFINDER_TX.c |
20 |
DOGFINDER_TX.o : DOGFINDER_TX.c |
21 |
$(CC) $(CFLAGS) -Os -c DOGFINDER_TX.c |
21 |
$(CC) $(CFLAGS) -Os -c DOGFINDER_TX.c |
22 |
#------------------- |
22 |
#------------------- |
23 |
clean: |
23 |
clean: |
24 |
rm -f *.o *.map *.out *t.hex |
24 |
rm -f *.o *.map *.out *t.hex |
25 |
#------------------- |
25 |
#------------------- |