General soong docs: build/soong/README.md <https://android.googlesource.com/platform/build/soong/+/master/README.md>
For genrule properties, there's auto-generated reference docs here <https://ci.android.com/builds/latest/branches/aosp-build-tools/targets/linux/view/genrule.html> It can also be helpful to look at examples <https://cs.android.com/search?q=file:Android.bp%20%5Egenrule&ss=android%2Fplatform%2Fsuperproject> in AOSP. - Dan On Tue, Dec 21, 2021 at 1:11 PM Abhayadev S <[email protected]> wrote: > thanks Dan and Paulo... > i will look in to how i can make use of the genrule.... > do you see any official man page for this... i am kind of lost in the > google ! > > On Wednesday, December 15, 2021 at 1:19:48 AM UTC+5:30 [email protected] > wrote: > >> Hello, >> The $(shell) inside you mk will for sure slow down your build as Dan >> pointed out (sorry I forgot to mention this) I currently have a setup like >> this and Im trying to refactor it, still trying to find the best solution >> for my use case. >> Thanks, >> Paul >> >> On Mon, Dec 13, 2021, 8:41 PM 'Dan Willemsen' via Android Building < >> [email protected]> wrote: >> >>> Embedding build systems into one another is a very complicated issue, >>> and requires deep knowledge of both build systems in order to keep all the >>> functionality of both systems. Given that the Android build attempts to >>> provide safe, fast incremental builds that work on any machine, it gets >>> very difficult to preserve those features while calling out to another >>> build system. If the scripts are simpler (bash/python script that reads a >>> known set of inputs and writes to a know set of outputs, and doesn't use >>> any other tools), then this doesn't get too difficult. But keep in mind >>> that you do need to declare all inputs and outputs, and most tools you use >>> need to be referenced by paths (and also be inputs), not in $PATH. >>> Android.bp has the `genrule` concept that makes this easier. >>> >>> <this where i need to run the script so that bins will be generated for >>>> Android build to pickup> >>>> >>> >>> Keep in mind that we're not linearly executing Android.mk files -- that >>> only happens in the first minute or two of the build to generate commands >>> for what comes later. So you shouldn't actually be running the script >>> there, but defining some Make logic to run your script later. You may be >>> able to find references to Android.mk files using base_rules.mk and >>> defining rules to build $(LOCAL_BUILT_MODULE), but you could also look into >>> writing Android.bp files with genrules, which makes this simpler and adds >>> some checks for common issues. >>> >>> >>>> Have you tried using $(shell) ? >>>> RESULT:= $(shell ($(LOCAL_PATH)/yourscript.sh)) >>>> >>> >>> Definitely don't do this, it will slow down every build as we serially >>> execute every one of these every time (even if there's nothing to build). >>> >>> - Dan >>> >>> On Mon, Dec 13, 2021 at 2:49 PM Paulo Maia <[email protected]> wrote: >>> >>>> Have you tried using $(shell) ? >>>> RESULT:= $(shell ($(LOCAL_PATH)/yourscript.sh)) >>>> >>>> Also you I think you could put in buiod/core/app_prebuilt_internal.mk >>>> if this is going to be repetitive. >>>> >>>> BR, >>>> Paulo >>>> >>>> On Monday, November 8, 2021 at 2:14:48 PM UTC-8 [email protected] >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I need to run a shell script so that the libs and bins will be >>>>> generated beofre Android can pick them up. >>>>> >>>>> A structure of the makefile i am trying to comeup is below, not sure >>>>> if this is really possible.. any inputs are appreciated. >>>>> >>>>> LOCAL_PATH := $(call my-dir) >>>>> >>>>> <this where i need to run the script so that bins will be generated >>>>> for Android build to pickup> >>>>> >>>>> include $(CLEAR_VARS) >>>>> LOCAL_MODULE := my_modules >>>>> LOCAL_MODULE_OWNER := Me >>>>> LOCAL_MODULE_TAGS := optional >>>>> LOCAL_SRC_FILES := ./my_bin_001 >>>>> LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/bin >>>>> include $(BUILD_PREBUILT) >>>>> >>>>> i am not sure how can i add my build script which generates the >>>>> my_bin_001 >>>>> there are several bins its generating and i cant really convert the >>>>> shell script in to a Makefile for practical reasons. >>>>> >>>>> reagrds, >>>>> abhay >>>>> >>>> -- >>>> -- >>>> You received this message because you are subscribed to the "Android >>>> Building" mailing list. >>>> To post to this group, send email to [email protected] >>>> To unsubscribe from this group, send email to >>>> [email protected] >>>> For more options, visit this group at >>>> http://groups.google.com/group/android-building?hl=en >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Android Building" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/android-building/2824e7a8-3745-45b7-9037-fc5c1eaf8930n%40googlegroups.com >>>> <https://groups.google.com/d/msgid/android-building/2824e7a8-3745-45b7-9037-fc5c1eaf8930n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >>> -- >>> You received this message because you are subscribed to the "Android >>> Building" mailing list. >>> To post to this group, send email to [email protected] >>> To unsubscribe from this group, send email to >>> [email protected] >>> For more options, visit this group at >>> http://groups.google.com/group/android-building?hl=en >>> >>> --- >>> >> You received this message because you are subscribed to a topic in the >>> Google Groups "Android Building" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/android-building/k5P_dxROmOg/unsubscribe >>> . >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/android-building/CALQgHdmuC3RcAfmF6GvmQVEqGyemMHW-7K0ovbP1RkZkZam-fA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/android-building/CALQgHdmuC3RcAfmF6GvmQVEqGyemMHW-7K0ovbP1RkZkZam-fA%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > -- > You received this message because you are subscribed to the "Android > Building" mailing list. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-building?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "Android Building" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/android-building/e4f6fcbd-e58a-4f50-98a6-0775553871dan%40googlegroups.com > <https://groups.google.com/d/msgid/android-building/e4f6fcbd-e58a-4f50-98a6-0775553871dan%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- -- You received this message because you are subscribed to the "Android Building" mailing list. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-building?hl=en --- You received this message because you are subscribed to the Google Groups "Android Building" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHdm1_TGJQ7FoUGmMhL-pak6EQQPmxx_SCecY-bB%2BHnaiJA%40mail.gmail.com.
