










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











uisp -dprog=stk200 -dpart=atmega128 -dlpt=/dev/parport0 –-erase –upload if=mycode.hex
avr-gcc -g -c -Wall -O2 -mmcu=atmega128 -o mycode.o mycode.c avr-objcopy -j .text -j .data -O -ihex mycode.elf mycode.hex
#a simple make file for sr.c PRG = sr all: $(PRG).elf sr.o : sr.c avr-gcc -g -c -Wall -O2 -mmcu=atmega128 -o sr.o sr.c sr.elf : sr.o avr-gcc -g -Wall -O2 -mmcu=atmega128 -Wl,-Map,$(PRG).map -o sr.elf sr.o sr.hex : sr.elf avr-objcopy -j .text -j .data -O ihex sr.elf sr.hex program : $(PRG).hex uisp -dprog=stk200 -dpart=atmega128 -dlpt=/dev/parport0 --erase --upload if=sr.hex lst : $(PRG).lst sr.lst : sr.elf avr-objdump -h -S sr.elf > sr.lst clean : rm -rf *.o *.elf *.hex *.lst *.map a phony target dependancy with no command
PRG = sr OBJ = $(PRG).o MCU_TARGET = atmega OPTIMIZE = -O0 # options are 1, 2, 3, s OBJCOPY = avr-objcopy OBJDUMP = avr-objdump CC = avr-gcc override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) override LDFLAGS = -Wl,-Map,$(PRG).map #The automatic variables make recognizes:
all: $(PRG).elf lst text eeprom #######################################################################
#######################################################################
lst: $(PRG).lst %.lst: %.elf $(OBJDUMP) -h -S $< > $@ ############################################################
############################################################
############################################################ text: hex bin srec hex: $(PRG).hex bin: $(PRG).bin srec: $(PRG).srec %.hex: %.elf $(OBJCOPY) -j .text -j .data -O ihex $< $@ ##########################################################
########################################################## %.srec: %.elf $(OBJCOPY) -j .text -j .data -O srec $< $@ #Make the Motorola S-record file %.hex: %.elf $(OBJCOPY) -j .text -j .data -O binary $< $@ #Make a binary imagae also