Subversion Repositories Projects

Rev

Rev 234 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
234 dhylands 1
###########################################################################
2
#
3
#	mkRules-avr.mk
4
#
5
#	This file contains rules for building under WinAVR
6
#
7
###########################################################################
8
 
9
#MK_PRINT_ELF_SIZE = avr-size --mcu=$(MK_AVR_MCU_LONG) $@
10
MK_PRINT_ELF_SIZE = avr-size $@
11
 
12
include $(MK_RULES_DIR)/mkRules-gcc.mk
13
 
14
ifneq ($(MK_HEX_TARGET),)
15
 
295 dhylands 16
download d : mkdir_bin mkdir_obj pgm
234 dhylands 17
 
295 dhylands 18
pgm: $(call MK_HEX_NAME, $(MK_HEX_TARGET))
234 dhylands 19
	$(ECHO) "Downloading $< ..."
20
	$(MK_$(MK_AVR_PROGRAMMER)_CMD)
21
 
22
MK_AVR_FUSES = $(MK_AVR_FUSES_$(MK_AVR_MCU))
23
 
24
fuses:
25
ifeq ($(MK_AVR_FUSES),)
26
	$(error Need to set MK_AVR_FUSES_$(MK_AVR_MCU))
27
else
28
	$(ECHO) "Programming fuses to $(MK_AVR_FUSES) ..."
29
ifeq ($(MK_$(MK_AVR_PROGRAMMER)_CMD_FUSE),)
30
	$(error Programmer $(MK_AVR_PROGRAMMER) doesn't support programming fuses)
31
endif
32
	$(MK_$(MK_AVR_PROGRAMMER)_CMD_FUSE)
33
endif
34
 
35
read-fuses:
36
	$(ECHO) "Reading fuses ..."
37
ifeq ($(MK_$(MK_AVR_PROGRAMMER)_RD_FUSE),)
38
	$(error Programmer $(MK_AVR_PROGRAMMER) doesn't support reading fuses)
39
endif
40
	$(MK_$(MK_AVR_PROGRAMMER)_RD_FUSE)
41
 
295 dhylands 42
read-flash:
43
	$(ECHO) "Reading flash ..."
44
ifeq ($(MK_$(MK_AVR_PROGRAMMER)_RD_PGM),)
45
	$(error Programmer $(MK_AVR_PROGRAMMER) doesn't support reading program)
46
endif
47
	$(MK_$(MK_AVR_PROGRAMMER)_RD_PGM)
48
 
49
read-eeprom:
50
	$(ECHO) "Reading eeprom ..."
51
ifeq ($(MK_$(MK_AVR_PROGRAMMER)_RD_EEPROM),)
52
	$(error Programmer $(MK_AVR_PROGRAMMER) doesn't support reading eeprom)
53
endif
54
	$(MK_$(MK_AVR_PROGRAMMER)_RD_EEPROM)
55
 
234 dhylands 56
.PHONY: download d d_target fuses
57
 
58
endif
59
 
60
mon:
61
	$(ECHO) "Launching BootHost ..."
62
	$(Q)$(MK_BootHost) $(MK_BootHost_OPTS)
63
 
64
.PHONY: mon
65