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