Subversion Repositories svnkaklik

Rev

Rev 151 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 151 Rev 174
Line 112... Line 112...
112
#LDFLAGS +=  -Wl,-u,vfprintf -lprintf_flt
112
#LDFLAGS +=  -Wl,-u,vfprintf -lprintf_flt
113
#
113
#
114
# -lm = math library
114
# -lm = math library
115
LDFLAGS += -lm
115
LDFLAGS += -lm
116
 
116
 
-
 
117
 
-
 
118
PROGRAMMER_DEVICE = dapa
117
 
119
 
118
 
-
 
-
 
120
PORT = /dev/parport0			# programmer connected to parallel port
119
 
121
 
120
# Programming support using avrdude. Settings and variables.
122
# Programming support using avrdude. Settings and variables.
121
 
123
 
122
# Programming hardware: avrisp stk500 avr910 pavr stk200 pony-stk200
124
# Programming hardware: avrisp stk500 avr910 pavr stk200 pony-stk200
123
#                       dt006 bascom alf
125
#                       dt006 bascom alf
124
# Type: avrdude -c ?
126
# Type: avrdude -c ?
125
# to get a full listing.
127
# to get a full listing.
126
#
128
#
127
AVRDUDE_PROGRAMMER = dapa
-
 
128
 
-
 
129
 
-
 
130
#AVRDUDE_PORT = com1	   	# programmer connected to serial device
-
 
131
AVRDUDE_PORT = /dev/parport0			# programmer connected to parallel port
-
 
132
 
-
 
133
AVRDUDE_ERASE = -e
-
 
134
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
-
 
135
 
-
 
136
 
-
 
137
# Uncomment the following if you want avrdude's erase cycle counter.
129
# Uncomment the following if you want avrdude's erase cycle counter.
138
# Note that this counter needs to be initialized first using -Yn,
130
# Note that this counter needs to be initialized first using -Yn,
139
# see avrdude manual.
131
# see avrdude manual.
140
#AVRDUDE_ERASE += -y
132
#AVRDUDE_ERASE += -y
141
#
133
#
Line 145... Line 137...
145
#
137
#
146
# Increase verbosity level.  Please use this when submitting bug
138
# Increase verbosity level.  Please use this when submitting bug
147
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
139
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
148
# to submit bug reports.
140
# to submit bug reports.
149
#AVRDUDE_FLAGS += -v -v
141
#AVRDUDE_FLAGS += -v -v
150
 
-
 
151
 
142
 
152
 
-
 
153
 
143
 
154
# ---------------------------------------------------------------------------
144
# ---------------------------------------------------------------------------
155
 
145
 
156
# Define directories, if needed.
146
# Define directories, if needed.
157
DIRAVR = c:/winavr
147
DIRAVR = c:/winavr
Line 170... Line 160...
170
OBJDUMP = avr-objdump
160
OBJDUMP = avr-objdump
171
SIZE = avr-size
161
SIZE = avr-size
172
 
162
 
173
 
163
 
174
# Programming support using avrdude.
164
# Programming support using avrdude.
175
AVRDUDE = avrdude
165
#PROGRAMMER = avrdude
-
 
166
# Programming support using uisp.
-
 
167
PROGRAMMER = uisp
176
 
168
 
177
 
169
 
178
REMOVE = rm -f
170
REMOVE = rm -f
179
COPY = cp
171
COPY = cp
180
 
172
 
Line 256... Line 248...
256
 
248
 
257
# Program the device.  The magic trickery below examines the .eep hex
249
# Program the device.  The magic trickery below examines the .eep hex
258
# file whether the size is > 0, and if so, reprograms the EEPROM as
250
# file whether the size is > 0, and if so, reprograms the EEPROM as
259
# well.  Just delete these lines if you don't want this feature (like
251
# well.  Just delete these lines if you don't want this feature (like
260
# on the ATmegas with the EESAVE fuse bit set).
252
# on the ATmegas with the EESAVE fuse bit set).
261
program: $(TARGET).hex $(TARGET).eep
253
program: $(TARGET).hex $(TARGET).eep
262
	$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_ERASE)
254
#	if[ "$(PROGRAMMER)" == "avrdude"]; then \
-
 
255
#	  avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -e # erase AVR device
263
	$(AVRDUDE) $(AVRDUDE_FLAGS) -i $(TARGET).hex
256
#	  avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -i $(TARGET).hex # program AVR device
-
 
257
#	fi; \
264
	@$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \
258
#	@$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \
265
	do \
259
#	do \
266
		set -- $$line; \
260
#		set -- $$line; \
267
		if [ "x$$1" != "x0" ] ; then continue; fi; \
261
#		if [ "x$$1" != "x0" ] ; then continue; fi; \
268
		if [ "$$2" -ne 0 ] ; then \
262
#		if [ "$$2" -ne 0 ] ; then \
269
			echo $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
263
#			echo $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
270
			$(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
264
#			$(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
271
			break; \
265
#			break; \
272
		fi; \
266
#		fi; \
273
	done
267
#	done
274
 
268
 
-
 
269
#	if[$PROGRAMMER == "uisp"]; then 
-
 
270
	   uisp -dlpt=$(PORT) -dpart=$(MCU) -dprog=$(PROGRAMMER_DEVICE) if=$(TARGET).hex --upload
-
 
271
#	fi;
275
 
272
 
276
# Create final output files (.hex, .eep) from ELF output file.
273
# Create final output files (.hex, .eep) from ELF output file.
277
%.hex: %.elf
274
%.hex: %.elf
278
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
275
	$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@
279
 
276