Is there a Prebuild tutorial (or examples) somewhere? I'd like to add a pre-build step to check to see if a file exists, if doesn't, then generate it. I have no idea where to begin though.
Thanx!
Prebuild Tutorial
-
- CodeLite Enthusiast
- Posts: 22
- Joined: Mon Mar 30, 2009 3:15 pm
- Contact:
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Prebuild Tutorial
In the 'pre build' tab is you can place simple command like:
or anything similar, you can even execute a script that will do the work for you.
However, you can run some more sophisticated commands using the 'Custom makefile steps', this are actually a makefile command that will be placed as pre build before the build starts.
You can read this:
http://codelite.org/LiteEditor/ProjectSettingsSummary (search for 'Custom Makefile Steps')
Or you can provide some more information here:
- How do u plan to generate the file?
- Which commands?
- etc
And I will help you to fill the missing in the 'custom makefile steps'
Eran
Code: Select all
copy <file1> <file2>
However, you can run some more sophisticated commands using the 'Custom makefile steps', this are actually a makefile command that will be placed as pre build before the build starts.
You can read this:
http://codelite.org/LiteEditor/ProjectSettingsSummary (search for 'Custom Makefile Steps')
Or you can provide some more information here:
- How do u plan to generate the file?
- Which commands?
- etc
And I will help you to fill the missing in the 'custom makefile steps'
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Enthusiast
- Posts: 22
- Joined: Mon Mar 30, 2009 3:15 pm
- Contact:
Re: Prebuild Tutorial
Thanx for the heads up!
I initially had this as a prebuild step:
Which is rather ugly, so I implements the custom Makefile step, as per you suggestion which has:
Which is exactly how I have it defined in the existing Makefile I had for the app.
Yet another excellent feature of CodeLite!
Cheers!
I initially had this as a prebuild step:
Code: Select all
if not exist ../svnversion.h svn info --revision HEAD | findstr Revision > svnversion.tmp
if not exist ../svnversion.d and exit svnversion.tmp for /f "tokens=1,2" %%i in (svnversion.tmp) do echo #define SVN_VERSION %%j > svnversion.h
if exist ../svnversion.h and exist svnversion.tmp for /f "tokens=1,2" %%i in (svnversion.tmp) do echo #define SVN_VERSION_STR "%%j" >> svnversion.h
if exist svnversion.tmp del /q svnversion.tmp
Code: Select all
Dependencies: ../svnversion.h
Rule Action:
../svnversion.h:
svn info --revision HEAD | findstr Revision > svnversion.tmp &
for /f "tokens=1,2" %%i in (svnversion.tmp) do echo #define SVN_VERSION %%j > ..\svnversion.h &
for /f "tokens=1,2" %%i in (svnversion.tmp) do echo #define SVN_VERSION_STR "%%j" >> ..\svnversion.h &
del /q svnversion.tmp
Yet another excellent feature of CodeLite!
Cheers!
-
- CodeLite Guru
- Posts: 351
- Joined: Mon Oct 20, 2008 7:26 pm
- Genuine User: Yes
- IDE Question: C++
- Location: France
- Contact: