...get an incrementing build number?

Comments

8 comments

  • Avatar
    Greg Yotz

    Where is the buildnum.h file at?  How do I create it?

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    > Where is the buildnum.h file at?  How do I create it?

    It is generated by the JavaScript that is run just before getbuildnum.c is compiled.

    0
    Comment actions Permalink
  • Avatar
    Greg Yotz

    Ok, I see how that works, the problem is getting the script to execute.  I didn't realize I was getting an error from the Pre-Compile command from the getbuildnum.c file.  I copied the line straight from this post and it looks like there is a syntax problem.  i'm using CrossStudio 2.0.7.xxxxxx.   it gives me a Pre-Compile Command -- error 1 , "line 1: not a function object".

    I've played around with the syntax but can't figure it out.If I change to "$(StudioDir)/bin/crossscript.exe" -verbose load("$(ProjectDir)/incbuild.js")

    I get a "line 1: expected , found :"

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    I've just followed the instructions using the latest release of CrossWorks for ARM (2.0.10.2011011700.9509) and also CrossWorks for ARM 2.0.7.2010061501.7937 and it works with no problem.

    Make sure you've followed all the instructions correctly -  the error message may indicate an empty script file or that the name of the function in the script doesn't match the function being called by the pre-compile command.

    0
    Comment actions Permalink
  • Avatar
    Greg Yotz

    Ok, I had a DAA.  I copied your code with a cut and paste from above without reading it.  You left out the semicolons on the first two lines in the function.  I should have caught that and instead was thinking the error was in the script engine.  The error on "line 1" threw me originally, I should have know that "line 1" to the script interpreter was not the function declaration but the first line in the function.

    0
    Comment actions Permalink
  • Avatar
    Marcin

    Great tip Jon!

    I just have but one question. I prefer to use this mechanism in post-link command - and it's working fine, but I already have the other post-link command existing (generation of the target in .bin format).
    Is it possible to have multiple commands in one property? If there is, I can't figure out the syntax.

    0
    Comment actions Permalink
  • Avatar
    Jon Elliott

    Marcin,

    Currently, you can only have one build step but there is nothing to stop the script from doing other things.

    You don't actually need to use a post link step to create a .bin file, you can do this by setting the Linker Options > Additional Output Format project property to bin.

    Also, there is the User Build Step Options > Link Patch Command project property which you may be able to use to do what you want.

    0
    Comment actions Permalink
  • Avatar
    Marcin

    Hi,

    Yes, I am aware of Additional Output Format, but again, it only accept one - the thing is I need both - hex and bin.
    I modified the script as You suggested to do just that, and it's working great.
    I'm growing to like Js in CrossStudio :) 

    Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.