debug 2 Codelite instances unnecessary rebuild step

General questions regarding the usage of CodeLite
slorents
CodeLite Curious
Posts: 5
Joined: Wed Jun 25, 2014 4:44 am
Genuine User: Yes
IDE Question: C++
Contact:

debug 2 Codelite instances unnecessary rebuild step

Post by slorents »

Hello!

Debug 2 instances of same application (2 different workspaces):
- common sources
- common intermediate directory (Debug)
- different output exec files (in different directories)

Change a source file, rebuild 1 project - ok.
Rebuild 2 project - ok.

After that I would expect that no rebuild needed while I am not change the source files... but F7 in 1 project start rebuild output file (exec).
In addition after rebuild 1 project, F7 in 2 project also start rebuild. So to start debugging 2 projects I always need 2 unnecessary rebuilds :(

Problem is in Makefile rule:

Code: Select all

$(OutputFile): $(IntermediateDirectory)/.d $(Objects) 
	@$(MakeDirCommand) $(@D)
	@echo "" > $(IntermediateDirectory)/.d
	@echo $(Objects0)  > $(ObjectsFileList)
	@echo $(Objects1) >> $(ObjectsFileList)
	$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)
This command create new ".d" file, that enforce OutputFile rebuild:

Code: Select all

@echo "" > $(IntermediateDirectory)/.d

Is there option in Codelite to disable this command in Makefile?

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

Re: debug 2 Codelite instances unnecessary rebuild step

Post by eranif »

Can you upload a zip file with a minimal workspaces that sermons traces the problem?
Thanks,
Eran
Make sure you have read the HOW TO POST thread
slorents
CodeLite Curious
Posts: 5
Joined: Wed Jun 25, 2014 4:44 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug 2 Codelite instances unnecessary rebuild step

Post by slorents »

I changed makefile.
Before:

Code: Select all

@echo "" > $(IntermediateDirectory)/.d
After:

Code: Select all

@test -e $(IntermediateDirectory)/.d || echo "" > $(IntermediateDirectory)/.d
It work under linux.

builder_gnumake.cpp: 1022

Code: Select all

void
BuilderGnuMake::CreateTargets(const wxString& type, BuildConfigPtr bldConf, wxString& text, const wxString& projName)
{
    bool markRebuilt(true);
    text << wxT("\t@$(MakeDirCommand) $(@D)\n");
    text << wxT("\t@test -e $(IntermediateDirectory)/.d || echo \"\" > $(IntermediateDirectory)/.d\n");   // *************** Changed line
slorents
CodeLite Curious
Posts: 5
Joined: Wed Jun 25, 2014 4:44 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug 2 Codelite instances unnecessary rebuild step

Post by slorents »

Here is example.
Under windows (mingw) the problem is bigger, F7 always rebuild exec even with one project.
You do not have the required permissions to view the files attached to this post.
slorents
CodeLite Curious
Posts: 5
Joined: Wed Jun 25, 2014 4:44 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: debug 2 Codelite instances unnecessary rebuild step

Post by slorents »

Another option is to move "bad" line to another rule. I think it is more clear => better.

Code: Select all

$(OutputFile): $(IntermediateDirectory)/.d $(Objects) 
	@$(MakeDirCommand) $(@D)
	@echo $(Objects0)  > $(ObjectsFileList)
	$(LinkerName) $(OutputSwitch)$(OutputFile) @$(ObjectsFileList) $(LibPath) $(Libs) $(LinkOptions)

$(IntermediateDirectory)/.d:
	@$(MakeDirCommand) "./Debug"
	@echo "" > $(IntermediateDirectory)/.d
Add line builder_gnumake.cpp: 595

Code: Select all

void BuilderGnuMake::CreateMakeDirsTarget(BuildConfigPtr bldConf, const wxString& targetName, wxString& text)
{
    text << wxT("\n");
    text << targetName << wxT(":\n");
    text << wxT("\t") << GetMakeDirCmd(bldConf) << wxT("\n");
    text << wxT("\t@echo \"\" > $(IntermediateDirectory)/.d\n");  //*************** Add line
}
Remove line builder_gnumake.cpp: 1022

Code: Select all

void
BuilderGnuMake::CreateTargets(const wxString& type, BuildConfigPtr bldConf, wxString& text, const wxString& projName)
{
    bool markRebuilt(true);
    text << wxT("\t@$(MakeDirCommand) $(@D)\n");
    //text << wxT("\t@echo \"\" > $(IntermediateDirectory)/.d\n");   //************** Remove line
Post Reply