Hi,
I have a long standing problem with CodeLite.
Given a project, say P, with a single source file P.cpp and build it sucessfully. This generates a P.exe in the debug folder.
Now, introduce an error in P.cpp. The build phase fails but when I try to run the project, it does run because it invokes the old executable.
How can I achieve that running a project fails if the the executable is older than any object or source file?
Many thanks for a hint,
Helmut.
make doesn't work quite right
-
- CodeLite Veteran
- Posts: 98
- Joined: Thu Feb 18, 2010 10:54 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: make doesn't work quite right
You can add a pre-build step that deletes the old binary before compilation starts.
From "project settings -> pre/post build commands -> Pre Build"
Eran
From "project settings -> pre/post build commands -> Pre Build"
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Veteran
- Posts: 98
- Joined: Thu Feb 18, 2010 10:54 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: make doesn't work quite right
Many thanks Eran.eranif wrote:You can add a pre-build step that deletes the old binary before compilation starts.
From "project settings -> pre/post build commands -> Pre Build"
Eran
The ideal solution would be two different post-build steps, one if make succeeds and one if it fails.
In my case make fails so I'd remove the binary only in this case. Otherwise, the linkage phase has to be rerun any time one wants to run the binary.
Thanks,
Helmut.
-
- CodeLite Veteran
- Posts: 98
- Joined: Thu Feb 18, 2010 10:54 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: make doesn't work quite right
I have problems doing so,eranif wrote:You can add a pre-build step that deletes the old binary before compilation starts.
From "project settings -> pre/post build commands -> Pre Build"
Eran
under Linux, I've added the following command line first as Pre Build, next as Post Build
/bin/echo "$(CurrentFileFullPath)/HJ" > /tmp/LOG
In both cases, $(CurrentFileFullPath) evaluated to the null string.
What can I find out the full name of the executable?
This is with 4.1.5770
Thanks,
Helmut.
- Jarod42
- CodeLite Expert
- Posts: 240
- Joined: Wed Sep 30, 2009 5:54 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: make doesn't work quite right
You can open myproject.mk to see the generated makefile and see the defined variables.
So, I think you want $(OutputFile)
So, I think you want $(OutputFile)
-
- CodeLite Veteran
- Posts: 98
- Joined: Thu Feb 18, 2010 10:54 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: make doesn't work quite right
Many thanks. Now I can use the Pre Build actionJarod42 wrote:You can open myproject.mk to see the generated makefile and see the defined variables.
So, I think you want $(OutputFile)
rm "$(ProjectPath)/$(OutputFile)"
although this isn't optimal, as noted before.
Helmut.