About the order of variable defination in makefile

General questions regarding the usage of CodeLite
coolgle
CodeLite Curious
Posts: 6
Joined: Sat Jan 23, 2010 8:02 pm
Genuine User: Yes
IDE Question: c++
Contact:

About the order of variable defination in makefile

Post by coolgle »

In CodeLite's auto generated makefile, e.g:
IntermediateDirectory := ../out/debug
OutDir := $(IntermediateDirectory)
WorkspacePath := "E:\test_suit\config_test"
ProjectPath := "E:\test_suit\config_test"
The IntermediateDirectory and OutDir are always defined before WorkspacePath and ProjectPath

But I want to set the IntermediateDirectory and OutDir relative to the WorkspacePath or ProjectPath,such as:
IntermediateDirectory:=$(WorkspacePath)/out/debug
OutDir:=$(WorkspacePath)/bin
How can I do that ?

BTW: Can I specify an included file for the auto generated makefile ?

Thanks
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: About the order of variable defination in makefile

Post by eranif »

Simply set the intermediate directory to:

./Debug it is equal to $(ProjectPath)/Debug

Eran
Make sure you have read the HOW TO POST thread
coolgle
CodeLite Curious
Posts: 6
Joined: Sat Jan 23, 2010 8:02 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: About the order of variable defination in makefile

Post by coolgle »

eranif wrote:Simply set the intermediate directory to:

./Debug it is equal to $(ProjectPath)/Debug

Eran
But all the *.o and *.o.d are put into "src/debug" (the "src" directory is where my source files lie on), and the "$(ProjectPath)/Debug" directory is actual empty :cry:

Well, maybe I should write my own makefile and use custom build....
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: About the order of variable defination in makefile

Post by eranif »

eranif wrote:But all the *.o and *.o.d are put into "src/debug"
Indeed, I forgot about that. There is a good reason for this:
If your project contains 2 files with the same name (e.g. file.cpp) by using your approach you wont be able to link the project. But when using the current implementation, codelite allows you to link to files with the same name.

However: what is the problem that you are trying to solve?

Eran
Make sure you have read the HOW TO POST thread
coolgle
CodeLite Curious
Posts: 6
Joined: Sat Jan 23, 2010 8:02 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: About the order of variable defination in makefile

Post by coolgle »

eranif wrote: However: what is the problem that you are trying to solve?
I don't want to mess my source files with the intermediate files or ouput files
User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: About the order of variable defination in makefile

Post by Jarod42 »

eranif wrote:However: what is the problem that you are trying to solve?
I have two different problems to solve :

- I use Premake4 to generate project and workspace by a simple regex "src/**.*"
I don't want to have obj file in my auto-generated project

- I have code in a (small) external device and I don't want intermediate files to be in It,
I would like to have those files in a temp directory in hard drive.
Post Reply