Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative paths for source files issue #25

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments
Open

Relative paths for source files issue #25

GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 3 Jul 2013 at 12:04

@GoogleCodeExporter
Copy link
Author

Issue 26 has been merged into this issue.

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Accepted
  • Added labels: Component-Logic

@GoogleCodeExporter
Copy link
Author

Issue 33 has been merged into this issue.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant