Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Pathnames in Makefiles(Parameterizing Pathname in Makefiles)
Pathnames in Makefiles [message #891887] Tue, 26 June 2012 12:41 Go to next message
David Braun is currently offline David BraunFriend
Messages: 4
Registered: June 2012
Junior Member
I'm trying to figure out how to convince Eclipse/CDT to create "location independent" makefiles. No matter what I've tried it insists on fully resolving pathnames and storing that in the makefiles it generates. These are updated somewhere at the beginning of the Build process so building from withing Eclipse isn't a problem. Problems occur when I try to build using make in a shell script in a copy of the workspace in a different directory. Since all the variables in the path definitions have been expanded the make files only work in one place.

Sorry if this has been covered before but I spent all afternoon yesterday scanning the forum for clues. I'm probably not using the right terminology. I can't imagine I'm the first to ask this question.
Re: Pathnames in Makefiles [message #892021 is a reply to message #891887] Tue, 26 June 2012 20:46 Go to previous messageGo to next message
Klaus km is currently offline Klaus kmFriend
Messages: 142
Registered: November 2011
Senior Member
You know Google?

I found these links, hope it helps:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=258277
https://bugs.eclipse.org/bugs/show_bug.cgi?id=243170
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323011
http://stackoverflow.com/questions/3997152/getting-eclipse-cdt-to-use-relative-include-paths-in-generated-makefiles

regards,
Klaus


[Updated on: Tue, 26 June 2012 20:48]

Report message to a moderator

Re: Pathnames in Makefiles [message #892246 is a reply to message #892021] Wed, 27 June 2012 13:39 Go to previous message
David Braun is currently offline David BraunFriend
Messages: 4
Registered: June 2012
Junior Member
Thanks! But ...
The first 3 bugs are all concerned with relative/absolute pathname issues and don't really help much.
The last was so close that I was drooling! But the solution was to go back to relative paths. Rats.

What I think I want to do (I can be re-educated) is to set things up so CDT uses variable names in it's makefiles instead of substituting the expanded values. That way the Makefiles generated are parameterized. So instead of generating

... -I"/home/dave/workspace/CoolApp/source/MagicInterface" ...

it would generate something like
PROJECT = CoolApp
WORKSPACE_LOC = /home/dave/workspace
PROJECT_LOC = $(WORKSPACE_LOC)/$(PROJECT)
.
.
... -I"$(PROJECT_LOC)/source/MagicInterface"

or something. I tried unchecking the "Expand Env. Variables in Makefiles" check box but it didn't seem to help
Previous Topic:Variables in Compiler arguments field of Discovery options
Next Topic:Problem Occurred Dialog when debugging
Goto Forum:
  


Current Time: Fri Apr 26 10:41:34 GMT 2024

Powered by FUDForum. Page generated in 0.03539 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top