avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Snapshots etc


From: J Wunsch
Subject: Re: [avr-gcc-list] Snapshots etc
Date: Fri Jan 12 02:08:07 2001

Dale Seaburg <address@hidden> wrote:

I don't use STK200, but a rather simple `programmer' that's merely
just a cable from the parallel port, plus a programming software a
fellow FreeBSD programmer wrote.  So no help possible on the
programmer's part, although i think you should be able to use the UISP
programmer for the STK200.  You can find it on www1.itnet.pl as well.

> What software does everyone use to convert the avr-ld output to .hex
> and then download to the target?  Or, is a conversion to .hex
> needed?

I'm using the following generic Makefile in my AVR project directory.
Suppose you've got a file named `foo.c' containing the source code,
you can do the following with it:

make foo.s  --  will compile the C code into an assembler file,
                mainly for code review purposes

make foo.bin -- will compile the C code into an ELF file foo.out first,
                then convert it into a raw binary download file foo.bin

make foo.hex -- will compile the C code into an ELF file foo.out first,
                then convert it into an Intel hex file foo.hex

make foo.srec -- will compile the C code into an ELF file foo.out first,
                 then convert it into a Motorola S-record file foo.srec

make clean -- will remove all the intermediate files; caution, it'll
              also clean out .s files!, if you have valuable assembler
              source files in that directory, better name them ending
              in .S (which means an assembler file to be piped through
              the C preprocessor, avr-gcc should know this from the .S
              suffix already)

(`make all' is provided as a no-op.  If you remove those couple of
lines, just calling `make' would default to `make clean', which is
probably not what you want. ;-)

CC= avr-gcc
CFLAGS= -O2 -Wall -mmcu=at90s2333

..SUFFIXES: .s .bin .out .hex .srec

..c.s:
        $(CC) $(CFLAGS) -S $<

..o.out:
        $(CC) $(CFLAGS) -o $@ $<

..out.bin:
        avr-objcopy -O binary $< $@

..out.hex:
        avr-objcopy -O ihex $< $@

..out.srec:
        avr-objcopy -O srec $< $@

all:
        @echo "Cannot make \`all' here."

clean:
        rm -f *~ *.out *.bin *.hex *.srec *.s *.o

-- 
J"org Wunsch                                           Unix support engineer
address@hidden         http://www.interface-systems.de/~j



reply via email to

[Prev in Thread] Current Thread [Next in Thread]