Hot!XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE

Author
binaryman
Super Member
  • Total Posts : 191
  • Reward points : 0
  • Joined: 2015/11/19 17:11:04
  • Location: Saint Louis, Missouri USA
  • Status: offline
2017/10/18 07:51:35 (permalink)
0

XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE

MPLAB-X
XC8 COMPILER
 
This is a compiler and/or IDE configuration question for XC8  projects. 
 
It may need to be posted somewhere else
 
The MBLAB-X hex file name.  The default is same name as the MPLAB-X project name.  comparing MBLAB-X and XC8 to another vendor ... SILABS tools - I use an SI LABS ember compiler for something else and it allows variants in the project file
You go right into project options and set the current compile to a particular variant and then it also
allows you to force set the output file name to be something f
 
But is there a way to set the hex file name with C language conditional compilation ?
 
Or in the project configuration but with some syntax that tests of a C define conditional is true ?
 
Other engineers will be setting variant switches in a master header file and it would be best if I could
make something foolproof that forces the file name to be something if a particular variant was activated via conditional compile. 
 
Dan
 
#1

4 Replies Related Threads

    rodims
    Super Member
    • Total Posts : 1312
    • Reward points : 0
    • Joined: 2009/02/10 11:08:59
    • Location: 51.9627, 7.6262
    • Status: offline
    Re: XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE 2017/10/18 09:05:31 (permalink)
    +2 (2)
    I don't think there is a direct way.
    I myself create different hex file names in MPLabX depending on the used configuration (name).
    The method is to copy the default hex file into my "firmware folder" and renaming it during the copy.
    The new name reflects the configuration.
    If your "other engineers" also use MpLabX to build the hex file then they could choose "their" configuration instead of editing a master header file (?). Of course this may not be suitable for your workflow.
     
    This post first describes my approach to do the copy directly from the post-processing. 
    http://www.microchip.com/forums/m1008614.aspx
    The OP finally chooses to call a batch file from the post-processing, which allows more "sophistic" processing.
     
     
     
    #2
    Jim Nickerson
    User 452 _
    • Total Posts : 4841
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE 2017/10/18 09:06:14 (permalink)
    +2 (2)
    In Building, execute after build I run a batch file to copy/rename the hex
    edit rodims beat me to it
    post edited by Jim Nickerson - 2017/10/18 09:07:18
    #3
    edware
    New Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2009/01/04 22:41:19
    • Location: 0
    • Status: offline
    Re: XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE 2018/03/06 22:39:30 (permalink)
    0
    You can use a postbuild copy command (cp) in MPLABX IDE
     
    I use this to copy and rename my hex files to a common directory - see attachment.
     
    Cheers
    Ed
    post edited by edware - 2018/03/06 22:49:30

    Attached Image(s)

    #4
    DarioG
    Allmächtig.
    • Total Posts : 53793
    • Reward points : 0
    • Joined: 2006/02/25 08:58:22
    • Location: Oesterreich
    • Status: offline
    Re: XC8 SET HEX FILE NAME VIA CONDITIONAL COMPILE 2018/03/08 04:33:16 (permalink)
    +2 (2)
    Gary Seven may not be listening to this thread by now grin

    quando a trump ci prende il CANCRAZZO è sempre troppo tardi.
    #5
    Jump to:
    © 2018 APG vNext Commercial Version 4.5