Android Build System: How to add prebuilt event?

classic Classic list List threaded Threaded
3 messages Options
pps
Reply | Threaded
Open this post in threaded view
|

Android Build System: How to add prebuilt event?

pps
How can I add "pre-build" event for compilation of any file in android build system?

In regular makefile, I'd do something like this:

.PHONY pre-build
%.cpp: pre-build
pre-build:
    PrebuildRule.sh


all: pre-build ...
...


this way, no matter what, pre-build step will be executed, but I can't find a way how to do such thing with android build system.
Can anybody suggest appropriate workaround?
thanks.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/c949bXj7iNwJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: Android Build System: How to add prebuilt event?

David Turner

On Thu, Jan 10, 2013 at 7:45 AM, pps <[hidden email]> wrote:
How can I add "pre-build" event for compilation of any file in android build system?

You can't, instead write a wrapper that runs your prebuilt script, then invokes ndk-build.

 
In regular makefile, I'd do something like this:

.PHONY pre-build
%.cpp: pre-build
pre-build:
    PrebuildRule.sh


all: pre-build ...
...


this way, no matter what, pre-build step will be executed, but I can't find a way how to do such thing with android build system.
Can anybody suggest appropriate workaround?
thanks.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/c949bXj7iNwJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
pps
Reply | Threaded
Open this post in threaded view
|

Re: Android Build System: How to add prebuilt event?

pps
On Friday, January 11, 2013 10:58:02 AM UTC-5, Digit wrote:

How can I add "pre-build" event for compilation of any file in android build system?

You can't, instead write a wrapper that runs your prebuilt script, then invokes ndk-build.

 
In regular makefile, I'd do something like this:

.PHONY pre-build
%.cpp: pre-build
pre-build:
    PrebuildRule.sh


all: pre-build ...
...


this way, no matter what, pre-build step will be executed, but I can't find a way how to do such thing with android build system.
Can anybody suggest appropriate workaround?
thanks.


I would really prefer to avoid adding stuff, since I want to make as simple as possible for the other programmers that use my stuff.
So, I added something like this at the beginning of my Android.mk file:

$(PrebuildResult) := $(shell prebuild.sh)

LOCAL_SRC_FILES := ....

And, then, I also manually added dependency on the prebuild.sh script (which generates the Prebuit.h header):
Prebuilt.h: prebuild.sh
 
So far everything works fine, except that it might fails on first clean built with -j8, because some parallel jobs try to compile files that depend on prebuilt.h which wasn't yet generated by the prebuilt.sh. That's why I was trying to find a way how add dependency or a prebuilt step in android. Perhaps, android/ndk devs could add that as a todo for the build system. Knowing internals it of the system it's easy to add something like that.

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/U9nFZ5maP-wJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.