]> cloudbase.mooo.com Git - avrcpm.git/blame_incremental - avr/Makefile
* Renamed Z80int.asm to 8080int-orig.asm
[avrcpm.git] / avr / Makefile
... / ...
CommitLineData
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
6MCU = atmega328P
7F_CPU = 20000000
8#BAUD = 19200
9BAUD = 57600
10#BAUD = 115200
11
12DRAM_8BIT = 1
13
14TARGET = avrcpm
15ASRC0 = avrcpm.asm
16
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
21
22ifneq ($(DRAM_8BIT),0)
23 ASRC0 += dram-8bit.inc dram-8bit.asm sw-uart.asm
24else
25 ASRC0 += dram-4bit.inc dram-4bit.asm hw-uart.asm
26endif
27
28#ASRC := $(ASRC0) svnrev.inc
29ASRC := $(ASRC0) svnrev.inc
30
31# Place -D or -U options here
32CDEFS = -DF_CPU=$(F_CPU) -DBAUD=$(BAUD) -D$(MCU) -DDRAM_8BIT=$(DRAM_8BIT)
33
34ASPATH = C:/Programme/Atmel/AVR\ Tools/AvrAssembler2
35DEFS = $(ASPATH)/Appnotes
36
37ifeq "$(OS)" "Windows_NT"
38 PLATFORM=win32
39else
40 PLATFORM=Linux
41endif
42
43WINE =
44ifeq ($(PLATFORM),Linux)
45 WINE = wine
46endif
47
48AS = $(WINE) $(ASPATH)/avrasm2.exe
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.
83#LST = $(ASRC:.asm=.lst)
84
85# Combine all necessary flags and optional flags.
86# Add target processor to flags.
87ALL_ASFLAGS = $(ASFLAGS)
88
89.PHONY: all hex eep lst map program flash eeprom tags clean
90
91# Default target.
92all: hex lst
93
94hex: $(TARGET).hex $(ASRC)
95eep: $(TARGET).eep $(ASRC)
96lst: $(TARGET).lst $(ASRC)
97map: $(TARGET).map $(ASRC)
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
111$(TARGET).hex: $(ASRC)
112$(TARGET).eep: $(ASRC)
113$(TARGET).lst: $(ASRC)
114$(TARGET).map: $(ASRC)
115
116#.SUFFIXES: .hex .eep .lst
117.SUFFIXES:
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
131svnrev.inc: $(ASRC0)
132 svnrev -osvnrev.inc $^
133
134# Target: clean project.
135clean:
136 $(REMOVE) $(TARGET).hex $(TARGET).eep $(TARGET).obj $(TARGET).map $(TARGET).lst
137