5

Currently I'm using the the AOSP ROM Builder image on Amazon AWS to build Android.
The point is, I'm only interested in the external tool grxmlcompile that is built for the host (linux) in the path: aosp/out/host/linux-x86/bin
where the source is at aosp/external/srec/tools/grxmlcompile

I'm not very familiar with Linux and make files, hence my difficulty to get this going.

I would like to copy the source (if needed the whole tree) and build just this tool on another linux machine.

I can't find the make file I need to run to build just this part.

UPDATE: Looks like make out/host/linux-x86/bin/grxmlcompile would do the job. I would still like to be able to port only the needed parts of the source tree to the build machine

Ron Harlev
  • 16,227
  • 24
  • 89
  • 132

1 Answers1

18

cd to the top of your Android build source.

source build/envsetup.sh
cd external/srec/tools/grxmlcompile
mma

...or any directory, or sub-directory a makefile. From AOSP build/envsetup.sh

  • m: Makes from the top of the tree.
  • mm: Builds all of the modules in the current directory, but not their dependencies.
  • mmm: Builds all of the modules in the supplied directories, but not their dependencies. To limit the modules being built use the syntax: mmm dir/:target1,target2.
  • mma: Builds all of the modules in the current directory, and their dependencies.
  • mmma: Builds all of the modules in the supplied directories, and their dependencies.

external/srec was removed from the platform/manifest after android-5.1.1_r4 tag. So later, if you are using a manifest such as revision 5, 6 or later, you may need to do git clone https://android.googlesource/platform/external/srec external/srec to include that directory.

SudoSURoot
  • 443
  • 3
  • 8
  • Even after running 'build/envsetup.sh' the mm, mma etc. commands are not recognized – Ron Harlev Jun 10 '15 at 19:06
  • I have not used these commands very much, even though being an Android ROM Developer I know about them, because I usually run full ROM builds only. However I just fixed up my answer with the correct method for building the grxmlcompile module only, with it's dependencies. I apologize about the delay. I left the other commands listed by AOSP's `build/envsetup.sh` in case you or anyone wants to build only a certain module without the dependencies (usually used for testing code build) or other modules. Some require input others do not. I hope this helps. I tested it in my build source first. – SudoSURoot Jun 12 '15 at 03:41
  • 1
    It took me seven minutes!!! :) Install: /home/sudosurootdev/source/android/VanirAOSP/out/host/linux-x86/bin/grxmlcompile make: Leaving directory `/home/sudosurootdev/source/android/VanirAOSP' #### make completed successfully (07:02 (mm:ss)) #### – SudoSURoot Jun 12 '15 at 03:42
  • If you are still having problems with this than you must be missing a local dependency or package. If you want a fresh build of it I uploaded it here: https://www.dropbox.com/s/xyrpwl4um8uve4r/grxmlcompile?dl=0 By the way, what do you use it for, translation or something? Also, why not fork it, add the dependencies and create a stand alone project by writing regular Makefiles to build it all so you are not wasting so much storage space??? – SudoSURoot Jun 12 '15 at 03:53
  • Thanks for the detailed instructions. About youe suggestion to extract (fork) the part of the tree I need with my own makefile. I would like to do just that. But I don't have enough understanding of how to do it, or how to find all the dependencies I in the current tree. Or at least I can't do it in a reasonable time, without spending time learning how make works – Ron Harlev Jun 15 '15 at 18:25
  • When I say fork, I mean on github, also known as `git clone`. I can type up this for you but I am working on my kernel right now, and have a lot of users waiting for my LG G2 & LG G3 builds. So, I'll try to do it once I start my builds, cause I have a script that runs them all. – SudoSURoot Jun 17 '15 at 04:09
  • Just tried that and got the error message: `build/core/ninja.mk:159: build/kati/Makefile.ckati: No such file or directory`. This seems to be due to a half-completed switch to a different toolchain. Running `export USE_NINJA=false` right after `envsetup.sh` fixed this. Also, `libcxx` recently got replaced, the old version being renamed to `libcxx_35a`. You will need the old version under its old name. – user149408 Jan 05 '16 at 20:08
  • for completeness: looking at https://android.googlesource.com/platform/manifest/, it seems `android-5.1.1_r33` is the last release that included `srec`. It is absent from `android-m-preview` and all released versions starting with 6.0.0_r1. (The corresponding java classes got dropped from `platform/frameworks/base` between `android-m-preview` and `android-m-preview-1`.) – user149408 Jan 05 '16 at 21:24
  • @SudoSURoot You saved me. Thank you so much for sharing it. – Ahmad Reza Enshaee Jul 31 '23 at 13:55