MacSummer / make-it-so

Automatically exported from code.google.com/p/make-it-so
1 stars 0 forks source link

Relative paths for source files issue #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

If you have separated Visual Studio's project and source files into different 
folders the object and definition files will not be generated with valid names.

Example) Say source is located "../src/foobar.c"

the generated make file will try to output "gccDebug/../src/foobar.o" which 
does not work.

Quick fix I did for this is by modifying the MakeItSo source in 
MakefileBuilder_Project_CPP.cs (I'm using a C framework) and stripping the 
relative path component from the target files by:

foreach (string filename in m_projectInfo.getFiles())
{
    var fileNameOnly = Path.GetFileName(filename);
    string path = String.Format("{0}/{1}", intermediateFolder, fileNameOnly);
    string objectPath = Path.ChangeExtension(path, ".o");
...

and further down

foreach (string filename in m_projectInfo.getFiles())
{
    // We work out the filename, the object filename and the 
    // dependencies filename...
    var fileNameOnly = Path.GetFileName(filename);
    string path = String.Format("{0}/{1}", intermediateFolder, fileNameOnly);
    string objectPath = Path.ChangeExtension(path, ".o");
    string dependenciesPath = Path.ChangeExtension(path, ".d");
...

Original issue reported on code.google.com by stahlber...@gmail.com on 3 Jul 2013 at 12:04

GoogleCodeExporter commented 9 years ago
Issue 26 has been merged into this issue.

Original comment by florian.sainjeon on 28 Nov 2013 at 8:32

GoogleCodeExporter commented 9 years ago
Hi Christian. 

I did reproduce the problem and I think it's the same issue I encountered in 
early October (see the merged issue). I did the modifications but I don't think 
it has the expected behavior.

Your fix changes the output directory even when a TargetName is given (which I 
normal, since it's been added after you posted your issue). I will have a look 
at it today, stay tuned.

Original comment by florian.sainjeon on 28 Nov 2013 at 9:01

GoogleCodeExporter commented 9 years ago
Issue 33 has been merged into this issue.

Original comment by florian.sainjeon on 18 Dec 2013 at 9:45