]> cloudbase.mooo.com Git - avrcpm.git/blame - avrcpm/avr/Makefile
* More rcall --> lcall changes.
[avrcpm.git] / avrcpm / avr / Makefile
CommitLineData
3c3744f1
L
1# AVR-ASM Makefile, derived from the WinAVR template (which
2# is public domain), believed to be neutral to any flavor of "make"
3# (GNU make, BSD make, SysV make)
4
f2114c72
L
5#MCU = atmega8
6MCU = atmega328P
ebf7dfab 7F_CPU = 20000000
2f6fa691
L
8#BAUD = 19200
9BAUD = 57600
10#BAUD = 115200
3c3744f1 11
9c15f366
L
12DRAM_8BIT = 1
13
14TARGET = avrcpm
15ASRC = avrcpm.asm
3c3744f1
L
16
17# Place -D or -U options here
9c15f366 18CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_8BIT=$(DRAM_8BIT)
3c3744f1
L
19
20WINEPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2
21DEFS = $(WINEPATH)/Appnotes
22
23AS = wine $(WINEPATH)/avrasm2.exe
24ASFLAGS = -I $(DEFS) $(CDEFS)
25
26# Programming support using avrdude. Settings and variables.
27
28AVRDUDE_PROGRAMMER = dragon_isp
29AVRDUDE_PORT = usb
30
31AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
32AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
33
34
35# Uncomment the following if you want avrdude's erase cycle counter.
36# Note that this counter needs to be initialized first using -Yn,
37# see avrdude manual.
38#AVRDUDE_ERASE_COUNTER = -y
39
40# Uncomment the following if you do /not/ wish a verification to be
41# performed after programming the device.
42#AVRDUDE_NO_VERIFY = -V
43
44# Increase verbosity level. Please use this when submitting bug
45# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
46# to submit bug reports.
47#AVRDUDE_VERBOSE = -v -v
48
49AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
50AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER)
51
52AVRDUDE = avrdude
53REMOVE = rm -f
54MV = mv -f
55
56
57# Define all listing files.
58LST = $(ASRC:.asm=.lst)
59
60# Combine all necessary flags and optional flags.
61# Add target processor to flags.
62ALL_ASFLAGS = $(ASFLAGS)
63
64# Default target.
65all: hex lst
66
67hex: $(TARGET).hex
68eep: $(TARGET).eep
69lst: $(TARGET).lst
70map: $(TARGET).map
71
72
73# Program the device.
74program: $(TARGET).hex $(TARGET).eep
75 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
76
77flash: $(TARGET).hex
78 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
79
80eeprom: $(TARGET).hex $(TARGET).eep
81 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_EEPROM)
82
83
84
85.SUFFIXES: .hex .eep .lst
86
87%.hex: %.asm
88 $(AS) $(ALL_ASFLAGS) -fI -o $@ $<
89
90%.lst: %.asm
91 @$(AS) $(ALL_ASFLAGS) -v0 -f- -l $@ $<
92
93%.map: %.asm
94 $(AS) $(ALL_ASFLAGS) -v0 -f- -m $@ $<
95
96tags: $(SRC) $(ASRC)
97 ctags $(SRC) $(ASRC)
98
99
100
101# Target: clean project.
102clean:
103 $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).obj $(TARGET).map $(TARGET).lst
104
105
106.PHONY: all hex eep lst map program flash eeprom tags clean
107