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)
5 #For a description of of the following built options see 'config.inc'
6 #Defining options here will override the defaults from the config file.
21 # Version defined in 'config.inc'.
22 VMAJOR
= $(call conf-val
, VMAJOR
, config.inc
)
23 VMINOR
= $(call conf-val
, VMINOR
, config.inc
)
29 ASRC0
+= config.inc macros.inc init.asm dram-refresh.asm timer.asm utils.asm
30 ASRC0
+= mmc.asm mmc-old.asm virt_ports.asm
31 ASRC0
+= dsk_cpm.asm dsk_fat16.asm dsk_fsys.asm dsk_mgr.asm dsk_ram.asm
32 ASRC0
+= 8080int-orig.asm
8080int.asm
8080int-jmp.asm
8080int-t3.asm
8080int-t3-jmp.asm Z80int-jmp.asm
34 ifneq ($(DRAM_8BIT
),0)
35 ASRC0
+= dram-8bit.inc dram-8bit.asm sw-uart.asm i2c.asm
37 ASRC0
+= dram-4bit.inc dram-4bit.asm hw-uart.asm
40 ASRC
= $(ASRC0
) svnrev.inc
41 #ASRC := $(ASRC0) svnrev.inc
43 # Place -D or -U options here
47 CDEFS
+= -DF_CPU
=$(F_CPU
)
50 CDEFS
+= -DDRAM_8BIT
=$(DRAM_8BIT
)
53 CDEFS
+= -DBAUD
=$(BAUD
)
56 CDEFS
+= -DI2C_SUPPORT
=$(I2C_SUPPORT
)
59 CDEFS
+= -DEM_Z80
=$(EM_Z80
)
62 CDEFS
+= -DFAT16_SUPPORT
=$(FAT16_SUPPORT
)
65 CDEFS
+= -DCPMDSK_SUPPORT
=$(CPMDSK_SUPPORT
)
68 CDEFS
+= -DMMCBOOTLOADER
=$(MMCBOOTLOADER
)
71 CDEFS
+= -DTESTVERSION
=$(TESTVERSION
)
74 ASPATH
= C
:/Programme
/Atmel
/AVR\ Tools
/AvrAssembler2
75 DEFS
= $(ASPATH
)/Appnotes
77 ifeq "$(OS)" "Windows_NT"
84 ifeq ($(PLATFORM
),Linux
)
88 AS
= $(WINE
) $(ASPATH
)/avrasm2.exe
89 ASFLAGS
= -I
$(DEFS
) $(CDEFS
)
95 HEXTOBIN
= $(OBJCOPY
) -I ihex
-O binary
--gap-fill
0xff
97 #(call conf-val,config-id,config-file)
98 #conf-val = $(shell $(AWK) -vID=$(strip $1) '$$0 ~ "^[ \t]*\#define[ \t]+" ID "[ \t]+" {print $$3}' $2 )
99 conf-val
= $(shell $(AWK
) -vID
=$(strip $1) '$$1$$2 ~ "\#define"ID {print $$3}' $2)
102 # Programming support using avrdude. Settings and variables.
104 AVRDUDE_PROGRAMMER
= dragon_isp
107 AVRDUDE_WRITE_FLASH
= -U flash
:w
:$(TARGET
).hex
108 AVRDUDE_WRITE_EEPROM
= -U eeprom
:w
:$(TARGET
).eep
111 # Uncomment the following if you want avrdude's erase cycle counter.
112 # Note that this counter needs to be initialized first using -Yn,
113 # see avrdude manual.
114 #AVRDUDE_ERASE_COUNTER = -y
116 # Uncomment the following if you do /not/ wish a verification to be
117 # performed after programming the device.
118 #AVRDUDE_NO_VERIFY = -V
120 # Increase verbosity level. Please use this when submitting bug
121 # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
122 # to submit bug reports.
123 #AVRDUDE_VERBOSE = -v -v
125 AVRDUDE_BASIC
= -p
$(MCU
) -P
$(AVRDUDE_PORT
) -c
$(AVRDUDE_PROGRAMMER
)
126 AVRDUDE_FLAGS
= $(AVRDUDE_BASIC
) $(AVRDUDE_NO_VERIFY
) $(AVRDUDE_VERBOSE
) $(AVRDUDE_ERASE_COUNTER
)
132 .PHONY
: all bin hex eep lst map program flash eeprom
tags clean
141 bin
: $(TARGET
)-$(VMAJOR
).
$(VMINOR
).bin
144 # Program the device.
145 program
: $(TARGET
).hex
$(TARGET
).eep
146 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_FLASH
) $(AVRDUDE_WRITE_EEPROM
)
149 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_FLASH
)
151 eeprom
: $(TARGET
).hex
$(TARGET
).eep
152 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_EEPROM
)
155 $(TARGET
).hex
: $(ASRC
)
156 $(TARGET
).eep
: $(ASRC
)
157 $(TARGET
).lst
: $(ASRC
)
158 $(TARGET
).map
: $(ASRC
)
163 %-$(VMAJOR
).
$(VMINOR
).bin
: %.hex
168 $(AS
) $(ASFLAGS
) -fI
-o
$@
$<
171 @
$(AS
) $(ASFLAGS
) -v0
-f-
-l
$@
$<
174 $(AS
) $(ASFLAGS
) -v0
-f-
-m
$@
$<
180 svnrev
-osvnrev.inc
$^
183 # Target: clean project.
185 $(REMOVE
) $(TARGET
).hex
$(TARGET
).eep
$(TARGET
).obj
$(TARGET
).map
$(TARGET
).lst \
186 $(TARGET
)-$(VMAJOR
).
$(VMINOR
).bin