View previous topic :: View next topic |
Author |
Message |
AdamWebber
Joined: 18 Jun 2014 Posts: 13
|
Can I #export hex files to a subfolder? |
Posted: Thu Jan 22, 2015 12:26 am |
|
|
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: 19537
|
|
Posted: Thu Jan 22, 2015 1:44 am |
|
|
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
|
|
Posted: Thu Jan 22, 2015 8:30 am |
|
|
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: 19537
|
|
Posted: Thu Jan 22, 2015 8:53 am |
|
|
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. |
|
|
|