]>
Commit | Line | Data |
---|---|---|
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 |
6 | MCU = atmega328P | |
7 | #F_CPU = 24576000 | |
ebf7dfab | 8 | F_CPU = 20000000 |
f2114c72 | 9 | BAUD = 115200 |
3c3744f1 L |
10 | DRAM_DQ_ORDER = 1 |
11 | ||
12 | TARGET = z80 | |
13 | ASRC = z80.asm | |
14 | ||
15 | # Place -D or -U options here | |
16 | CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_DQ_ORDER=$(DRAM_DQ_ORDER) | |
17 | ||
18 | WINEPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2 | |
19 | DEFS = $(WINEPATH)/Appnotes | |
20 | ||
21 | AS = wine $(WINEPATH)/avrasm2.exe | |
22 | ASFLAGS = -I $(DEFS) $(CDEFS) | |
23 | ||
24 | # Programming support using avrdude. Settings and variables. | |
25 | ||
26 | AVRDUDE_PROGRAMMER = dragon_isp | |
27 | AVRDUDE_PORT = usb | |
28 | ||
29 | AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex | |
30 | AVRDUDE_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 | ||
47 | AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) | |
48 | AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER) | |
49 | ||
50 | AVRDUDE = avrdude | |
51 | REMOVE = rm -f | |
52 | MV = mv -f | |
53 | ||
54 | ||
55 | # Define all listing files. | |
56 | LST = $(ASRC:.asm=.lst) | |
57 | ||
58 | # Combine all necessary flags and optional flags. | |
59 | # Add target processor to flags. | |
60 | ALL_ASFLAGS = $(ASFLAGS) | |
61 | ||
62 | # Default target. | |
63 | all: hex lst | |
64 | ||
65 | hex: $(TARGET).hex | |
66 | eep: $(TARGET).eep | |
67 | lst: $(TARGET).lst | |
68 | map: $(TARGET).map | |
69 | ||
70 | ||
71 | # Program the device. | |
72 | program: $(TARGET).hex $(TARGET).eep | |
73 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM) | |
74 | ||
75 | flash: $(TARGET).hex | |
76 | $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) | |
77 | ||
78 | eeprom: $(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 | ||
94 | tags: $(SRC) $(ASRC) | |
95 | ctags $(SRC) $(ASRC) | |
96 | ||
97 | ||
98 | ||
99 | # Target: clean project. | |
100 | clean: | |
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 |