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 CCS Technical Support

Can I #export hex files to a subfolder?

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



Joined: 18 Jun 2014
Posts: 13

View user's profile Send private message

Can I #export hex files to a subfolder?
PostPosted: Thu Jan 22, 2015 12:26 am     Reply with quote

I am building a project that will encompass multiple products. Each product has similar functions but different MCU settings. Therefore I have one project with multiple includes. Each product requires a separate HEX file for operation.

I am including the files from a subfolder using the following structure:

#include <subfolder\Strong\MCU_settings_1234.h>
#include <subfolder\Weak\MCU_settings_ABCD.h>

I would like to export the HEX files into the same directories as the include files. I understand that I can do this by changing the project options but I don't want to include the .lst .sta etc. files with the HEX file nor do I want to change the project options for each build. So for now I am moving the files manually but I would like an option to be able to declare the subfolders in which to relocate the HEX files. Here is the command that I am using:

#export (HEX, FILE = "1234.hex")

Here is the command that I would like to use:

#export (HEX, FILE = "subfolder\Strong\1234.hex")

I would like it to be relative to the project directory. I don't want to begin with c:\PICC\etc.... Can anyone help me? Is there an easy built-in function that will allow me to do this? So far all of my efforts keep the HEX file in the same directory as the project.

Compiler = 5.035
PIC = 16F1947
Windows 7 if that helps
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Jan 22, 2015 1:44 am     Reply with quote

The standard way in any language to do this, would be to use:

(HEX, FILE = ".\subfolder\Strong\1234.hex")

Haven't tried it. What happens if you use this?.

'.' is a shortcut for 'the current working directory'

Might work.
AdamWebber



Joined: 18 Jun 2014
Posts: 13

View user's profile Send private message

PostPosted: Thu Jan 22, 2015 8:30 am     Reply with quote

That is a great suggestion. Sadly it did not work. I tried:

(HEX, FILE = ".\subfolder\Strong\1234.hex")

AND

(HEX, FILE = ".subfolder\Strong\1234.hex")

The HEX file still remains in the project directory.

Maybe this is just a compiler thing that I should approach the developers about. If I can include files from subfolders, I should be able to export files to subfolders.
Ttelmah



Joined: 11 Mar 2010
Posts: 19515

View user's profile Send private message

PostPosted: Thu Jan 22, 2015 8:53 am     Reply with quote

If you look at the manual, #export, only accepts a filename, not a path. It exports to the current working directory, which is settable, but then everything will go there.
I'd write a tiny batch file to move all files ending with .o (assuming you are exporting as relocatable objects), to your target directory, and either just run this, or include it after the compile if you are using a batch file for the build.
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