Mark Pearson
|
Problem with post-build actions
|
Mark Pearson
01/21/2010 5:36 AM
post45616
|
Problem with post-build actions
Hello,
After building an image for my project, I wanted to copy the image to another location. To do this I added a post-build
action to my project, via Momentics (QNX C/C++ Project -> Linker -> Post-Build Actions).
I chose the option Copy result to other location, choosing the directoy via the "To Workspace" button.
Once chosen, I could see the following:
$(PROJECT_ROOT_bsp-amcc-ppc460ex)/Overrides/$(BUILDNAME)
and in my common.mk, I see the following added POST_BUILD action:
-@$(CP_HOST) $(BUILDNAME) $(PROJECT_ROOT_bsp-amcc-ppc460ex)/Overrides/$(BUILDNAME)
Before I added this post-build action, my image was called: devc-ser8250, but now after adding the post-build action, it
is called devc-ser8250-ser8250.
Why has the post-build action changed the name? I require the image to be called devc-ser8250.
If I remove the post-build action, then the image name reverts back to devc-ser8250.
Is there a solution to this problem, or does anyone know why this happens?
I am using Momentics Version 4.6.0 Build id: I20090510
Many thanks in advance, Mark Pearson.
|
|
|
Mark Pearson
|
Re: Problem with post-build actions
|
Mark Pearson
01/21/2010 5:51 AM
post45619
|
Re: Problem with post-build actions
Forgot to mention, the directory structure for the project, is as follows:
bsp-amcc-ppc460ex_devc-ser8250
ser8250 (contains source code)
ppc
be (image is stored here)
Perhaps it is due to this ser8250 directory, that the image name becomes devc-ser8250-ser8250, but still poses the
question, why does this not happen, when no post-build actions are specified.
Cheers, Mark.
|
|
|
Christian Damus(deleted)
|
Re: Problem with post-build actions
|
Christian Damus(deleted)
01/21/2010 9:21 AM
post45635
|
Re: Problem with post-build actions
Hi, Mark,
It appears that something in your makefiles is causing the BUILDNAME
macro to compute an incorrect name. AFAICS, there is nothing in the
common.mk definition of the POST_BUILD variable, nor in
the .qnx_internal.mk selection of its variant-specific value, nor in the
qmacros.mk usage of it that would cause your symptom. But, then again,
I'm not a make guru yet. :-)
I attach a ZIP of a couple of minimal projects that I think should match
your layout. Building my fake driver source project results in the
correct binary name. How does my project differ from yours (besides the
obvious having no real code)?
HTH,
Christian
On Thu, 2010-01-21 at 05:36 -0500, Mark Pearson wrote:
> Hello,
>
> After building an image for my project, I wanted to copy the image to another location. To do this I added a post-
build action to my project, via Momentics (QNX C/C++ Project -> Linker -> Post-Build Actions).
>
> I chose the option Copy result to other location, choosing the directoy via the "To Workspace" button.
>
> Once chosen, I could see the following:
>
> $(PROJECT_ROOT_bsp-amcc-ppc460ex)/Overrides/$(BUILDNAME)
>
> and in my common.mk, I see the following added POST_BUILD action:
>
> -@$(CP_HOST) $(BUILDNAME) $(PROJECT_ROOT_bsp-amcc-ppc460ex)/Overrides/$(BUILDNAME)
>
> Before I added this post-build action, my image was called: devc-ser8250, but now after adding the post-build action,
it is called devc-ser8250-ser8250.
>
> Why has the post-build action changed the name? I require the image to be called devc-ser8250.
>
> If I remove the post-build action, then the image name reverts back to devc-ser8250.
>
> Is there a solution to this problem, or does anyone know why this happens?
>
> I am using Momentics Version 4.6.0 Build id: I20090510
>
>
> Many thanks in advance, Mark Pearson.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post45616
>
________________________________________________________________________
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems
|
|
|
Mark Pearson
|
Re: Problem with post-build actions
|
Mark Pearson
01/21/2010 9:48 AM
post45645
|
Re: Problem with post-build actions
Hi Christian,
Many thanks for the reply.
> I attach a ZIP of a couple of minimal projects that I think should match
> your layout. Building my fake driver source project results in the
> correct binary name. How does my project differ from yours (besides the
> obvious having no real code)?
>
The main difference I see, is that in your common.mk NAME=devc and in mine it is NAME=devc-ser8250.
The comment beside the name definition says: "NAME - name of the project (default - name of project directory).
Indeed, if I change the NAME in your example project to devc-ser8250, then the image name is changed to devc-ser8250-
ser8250.
Best regards, Mark.
|
|
|
Christian Damus(deleted)
|
Re: Problem with post-build actions
|
Christian Damus(deleted)
01/21/2010 10:12 AM
post45649
|
Re: Problem with post-build actions
Hi, Mark,
OK, that explains it, then. The BUILDNAME variable is based on
$(NAME)$(VARIANT_TAG). Your project should get -ser8250 for the
VARIANT_TAG, which would be redundant with the same string in your NAME
variable.
So now the question is, why is your VARIANT_TAG empty without the
POST_BUILD action? Again, I don't see any connection between POST_BUILD
and VARIANT_TAG (or the VARIANT_LIST more generally) unless it is that
in using the IDE's UI to set the POST_BUILD action, the IDE actually
created another common.mk at the root of the project and updated your
variant makefiles to use it instead of the common.mk that you already
had (perhaps in the ser8250 folder)?
How many common.mk files do you have, and which one is the build
actually using?
Cheers,
Christian
On Thu, 2010-01-21 at 09:48 -0500, Mark Pearson wrote:
> Hi Christian,
>
> Many thanks for the reply.
>
> > I attach a ZIP of a couple of minimal projects that I think should match
> > your layout. Building my fake driver source project results in the
> > correct binary name. How does my project differ from yours (besides the
> > obvious having no real code)?
> >
> The main difference I see, is that in your common.mk NAME=devc and in mine it is NAME=devc-ser8250.
>
> The comment beside the name definition says: "NAME - name of the project (default - name of project directory).
>
> Indeed, if I change the NAME in your example project to devc-ser8250, then the image name is changed to devc-ser8250-
ser8250.
>
> Best regards, Mark.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post45645
>
________________________________________________________________________
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems
|
|
|
Mark Pearson
|
Re: Problem with post-build actions
|
Mark Pearson
01/22/2010 4:10 AM
post45744
|
Re: Problem with post-build actions
Hi Christian,
> How many common.mk files do you have, and which one is the build
> actually using?
>
Just the one :-(
I have changed the NAME variables in my common.mk and it seems to work now, but it takes a lot of handwork, to change
all the common.mk files.
Cheers, Mark.
|
|
|
Christian Damus(deleted)
|
Re: Problem with post-build actions
|
Christian Damus(deleted)
01/22/2010 9:17 AM
post45765
|
Re: Problem with post-build actions
Hi, Mark,
I'm glad this work-around has resolved the problem for you. Honestly, I
would have expected you to need to do that with or without the
post-build action.
Anyhow, if you happen to find the time to produce a minimal example of a
project that manifests this problem, you can post it here or e-mail it
to me, and I can raise a bug in our bug tracking system to see about
resolving it.
To reduce the effort of updating your common.mk files, you can use the
IDE's excellent regexp search-and-replace capability: something like
(NAME=\S*)(?:-[^-]+)$
replacing with $1 should do the trick (I haven't tried it).
Thanks!
Christian
On Fri, 2010-01-22 at 04:10 -0500, Mark Pearson wrote:
> Hi Christian,
>
> > How many common.mk files do you have, and which one is the build
> > actually using?
> >
> Just the one :-(
>
> I have changed the NAME variables in my common.mk and it seems to work now, but it takes a lot of handwork, to change
all the common.mk files.
>
> Cheers, Mark.
>
>
>
> _______________________________________________
>
> General
> http://community.qnx.com/sf/go/post45744
>
________________________________________________________________________
Christian W. Damus
Software Developer, IDE Team
QNX Software Systems
|
|
|
|