]> cloudbase.mooo.com Git - avrcpm.git/blame - avr/Makefile
* avr/Z80int-jmp.asm
[avrcpm.git] / 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
fa9059af 15ASRC0 = avrcpm.asm
b2017655 16
fa9059af
L
17ASRC0 += config.inc macros.inc init.asm dram-refresh.asm timer.asm utils.asm
18ASRC0 += mmc.asm mmc-old.asm virt_ports.asm
19ASRC0 += dsk_cpm.asm dsk_fat16.asm dsk_fsys.asm dsk_mgr.asm dsk_ram.asm
20ASRC0 += 8080int-orig.asm 8080int.asm 8080int-jmp.asm 8080int-t3.asm 8080int-t3-jmp.asm Z80int-jmp.asm
b2017655
FZ
21
22ifneq ($(DRAM_8BIT),0)
fa9059af 23 ASRC0 += dram-8bit.inc dram-8bit.asm sw-uart.asm
b2017655 24else
fa9059af 25 ASRC0 += dram-4bit.inc dram-4bit.asm hw-uart.asm
b2017655 26endif
3c3744f1 27
fa9059af
L
28#ASRC := $(ASRC0) svnrev.inc
29ASRC := $(ASRC0) svnrev.inc
30
3c3744f1 31# Place -D or -U options here
9c15f366 32CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_8BIT=$(DRAM_8BIT)
3c3744f1 33
fa9059af
L
34ASPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2
35DEFS = $(ASPATH)/Appnotes
36
37ifeq "$(OS)" "Windows_NT"
38 PLATFORM=win32
39else
40 PLATFORM=Linux
41endif
3c3744f1 42
fa9059af
L
43WINE =
44ifeq ($(PLATFORM),Linux)
45 WINE = wine
46endif
47
48AS = $(WINE) $(ASPATH)/avrasm2.exe
3c3744f1
L
49ASFLAGS = -I $(DEFS) $(CDEFS)
50
51# Programming support using avrdude. Settings and variables.
52
53AVRDUDE_PROGRAMMER = dragon_isp
54AVRDUDE_PORT = usb
55
56AVRDUDE_WRITE_FLASH = -U flash:w:$(TARGET).hex
57AVRDUDE_WRITE_EEPROM = -U eeprom:w:$(TARGET).eep
58
59
60# Uncomment the following if you want avrdude's erase cycle counter.
61# Note that this counter needs to be initialized first using -Yn,
62# see avrdude manual.
63#AVRDUDE_ERASE_COUNTER = -y
64
65# Uncomment the following if you do /not/ wish a verification to be
66# performed after programming the device.
67#AVRDUDE_NO_VERIFY = -V
68
69# Increase verbosity level. Please use this when submitting bug
70# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
71# to submit bug reports.
72#AVRDUDE_VERBOSE = -v -v
73
74AVRDUDE_BASIC = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
75AVRDUDE_FLAGS = $(AVRDUDE_BASIC) $(AVRDUDE_NO_VERIFY) $(AVRDUDE_VERBOSE) $(AVRDUDE_ERASE_COUNTER)
76
77AVRDUDE = avrdude
78REMOVE = rm -f
79MV = mv -f
80
81
82# Define all listing files.
b2017655 83#LST = $(ASRC:.asm=.lst)
3c3744f1
L
84
85# Combine all necessary flags and optional flags.
86# Add target processor to flags.
87ALL_ASFLAGS = $(ASFLAGS)
88
b2017655
FZ
89.PHONY: all hex eep lst map program flash eeprom tags clean
90
3c3744f1
L
91# Default target.
92all: hex lst
93
b2017655
FZ
94hex: $(TARGET).hex $(ASRC)
95eep: $(TARGET).eep $(ASRC)
96lst: $(TARGET).lst $(ASRC)
97map: $(TARGET).map $(ASRC)
3c3744f1
L
98
99
100# Program the device.
101program: $(TARGET).hex $(TARGET).eep
102 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH) $(AVRDUDE_WRITE_EEPROM)
103
104flash: $(TARGET).hex
105 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_FLASH)
106
107eeprom: $(TARGET).hex $(TARGET).eep
108 $(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_WRITE_EEPROM)
109
110
b2017655
FZ
111$(TARGET).hex: $(ASRC)
112$(TARGET).eep: $(ASRC)
113$(TARGET).lst: $(ASRC)
114$(TARGET).map: $(ASRC)
3c3744f1 115
b2017655
FZ
116#.SUFFIXES: .hex .eep .lst
117.SUFFIXES:
3c3744f1
L
118
119%.hex: %.asm
120 $(AS) $(ALL_ASFLAGS) -fI -o $@ $<
121
122%.lst: %.asm
123 @$(AS) $(ALL_ASFLAGS) -v0 -f- -l $@ $<
124
125%.map: %.asm
126 $(AS) $(ALL_ASFLAGS) -v0 -f- -m $@ $<
127
128tags: $(SRC) $(ASRC)
129 ctags $(SRC) $(ASRC)
130
fa9059af 131svnrev.inc: $(ASRC0)
2217c855 132 @svnrev -osvnrev.inc $^
3c3744f1
L
133
134# Target: clean project.
135clean:
136 $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).obj $(TARGET).map $(TARGET).lst
137