Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - PRE-BUILD: (3 Items)
   
PRE-BUILD  
Hi,

I have a question about QNX C++ project settings. I need to execute a shell
script before compiling QNX C++ Project, I added following lines to
common.mk but I couldn't be successful.

SVN_REV=-D  $(shell SubWCRev.exe $(PROJECT_ROOT). ../../Main/SVN.h.tmpl
 ../../Main/SVN.h)

all :
@echo Revision Number Output $(SVN_REV).

shell script works well, but it works after compilation, I don't know where
I missed. Thanks in advance.
Re: PRE-BUILD  
Hi, Yakup,

The PRE_BUILD macro inserts actions before the output binary is linked, but not before the sources are compiled.

For that, you can use the PRE_TARGET macro.  Add a target name to the PRE_TARGET list to put it ahead of the output 
binary in the "all" dependencies.

In your example, you could add the following to your common.mk:

-------- 8< --------

SVN_REV=-D  $(shell SubWCRev.exe $(PROJECT_ROOT). ../../Main/SVN.h.tmpl ../../Main/SVN.h)

PRE_TARGET=revnum_output

revnum_output:
	@echo Revision Number Output $(SVN_REV).

-------- >8 --------

HTH,

Christian


On 2011-06-21, at 8:38 AM, Yakup Cengiz wrote:

> Hi,
> 
> I have a question about QNX C++ project settings. I need to execute a shell
> script before compiling QNX C++ Project, I added following lines to
> common.mk but I couldn't be successful.
> 
> SVN_REV=-D  $(shell SubWCRev.exe $(PROJECT_ROOT). ../../Main/SVN.h.tmpl
> ../../Main/SVN.h)
> 
> all :
> @echo Revision Number Output $(SVN_REV).
> 
> shell script works well, but it works after compilation, I don't know where
> I missed. Thanks in advance.
> 
> 
> 
> 
> _______________________________________________
> 
> General
> http://community.qnx.com/sf/go/post86742
> 

----
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>;

Re: PRE-BUILD  
Thank you for fast reply, It works.