SVN and CW10 directory structure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SVN and CW10 directory structure

2,423 Views
Richly
Contributor III

I'm interested in using SVN (specifically TortoiseSVN) with a CW10 project.

 

I'm trying to figure out what directories and files I should include and exclude.  This problem is made more complex because the new project wizard scatters code files into a complex directory structure, putting some code files into a directory named Lib, others into Project_Headings, and others into Sources, and even some code into Project_Settings\Startup_Code\.

 

For example, I thought I should include the Project_Settings directory in the SVN repository, but some files (such as  *.launch files) include absolute paths to programs.  This is particularly troubling across machines: e.g., an XP installation will put programs into ...\Program Files\... while a 64-bit Windows 7 installation will have these same programs in ...\Program Files (x86)\..., so you can't simply check out the Project_Settings on two different machines and expect things to work.  I believe this same problem occurs for some other files besides the *.launch files, but I'm not sure.

 

I know that CW10 has CVS built in, but I switched to SVN years ago.  Does anyone know what files CW10 saves and which it ignores under CVS?  Does it work correctly when the files are checked out on different operating systems?  Does it save only code or also settings and parameters?

 

Can the File|Export facility help here?

 

Thanks,

    Richly

Labels (1)
0 Kudos
8 Replies

671 Views
CrasyCat
Specialist III

Hello

 

I assume you are using CodeWarrior MCU V10.x.

Am I correct?

 

In your version control software you need to check in all application source and header files.

I would also recommend checking the files within Lib, Project_Headers and Project_Settings folders as well as the files .project and .cproject located in your project directory.

 

If you are using processorExpert, you need to check as well the files ProcessorExpert.* and .processorExpert and the content of Generated Code.

 

Now around absolute paths, the .launch, .project or .cproject files will contain absolute paths if you specified absolute paths in the project properties panel or in the Debug Configuration.

Make sure to use only relative paths in there and you should be safe.

 

CrasyCat

0 Kudos

671 Views
Richly
Contributor III

Hi CrasyCat,

 

Yes, I am using CodeWarrior 10.0.

 

As for the paths, I just accepted all the defaults while setting up the project.  Perhaps those were absolute.  It's not clear to me that using relative paths would make sense, since the location of the IDE isn't generally something that's relative to the project, and that's the location that caused my trouble.

 

What I have done -- and this appears to work -- is a good old-fashioned hack: I created the directory "C:\Program Files (x86)" on each of my machines that has a 32-bit version of Windows, either XP or 7, and I installed CW into that directory.  Since CW is a 32-bit program, I don't think it'd work if I tried to do this in reverse and put CW into "C:\Program Files" instead of "C:\Program Files (x86)" on a 64-bit Windows 7 machine.

 

The project is also placed in the same directory (something like "C:\development\CW10\project1") on all machines.

 

Having CW and the project located along the identical paths on all machines allows me to put the project's entire directory structure under version control, thus capturing all the header files and settings.  Of course, I've set SVN to ignore .obj files and the like.

 

Thanks,

    Richly

0 Kudos

671 Views
CrasyCat
Specialist III

Hello

 

THere are some build in variables you can refer to in order to define relative paths in your project.

    ${MCUToolsBaseDir} refers to your CodeWarrior installation

    ${ProjDirPath} refers to your project directory.

 

To check how these variables can be used:

   - Open Project Properties

   - Go to "C/C++ Build" > "Settings" page

   - Change to "HCS08 Compiler" > Input panel and check how the various paths are defined.

 

CrasyCat

0 Kudos

671 Views
Richly
Contributor III

Hi CrasyCat,

 

It's not clear to me that there's anything I can do with these ${} variables for this problem.  In particular, the launch file, project1_MC9S08SH16_PnE USB BDM.launch has a string attribute very near the end with the key "org.eclipse.debug.core.source_locator_memento" and the explicit full path to part of the IDE, i.e., C:\Program Files (x86)\Freescale\CW MCU v10.0\MCU\lib\hc08c\src as part of its value.  If I keep the project settings directory under source control, this file with this value ends up as part of it.  If two different machines have two different paths for the IDE, each time one of them checks in its files, it causes problems for the other.  Similarly, all the .args files in the source directory have the full path to the IDE in them.  I can't be sure, but I think the .launch files and the .args files should be kept under source control, to keep up with whatever choices are current.

 

I guess one solution would be for the crew maintaining CW10 to change the software that creates the .launch files and the .args files to store the relevant variables instead of their expanded values (and then expand them when the files are used).  But this is out of my hands.

 

Cheers,

    Richard

0 Kudos

671 Views
dhlocker
Contributor III
We are attempting to do a similar thing (using Mercurial, FWIW) but the issues are the same. Is there a "roadmap" of what files are created from which files and processes as a build commences? I understand Makefiles; is that perhaps the best source of information? At which point in the processes do the environment variables get expanded? pointers to TFMs appreciated. I am starting with a fresh install of MQX-3.6.2, and using CodeWarrior 10 and trying to capture all that is needed for my small team to effectively share their developments. So far, it's been painful. My most successful effort to date used a step-by-step import from the "classic" codewarrior project for the bsp (I'm doing this step-at-a-time so I don't waste too much time going down unsuitable paths), which everyone else can build on their machines. The psp import leaves the assembler without a path to the asm_mac.h (in mqx/source/include), though, and I don't want to archive it until it is buildable. Donald.
0 Kudos

671 Views
CrasyCat
Specialist III

Hello

 

Basically from a CodeWarrior stand point and if you are using a project created by the wizard, all files generated during the build process are created in the build directory.

 

The full path to the build directory is specified in Project Properties dialog as Build Directory in the C/C++ Build page.

 

First the files makefile and *.mk are created,

.d files are created then when the make file parses the *.mk file. The .d files describe the dependency for a specific source file

.args files are created after that and contains the command line arguments used to build each source file.

 

When building starts, the *.eln, *.sl, *.s1 files are created when a source file is compiled

The .eld or .elb is created when the application is linked or when the library is created.

 

CrasyCat

0 Kudos

671 Views
dhlocker
Contributor III

Moving offices and being in the field is _very_ disruptive.

 

Thank you for the overview.  This and a reply from another correspondent and a few hours of hacking got me back on track.

 

Donald.

0 Kudos

671 Views
J2MEJediMaster
Specialist I

You can file a feature request to point this out to the engineers. Click here to file an online service request. For Category pick Software Support and for Topic pick CodeWarrior. On the page that follows, select feature request.

 

---Tom

0 Kudos