Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Conditional root variables in batch build files
(1/1)
hl2gordon:
Hi Everybody,
I was going through the Code::Blocks batch build files and have some improvements:
1. Instead of setting the variables only through the batch file, we should have an option of supplying them beforehand :):
Old code:
--- Code: ---set CB_ROOT=C:\Devel\CodeBlocks
rem ------------------------------------------
rem Setup GCC root folder with "bin" subfolder
rem ------------------------------------------
set GCC_ROOT=C:\Devel\GCC46TDM
--- End code ---
New code:
--- Code: ---if not defined CB_ROOT set CB_ROOT=C:\Devel\CodeBlocks
rem ------------------------------------------
rem Setup GCC root folder with "bin" subfolder
rem ------------------------------------------
if not defined GCC_ROOT set GCC_ROOT=C:\Devel\GCC46TDM
--- End code ---
This has the added advantage that these files can be used as-is by other build scripts by simply declaring the root dirs for cb, gcc, etc.
Most other options that are configurable should also be implemented this way.
2. Since these files are in the 'src' directory, they should be able to access update.bat and instead of this:
--- Code: ---echo Do not forget to run "update.bat" after successful build!
goto TheEnd
--- End code ---
we should use this:
--- Code: ---echo Running update.bat ...
call "%~dp0update.bat"
goto TheEnd
--- End code ---
This command to run update.bat should also be configurable ( as it is preferable to run it after a full compile - i.e. cb + plugins )
Forgive me for sounding too lazy, but I have a lack of time, limited computer access ( school is going on ) and full knowledge of tools like patch and diff blocking me from providing a patch.
( Thanks to obfuscated for providing the link :))
EDIT: I was successfully able to create a patch. I was not sure where to post it though, here or on berlios so I will post it here for developers to review it before uploading it to berlios.
EDIT2: Patch updated for all scripts as of rev 8096 (conditional2.patch) and posted on berlios (PID: 003303)
Alakh
oBFusCATed:
If you have svn client then you have the patch creation tool already installed.
So read this http://wiki.codeblocks.org/index.php?title=Creating_a_patch_to_submit_to_BerliOS_%28Patch_Tracker%29 provide patches...
hl2gordon:
Successfully created the patch :). See above for attachment and details.
Here is an image of me testing the new build files by setting the variables in the prompt:
ollydbg:
I review the patch, and it looks good to me. Thanks. (I have no plan to try it... because I have always build c::b under c::b :))
hl2gordon:
New patch added here and on berlios, check first post for details on the file 8)
Navigation
[0] Message Index
Go to full version