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