This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: customizing redboot build


> I want to add a string to the redboot version string (or for that
> matter to my own string), that get changed every time I run make. In
> other systems I did it with a parameter that I passed to make, like
> "make MY_VAR=my_value some_target".
> But in redboot all the Makefiles are auto-generated.
> How do I get around to do that?

See:

packages/redboot/[version]/src/version.c

and

the function do_version() in packages/redboot/[version]/src/main.c

You can easily add whatever you want here statically or at compile time.

eg.
    [...]

    diag_printf("Copyright (C) 2000, 2001, 2002, 2003, 2004 Red Hat,
Inc.\n");
    diag_printf("Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 eCosCentric
Limited\n\n");
    diag_printf("RAM: %p-%p, ", (void*)ram_start, (void*)ram_end);
    diag_printf("[%p-%p]", mem_segments[0].start, mem_segments[0].end);
    diag_printf(" available\n");

    [...]

    diag_printf(MY_ADDTIONAL_CRUFT);

    [...]

gcc [...] -DMY_ADDITIONAL_CRUFT=\""Whatever extra info you wanted\"" main.c

There are a multitude of ways to do this.  You could do it in the CDL files,
etc. -- the choice is left as an exercise for the reader.

--Chris

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]