Omission in wiki.linaro.org/Platform/Android/BuildSource

Andy Doan andy.doan at linaro.org
Thu Jan 12 15:44:05 UTC 2012


On 01/12/2012 05:34 AM, Jon Medhurst (Tixy) wrote:
> On Thu, 2012-01-12 at 13:20 +0200, Paul Sokolovsky wrote:
>> I had a look at the latest
>> http://wiki.linaro.org/Platform/Android/BuildSource and see that it
>> doesn't mention the need to run ". build/envsetup.sh" explicitly. I
>> don't know if that's omitted deliberately or just forgotten.
> 
> The wiki mentions that you don't need to run it. Under "Divergence from
> Google's standard build instructions"
> 
>>  I don't if
>> it works without it or no (I would doubt it does, but maybe there were
>> changes to makefiles and stuff).
> 
> I've never done envsetup.sh, I just repo init, repo sync, and then...
> 
> PATH=$PWD/android-toolchain-eabi/bin/:$PATH make -j8 \
>   TARGET_PRODUCT=vexpress_a9 \
>   TARGET_TOOLS_PREFIX=$PWD/android-toolchain-eabi/bin/arm-linux-androideabi- \
>   boottarball systemtarball userdatatarball
> 

This is interesting. The instructions in that page used to say you
needed to pull in envsetup.sh. I guess you don't *have* to do it.
However, it does have some nice benefits. The envsetup.sh adds some
handy shortcuts. Specifically:

- croot:   Changes directory to the top of the tree.
- m:       Makes from the top of the tree.
- mm:      Builds all of the modules in the current directory.
- mmm:     Builds all of the modules in the supplied directories.
- cgrep:   Greps on all local C/C++ files.
- jgrep:   Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir:   Go to the directory containing a file.

I've found I still TARGET_PRODUCT and TARGET_TOOLS_PREFIX set when I run
them, but they are still handy. I use mmm all the time when I'm trying
to deal with a build issue for some component.

Not to get off subject, but there are two more really handy android
build tricks. Say you are building a binary, skia_bench. There are two
really useful commands:

  make TARGET_PRODUCT=XXX TARGET_TOOLS_PREFIX=XXX skia_bench
  make TARGET_PRODUCT=XXX TARGET_TOOLS_PREFIX=XXX clean-skia_bench




More information about the linaro-android mailing list