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.
22 # Version defined in 'config.inc'.
23 VMAJOR
= $(call conf-val
, VMAJOR
, config.inc
)
24 VMINOR
= $(call conf-val
, VMINOR
, config.inc
)
30 ASRC0
+= config.inc macros.inc init.asm dram-refresh.asm timer.asm utils.asm
31 ASRC0
+= mmc.asm mmc-old.asm virt_ports.asm
32 ASRC0
+= dsk_cpm.asm dsk_fat16.asm dsk_fsys.asm dsk_mgr.asm dsk_ram.asm
33 ASRC0
+= 8080int-orig.asm
8080int.asm
8080int-jmp.asm
8080int-t3.asm
8080int-t3-jmp.asm Z80int-jmp.asm
35 ifneq ($(DRAM_8BIT
),0)
36 ASRC0
+= dram-8bit.inc dram-8bit.asm sw-uart.asm i2c.asm
38 ASRC0
+= dram-4bit.inc dram-4bit.asm hw-uart.asm
41 ASRC
= $(ASRC0
) svnrev.inc
42 #ASRC := $(ASRC0) svnrev.inc
44 # Place -D or -U options here
48 CDEFS
+= -DF_CPU
=$(F_CPU
)
51 CDEFS
+= -DDRAM_8BIT
=$(DRAM_8BIT
)
54 CDEFS
+= -DBAUD
=$(BAUD
)
57 CDEFS
+= -DI2C_SUPPORT
=$(I2C_SUPPORT
)
60 CDEFS
+= -DADC_SUPPORT
=$(ADC_SUPPORT
)
63 CDEFS
+= -DEM_Z80
=$(EM_Z80
)
66 CDEFS
+= -DFAT16_SUPPORT
=$(FAT16_SUPPORT
)
69 CDEFS
+= -DCPMDSK_SUPPORT
=$(CPMDSK_SUPPORT
)
72 CDEFS
+= -DMMCBOOTLOADER
=$(MMCBOOTLOADER
)
75 CDEFS
+= -DTESTVERSION
=$(TESTVERSION
)
78 ASPATH
= C
:/Programme
/Atmel
/AVR\ Tools
/AvrAssembler2
79 DEFS
= $(ASPATH
)/Appnotes
81 ifeq "$(OS)" "Windows_NT"
88 ifeq ($(PLATFORM
),Linux
)
92 AS
= $(WINE
) $(ASPATH
)/avrasm2.exe
93 ASFLAGS
= -I
$(DEFS
) $(CDEFS
)
99 HEXTOBIN
= $(OBJCOPY
) -I ihex
-O binary
--gap-fill
0xff
101 #(call conf-val,config-id,config-file)
102 #conf-val = $(shell awk -vID=$(strip $1) '$$0 ~ "^[ \t]*\#define[ \t]+" ID "[ \t]+" {print $$3}' $2 )
103 conf-val
= $(shell awk
-vID
=$(strip $1) '$$1$$2 ~ "\#define"ID {print $$3}' $2)
106 # Programming support using avrdude. Settings and variables.
108 AVRDUDE_PROGRAMMER
= dragon_isp
111 AVRDUDE_WRITE_FLASH
= -U flash
:w
:$(TARGET
).hex
112 AVRDUDE_WRITE_EEPROM
= -U eeprom
:w
:$(TARGET
).eep
115 # Uncomment the following if you want avrdude's erase cycle counter.
116 # Note that this counter needs to be initialized first using -Yn,
117 # see avrdude manual.
118 #AVRDUDE_ERASE_COUNTER = -y
120 # Uncomment the following if you do /not/ wish a verification to be
121 # performed after programming the device.
122 #AVRDUDE_NO_VERIFY = -V
124 # Increase verbosity level. Please use this when submitting bug
125 # reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
126 # to submit bug reports.
127 #AVRDUDE_VERBOSE = -v -v
129 AVRDUDE_BASIC
= -p
$(MCU
) -P
$(AVRDUDE_PORT
) -c
$(AVRDUDE_PROGRAMMER
)
130 AVRDUDE_FLAGS
= $(AVRDUDE_BASIC
) $(AVRDUDE_NO_VERIFY
) $(AVRDUDE_VERBOSE
) $(AVRDUDE_ERASE_COUNTER
)
136 .PHONY
: all bin hex eep lst map program flash eeprom
tags clean
145 bin
: $(TARGET
)-$(VMAJOR
).
$(VMINOR
).bin
148 # Program the device.
149 program
: $(TARGET
).hex
$(TARGET
).eep
150 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_FLASH
) $(AVRDUDE_WRITE_EEPROM
)
153 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_FLASH
)
155 eeprom
: $(TARGET
).hex
$(TARGET
).eep
156 $(AVRDUDE
) $(AVRDUDE_FLAGS
) $(AVRDUDE_WRITE_EEPROM
)
159 $(TARGET
).hex
: $(ASRC
)
160 $(TARGET
).eep
: $(ASRC
)
161 $(TARGET
).lst
: $(ASRC
)
162 $(TARGET
).map
: $(ASRC
)
167 %-$(VMAJOR
).
$(VMINOR
).bin
: %.hex
172 $(AS
) $(ASFLAGS
) -fI
-o
$@
$<
175 @
$(AS
) $(ASFLAGS
) -v0
-f-
-l
$@
$<
178 $(AS
) $(ASFLAGS
) -v0
-f-
-m
$@
$<
184 svnrev
-osvnrev.inc
$^
187 # Target: clean project.
189 $(REMOVE
) $(TARGET
).hex
$(TARGET
).eep
$(TARGET
).obj
$(TARGET
).map
$(TARGET
).lst \
190 $(TARGET
)-$(VMAJOR
).
$(VMINOR
).bin