This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Control of Object-Hex Converter from source

hi,
Is it possible to change output .hex filename at preprocessor time, something like:

#define _BOARD_REV_ 1
...

#if (_BOARD_REV_ == 1)
HEX_FILENAME("board_1.hex")
#else
HEX_FILENAME("board_old.hex")
#endif

Which directive should I use for such purposes or is there another way to control OH51 "on the fly"?

Thank you,
Oleg

Parents
  • "I just know that there is a way to alternate *.obj filenames (with OBJECT control)"

    The object file is the compiler's output - so the compiler has control of its name.

    "so why not *.hex?"

    Because it has nothing to do with the compiler.
    once the compiler has generated the object, it has nothing further to do with the process.

    The Linker takes the objects & combines them into an executable image.

    The object-to-hex converter takes the Linker output, and converts that to hex.

    Thus the object-to-hex converter is two stages removed from the Compiler - hence the compiler has no control whatsoever over the name of the generated HEX file!

    The only thing that has an overall "view" of the whole process is uVision (or whatever other build manager you might be using) - so the only way to do it is through uVision; and that's what the Targets facility is for!

Reply
  • "I just know that there is a way to alternate *.obj filenames (with OBJECT control)"

    The object file is the compiler's output - so the compiler has control of its name.

    "so why not *.hex?"

    Because it has nothing to do with the compiler.
    once the compiler has generated the object, it has nothing further to do with the process.

    The Linker takes the objects & combines them into an executable image.

    The object-to-hex converter takes the Linker output, and converts that to hex.

    Thus the object-to-hex converter is two stages removed from the Compiler - hence the compiler has no control whatsoever over the name of the generated HEX file!

    The only thing that has an overall "view" of the whole process is uVision (or whatever other build manager you might be using) - so the only way to do it is through uVision; and that's what the Targets facility is for!

Children
No data