Absolute path names in exported makefiles

General questions regarding the usage of CodeLite
johannes
CodeLite Enthusiast
Posts: 10
Joined: Tue Jul 26, 2011 9:33 am
Genuine User: Yes
IDE Question: c++
Contact:

Absolute path names in exported makefiles

Post by johannes »

Hi,

I want to export a makefile so others can build the project. CodeLite writes absolute paths into the makefile, which makes it useless for this purpose.

How can I make CodeLite write relative path names?
User avatar
eranif
CodeLite Plugin
Posts: 6373
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Absolute path names in exported makefiles

Post by eranif »

johannes wrote:How can I make CodeLite write relative path names?
Settings | Build Settings | Compilers | <your compiler> | File Types

Select the file extension you want to change (e.g. 'cpp')
and change the default pattern (assuming you did not change it) from:

Code: Select all

$(CompilerName) $(SourceSwitch) "$(FileFullPath)" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
into

Code: Select all

$(CompilerName) $(SourceSwitch) "$(FilePath)$(FileFullName)" $(CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
Note:

$(FilePath) is the relative path with a terminating slash
$(FileFullName) - the file name + extension, without any path

Click the 'Help...' button of the 'File Types' page to get the full list of macros available and their meaning

Eran
Make sure you have read the HOW TO POST thread
johannes
CodeLite Enthusiast
Posts: 10
Joined: Tue Jul 26, 2011 9:33 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Absolute path names in exported makefiles

Post by johannes »

Thanks for the quick reply! Will try that.

Btw, any news/thoughts about this yet? I have tried looking into the code myself but I'm not familiar with the wx* nor the CodeLite codebase...
Post Reply