Clue on how to change tmp dir for generated bat files
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Clue on how to change tmp dir for generated bat files
Hi,
For my own need, I want to change the directory where is created the batch file which launch the compilation of a project. This batch is created in %TEMP% directory.
I didn't find where this file is created. Any clue would be helpfull.
For information, I think I will add -Dvariable=value in codelite command line. This way, we can override the codelite usual way.
For me, I will create a variable codelite.tmp.dir, which will be used to create the batch file. If this variable doesn't exist, I'll let CodeLite use it's current way of generating it's batch.
I suppose nobody will need this change (except those, like me, who's company policy has change, and doesn't let application to create batch file in %TEMP% dir), but I can share it.
Let me know
For my own need, I want to change the directory where is created the batch file which launch the compilation of a project. This batch is created in %TEMP% directory.
I didn't find where this file is created. Any clue would be helpfull.
For information, I think I will add -Dvariable=value in codelite command line. This way, we can override the codelite usual way.
For me, I will create a variable codelite.tmp.dir, which will be used to create the batch file. If this variable doesn't exist, I'll let CodeLite use it's current way of generating it's batch.
I suppose nobody will need this change (except those, like me, who's company policy has change, and doesn't let application to create batch file in %TEMP% dir), but I can share it.
Let me know
Jérémie
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Clue on how to change tmp dir for generated bat files
I am not sure to which batch file you are referring. IIRC, the only batch file generated by codelite is done when the project is using a custom makefile + there are some post/pre build commands. Is this the case?jfouche wrote:For my own need, I want to change the directory where is created the batch file which launch the compilation of a project. This batch is created in %TEMP% directory.
I didn't find where this file is created. Any clue would be helpfull.
Can you please paste here some example of how your build looks like?
If all you need is to add a -D<name>=<value> to the compilation line you can define the standard makefile environment variables CXX/CC like this:
Code: Select all
CXX=g++ -Dvariable=value
CC=g++ -Dvariable=value
Make sure you have read the HOW TO POST thread
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Hello Eran,
Open the CodeLite workspace, and select the Windows release configuration. Hit "F7".
Open your %TEMP% dir and look at the generated batches (it contains "cd plugin && mingw32-make ..."). In my company, they are not generated due to the new security policy, and I can't use CodeLite to compile anymore
About the -Dname=value, I was thinking about variables during codelite run :
Open the CodeLite workspace, and select the Windows release configuration. Hit "F7".
Open your %TEMP% dir and look at the generated batches (it contains "cd plugin && mingw32-make ..."). In my company, they are not generated due to the new security policy, and I can't use CodeLite to compile anymore
About the -Dname=value, I was thinking about variables during codelite run :
codelite.exe -Dcodelite.tmp.dir=d:\my_dir
Jérémie
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Its not codelite who does that... its mingw32-make.exe ...jfouche wrote:Open the CodeLite workspace, and select the Windows release configuration. Hit "F7".
Open your %TEMP% dir and look at the generated batches (it contains "cd plugin && mingw32-make ..."). In my company, they are not generated due to the new security policy, and I can't use CodeLite to compile anymore
I experminted with it a bit and my first guess was correct: mingw32-make.exe is using the TMP environment variable to determine the location of the temp folder.
So what I did was:
Settings -> Environment variables
Added:
Code: Select all
TMP=C:\MyTempFolder
and all the auto generated .bat files were generated in the new folder
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Back at home, I checked the content of the batch :
I'll try your suggestion tomorow at work, but I'm not very optimistic about this. I tried to modify the TMP and TEMP variable in a DOS console before launching CodeLite, the policy is smart enough to block the creation of the batch...
I'm surprised that mingw32-make created one like this.@echo off
cd "Plugin" && mingw32-make.exe -f "plugin_sdk.mk" ../PCH/precompiled_header_release.h.gch && mingw32-make.exe -f "plugin_sdk.mk" && mingw32-make.exe -f "plugin_sdk.mk" PostBuild
I'll try your suggestion tomorow at work, but I'm not very optimistic about this. I tried to modify the TMP and TEMP variable in a DOS console before launching CodeLite, the policy is smart enough to block the creation of the batch...
Jérémie
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Clue on how to change tmp dir for generated bat files
codelite generates Makefile and simply runs it using mingw32-make.exe without any intermediate batch files.
The below line (note that it slightly differs from what you posted) is taken from codelite's Makefile:
Eran
The below line (note that it slightly differs from what you posted) is taken from codelite's Makefile:
I suspect that mingw32-make replaces $(MAKE) with the actual invocation command of make and generates a helper batch file to execute it (its a reasonable way for executing chain commands using the && operator)@cd "Plugin" && $(MAKE) -f "plugin_sdk.mk" ../PCH/precompiled_header_release.h.gch && $(MAKE) -f "plugin_sdk.mk" && $(MAKE) -f "plugin_sdk.mk" PostBuild
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Well, you're right, as usual
I had a look to mingw32-make source and it uses directly the tmpfile() function.
I'm probably lost...
I had a look to mingw32-make source and it uses directly the tmpfile() function.
I'm probably lost...
Jérémie
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Not really, simply define TMP environment variable in codelite's environment settings and it will work...jfouche wrote:Well, you're right, as usual
I had a look to mingw32-make source and it uses directly the tmpfile() function.
I'm probably lost...
Code: Select all
TMP=d:\my_dir
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: Clue on how to change tmp dir for generated bat files
I hope it will work in my company, but
Thanks a lot for your time
I'll tell you tomorow. But as it's not CL fault, I can't complain herejfouche wrote:I'll try your suggestion tomorow at work, but I'm not very optimistic about this. I tried to modify the TMP and TEMP variable in a DOS console before launching CodeLite, but the policy is smart enough to block the creation of the batch...
Thanks a lot for your time
Jérémie
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact:
Re: Clue on how to change tmp dir for generated bat files
Eran,
You're great. That works
Thanks a lot for this simple solution. You have to know that VisualStudio doesn't work anymore also (if the project has pre / post steps).
One more point to CodeLite
You're great. That works
Thanks a lot for this simple solution. You have to know that VisualStudio doesn't work anymore also (if the project has pre / post steps).
One more point to CodeLite
Jérémie