CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Any way to change output HEX file name?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dbotkin



Joined: 08 Sep 2003
Posts: 197
Location: Omaha NE USA

View user's profile Send private message Send e-mail Visit poster's website

Any way to change output HEX file name?
PostPosted: Thu Aug 21, 2014 2:45 pm     Reply with quote

I have a common source code file that I use for two different products. I use #if/#endif to make whatever changes are needed due to hardware differences, but the base firmware functions the same on both.

There seems to be no way to get foo.c to compile to anything other than foo.hex. I'd like to end up with either foo-big.hex or foo-small.hex, depending on a #define. I don't see a way to do it, am I missing something?
stinky



Joined: 05 Mar 2012
Posts: 99
Location: Central Illinois

View user's profile Send private message

PostPosted: Thu Aug 21, 2014 3:38 pm     Reply with quote

For lack of a better term I use a "wrapper" file. It's name could be foo_small.c and another one that is foo_big.c.

Each of these files includes the same set of code but might have slightly different compile options through the use of #define BLAH

When I build the file, the hex file output matches the wrapper files name.
dbotkin



Joined: 08 Sep 2003
Posts: 197
Location: Omaha NE USA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Aug 21, 2014 10:47 pm     Reply with quote

Awesome idea -- thanks. That will work.
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Fri Aug 22, 2014 1:35 am     Reply with quote

stinky wrote:
For lack of a better term I use a "wrapper" file. It's name could be foo_small.c and another one that is foo_big.c.


I use wrappers too. But I'm forced by company policy to use non-intuitive part numbers for hex filenames, and far prefer to use descriptive text names for my wrappers and other files. So I use #export that allows you to specify the hex filename within the code:

e.g. in wrapper.c:

Code:

#ifdef SMALL
    #export (HEX, FILE = "Z34521.hex")
#else
    #export (HEX, FILE = "Z76543.hex")
#endif


I also now use a new feature in V5.26 (may have been in 5.25 as well, but not before and definitely not in any V4.nnn) of placing the output files, including the hex in a separate directory. This helps in organising for source version control and the like.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group