|
|
Re: Adding PRE_TARGET causes make to fail from command line
|
|
04/26/2010 2:02 PM
post52801
|
Re: Adding PRE_TARGET causes make to fail from command line
Hi, Adrian,
I have raised a bug report internally to address the problem of the documentation describing the PRE_TARGET and
POST_TARGET in the same terms as the other variables/macros.
I think it makes sense that PRE_TARGET and POST_TARGET should reference targets, because that is the surest way to
arrange for pre-stuff to be done absolutely before everything else and post-stuff absolutely after everything else.
Otherwise, it's rather convenient to be able to do something like:
define POST_BUILD
$(RM_HOST) $(HOME)/bin/$@
$(CP_HOST) $@ $(HOME)/bin
enddef
(for lack of a better example). Some of these macros can even make use of the special make variables, like $@ above.
PRE_BUILD may be able to substitute for PRE_TARGET if its actions can be performed after ensuring the dependencies of
your build target, but as you're invoking SVN actions I doubt that this would work for you.
Apart from that, I can't imagine why adding a redundant POST_CLEAN macro should make the PRE_TARGET work. Could you
provide a sample project that demonstrates the problem?
Cheers,
Christian
On 18/04/10 08:36 PM, Adrian Higgins wrote:
On a related note, it is confusing that the two macros I'm using, PRE_TARGET and
POST_CLEAN require different syntax.
Further to that, there is no mention of the required syntax in http://www.qnx.com/developers/docs/6.4.1/neutrino/prog/
make_convent.html
I have found (by trial and error) that the following works:
PRE_TARGET=DO_SOMETHING
DO_SOMETHING :
$(TOUCH_HOST) $(PROJECT_ROOT)/did.something.txt
POST_CLEAN=$(TOUCH_HOST) $(PROJECT_ROOT)/did.something.txt
So the PRE_TARGET requires a new target, whereas the POST_CLEAN requires commands directly.
A note for each macro in the help could help others in the future.
Even better would be to pick one method (I prefer a list of targets) and use it consistently for these macros.
_______________________________________________
General
http://community.qnx.com/sf/go/post52000
--
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems <http://www.qnx.com/>
|
|
|
|
|