Page 1 of 1
About the order of variable defination in makefile
Posted: Sun Jan 24, 2010 1:16 pm
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
Re: About the order of variable defination in makefile
Posted: Sun Jan 24, 2010 2:04 pm
by eranif
Simply set the intermediate directory to:
./Debug it is equal to $(ProjectPath)/Debug
Eran
Re: About the order of variable defination in makefile
Posted: Sun Jan 24, 2010 2:32 pm
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
Well, maybe I should write my own makefile and use custom build....
Re: About the order of variable defination in makefile
Posted: Sun Jan 24, 2010 3:09 pm
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
Re: About the order of variable defination in makefile
Posted: Sun Jan 24, 2010 4:01 pm
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
Re: About the order of variable defination in makefile
Posted: Wed Feb 17, 2010 6:05 pm
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.