Subversion Repositories svnkaklik

Compare Revisions

Ignore whitespace Rev 173 → Rev 174

/programy/Atmel_C/AVRcam/makefile
114,9 → 114,11
# -lm = math library
LDFLAGS += -lm
 
 
PROGRAMMER_DEVICE = dapa
 
PORT = /dev/parport0 # programmer connected to parallel port
 
 
# Programming support using avrdude. Settings and variables.
 
# Programming hardware: avrisp stk500 avr910 pavr stk200 pony-stk200
124,16 → 126,6
# Type: avrdude -c ?
# to get a full listing.
#
AVRDUDE_PROGRAMMER = dapa
 
 
#AVRDUDE_PORT = com1 # programmer connected to serial device
AVRDUDE_PORT = /dev/parport0 # programmer connected to parallel port
 
AVRDUDE_ERASE = -e
AVRDUDE_FLAGS = -p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER)
 
 
# Uncomment the following if you want avrdude's erase cycle counter.
# Note that this counter needs to be initialized first using -Yn,
# see avrdude manual.
147,10 → 139,8
# reports about avrdude. See <http://savannah.nongnu.org/projects/avrdude>
# to submit bug reports.
#AVRDUDE_FLAGS += -v -v
 
 
 
 
 
# ---------------------------------------------------------------------------
 
# Define directories, if needed.
172,7 → 162,9
 
 
# Programming support using avrdude.
AVRDUDE = avrdude
#PROGRAMMER = avrdude
# Programming support using uisp.
PROGRAMMER = uisp
 
 
REMOVE = rm -f
258,21 → 250,26
# file whether the size is > 0, and if so, reprograms the EEPROM as
# well. Just delete these lines if you don't want this feature (like
# on the ATmegas with the EESAVE fuse bit set).
program: $(TARGET).hex $(TARGET).eep
$(AVRDUDE) $(AVRDUDE_FLAGS) $(AVRDUDE_ERASE)
$(AVRDUDE) $(AVRDUDE_FLAGS) -i $(TARGET).hex
@$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \
do \
set -- $$line; \
if [ "x$$1" != "x0" ] ; then continue; fi; \
if [ "$$2" -ne 0 ] ; then \
echo $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
$(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
break; \
fi; \
done
program: $(TARGET).hex $(TARGET).eep
# if[ "$(PROGRAMMER)" == "avrdude"]; then \
# avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -e # erase AVR device
# avrdude -p $(MCU) -P $(PORT) -c $(PROGRAMMER_DEVICE) -i $(TARGET).hex # program AVR device
# fi; \
# @$(SIZE) --target=$(FORMAT) $(TARGET).eep | while read line; \
# do \
# set -- $$line; \
# if [ "x$$1" != "x0" ] ; then continue; fi; \
# if [ "$$2" -ne 0 ] ; then \
# echo $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
# $(AVRDUDE) $(AVRDUDE_FLAGS) -m eeprom -i $(TARGET).eep; \
# break; \
# fi; \
# done
 
# if[$PROGRAMMER == "uisp"]; then
uisp -dlpt=$(PORT) -dpart=$(MCU) -dprog=$(PROGRAMMER_DEVICE) if=$(TARGET).hex --upload
# fi;
 
 
# Create final output files (.hex, .eep) from ELF output file.
%.hex: %.elf
$(OBJCOPY) -O $(FORMAT) -R .eeprom $< $@