Running a tool after a successful build?

Technical questions regarding the XTC tools and programming with XMOS.
Treczoks
Active Member
Posts: 38
Joined: Thu Mar 21, 2013 11:18 am

Running a tool after a successful build?

Post by Treczoks »

Hi!

How can I make XTimeComposer to run a command line tool after a successful build? I want to auto-commit the project to our subversion repository.

Yours, Christian Treczoks


User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Post by kris »

Hi Christian,

There are a couple of options. You can define a new builder for your project,
and this will run a tool/script after the build completes. Right-click on the project,
select: Properties->Builders->New etc.. However, I suspect this will run irrespective of the build
success/failure status.

Alternatively, assuming that you are using the XMOS makefiles (the default), then you can
define some pre/post build targets as follows (add this to the top of the Makefile in
your project):

PREBUILD_TARGET := prebuild
prebuild:
echo "This is the prebuild step"

POSTBUILD_TARGET := postbuild
postbuild:
echo "This is the postbuild step"

I believe that in this case the postbuild target will only be run if the build succeeds.

Hope this helps,
cheers,
Kris.
Treczoks
Active Member
Posts: 38
Joined: Thu Mar 21, 2013 11:18 am

Post by Treczoks »

Hi, Kris,
kris wrote:Alternatively, assuming that you are using the XMOS makefiles (the default), then you can define some pre/post build targets as follows (add this to the top of the Makefile in your project)
Thank you for pointing this out! I thought about using the makefile, and I looked in the "Using XMOS Makefiles" (X6348C) manual (238K for SIX pages of text?) but was disappointed. It did not tell anthing about PREBUILD_TARGET and POSTBUILD_TARGET, and, now that I know them, both terms yield no results on the XMOS web site, either.

Do you know of a thorough documentation on XMOS Makefiles? What I now need is a list of Makefile macros they have for things like project path and suchlike, so I can build the proper command for my SVN commit.

Will I have to touch the target, and if so, how the heck does one touch a file under Windows?

Oh my. XMOS is a quest. Probably a lengthy one. Each answer leads to a number of new questions, and the documentation is not exactly satisfying. SIGH!

Yours, thankfully,
Christian Treczoks