We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
"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!