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