[Top][All Lists]

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

Re: [avr-gcc-list] Suggestion

From: Ned Konz
Subject: Re: [avr-gcc-list] Suggestion
Date: Mon, 1 May 2006 06:38:13 -0700

On Apr 29, 2006, at 11:59 PM, Royce Pereira wrote:

I am using besides AVR-GCC, SDCC(freeware mcs51 compiler). The latter generates the following lines at the start of every output, which I find very useful - the date & time actually:

1 ;--------------------------------------------------------
                 2 ; File Created by SDCC : FreeWare ANSI-C Compiler
                 3 ; Version 2.5.4 #1145 (Nov  4 2005)
                 4 ; This file generated Sun Apr 30 12:19:30 2006
5 ;--------------------------------------------------------

Can I get the same in my AVR-GCC .lst, .lss etc output files thru my makefile ?

Sure... just postprocess the files to add a header.

Attached is a Perl script that adds such a header.

Run it with Perl's -i flag (as shown below) if you use an operating system that for some reason does not allow you to run arbitrary scripts using the shebang (#!) mechanism. Otherwise, just mark it as executable and remove the "perl -i" from the examples below.

Of course, I don't know what your Makefile looks like,
but here's some examples of how you can use the script in your Makefile.

You can run it after you generate each of the output files:

%.o: %.c
        avr-gcc -g -Wa,-ahlds=$*.lst -o $@ -c $<
        perl -i timeStampHeader $*.lst

Or you can run it after you generate all the output files:

all: $(PRG).elf
        perl -i timeStampHeader $*.lst $*.lss

Or you can use it as part of a pipeline:

%.lss: %.elf
        avr-objdump -S $< | perl -i timeStampHeader > $@

Ned Konz
MetaMagix embedded consulting

Attachment: timestampHeader
Description: Binary data

reply via email to

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