build: Preliminary support for EV product builds

If building a ev_* product, skip crawling the filesystem for
AndroidProduct makefiles (and, of course, parsing their contents)
and aim directly for the device/ev/<product> device configuration

Change-Id: I1d844baa80a1846a2ee636b7063a81c319d6bc17
(squashed) roomservice

This is a combination of 10 commits.
The first commit's message is:
roomservice delivers you lunch combos from the CyanogenMod github.

This is the 2nd commit message:

fix roomservice formatting

This is the 3rd commit message:

support product names with _ in them

This is the 4th commit message:

fix roomservice to handle pagination

Change-Id: I4923c2f768094dbad8e06a72d9f27d46414030ab

This is the 5th commit message:

roomservice: Add lightweight dependencies to repositories

Roomservice can already fetch your cm_<device> without the need for a
manifest entry.

However, when working with common repositories, there is no way of
actually fetching them without adding to the manifest. This patch
introduces a lightweight dependency system. Each repository can have a
cm.dependencies in the following json format:

[
  {
    "repository": "repository_name_on_cm_organization"
    "target_path": "target/path"
  },
  ...
]

For instance, for cm_anzu I need android_device_semc_msm7x30-common and
android_device_semc_mogami-common. I would add both to cm.dependencies
as follows:

[
  {
    "repository": "android_device_semc_msm7x30-common",
    "target_path": "device/semc/msm7x30-common"
  },
  {
    "repository": "android_device_semc_mogami-common",
    "target_path": "device/semc/mogami-common"
  }
]

Roomservice would then fetch the anzu repository, parse the dependency
files and add/fetch/sync these additional repositories if they don't
exist already.

This also adds pretty printing to the output xml.

Change-Id: I9cc847adfc717a06439bc6094213ed6492343158

This is the 6th commit message:

roomservice: Add branch support to cm.dependencies

Allow the cm.dependencies entries to provide an optional "branch" for
the repository dependencies. Added to fully support
http://wiki.cyanogenmod.com/wiki/Integrated_kernel_building

Change-Id: I35b51920d296afa329411af6172c7bd9aeef4af8

This is the 7th commit message:

roomservice: Fill in dependencies for already-deployed repositories

Change-Id: I01fd408c9c4bfa78097c7f848b2556d2b2b180f3

This is the 8th commit message:

roomservice: Extend dependency-checks to devices in main manifest

CM currently keeps devices inherited from AOSP in the main manifest,
so take that into account as well when checking device paths

Change-Id: I9663f283617f237428b4eaa0cd60b5de2b86a7b9

This is the 9th commit message:

roomservice: fixup to fetch from evervolvs github

now reads from ev.dependencies to build local_manifest

Change-Id: I3c468e44164bf0ff50d87c3a5dca3b99eed1d78e

This is the 10th commit message:

roomservice: dont auto fetch deps

since we will only be using roomservice to fetch kernel repos in is
not a good idea to run it with lunch, instead add find_deps to manually
fetch the kernel repo for selected device

Change-Id: Id3b092f2bd2775d4f1af6b9dcd3cc52d16300b4c
Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
(squashed) cm inline kernel building

This is a combination of 7 commits.
The first commit's message is:
build: Inline kernel building as a buildtime task

Kernel image integration is now done in the build system. The
"one true way" of doing this is to download the kernel source
into kernel/TARGET_BOOTLOADER_NAME (by usage of the cm.dependencies
mechanism or otherwise), and defining the TARGET_KERNEL_CONFIG
variable in the device's BoardConfig makefile

If the kernel's location doesn't match the automagic location
(multi-device kernel source, for instance), TARGET_KERNEL_SOURCE
can be used to specify a kernel path (i.e.,
"TARGET_KERNEL_SOURCE := kernel/shared-whatever")

If the device requires out-of-kernel-tree modules to be built,
the TARGET_KERNEL_MODULES variable can be used, pointing to a
_make target_ that will build and install such modules. Definition
of such a target is the device author's responsibility, the only
restriction is that it is a normal makefile recipe (example
below)

Optionally (or as an alternative), a prebuilt binary can also be
defined at BoardConfig, by usage of the TARGET_PREBUILT_KERNEL
variable. This binary will be used if the kernel source is absent
(or undefined).

A minimal BoardConfig.mk should look something like this:

TARGET_KERNEL_CONFIG := cyanogenmod_<device>_defconfig
TARGET_PREBUILT_KERNEL := device/<vendor>/<device>/kernel

To include, for example, the TI WLAN modules, this can be used:

-----------------------------
TIWLAN_MODULES:
       make -C hardware/ti/wlan/wl1283/platforms/os/linux/ KERNEL_DIR=$(KERNEL_OUT) ARCH="arm" CROSS_COMPILE="arm-eabi-" TNETW=1273 RANDOM_MAC=n REPORT_LOG=n
       mv hardware/ti/wlan/wl1283/platforms/os/linux/tiwlan_drv.ko $(KERNEL_MODULES_OUT)
       make -C hardware/ti/wlan/wl1283_softAP/platforms/os/linux/ KERNEL_DIR=$(KERNEL_OUT) ARCH="arm" CROSS_COMPILE="arm-eabi-" TNETW=1273 REPORT_LOG=n
       mv hardware/ti/wlan/wl1283_softAP/platforms/os/linux/tiap_drv.ko $(KERNEL_MODULES_OUT)

TARGET_KERNEL_MODULES := TIWLAN_MODULES
---------------------------

Change-Id: I8634fa4c788a42dc6f62e62ca170825b66db126a

This is the 2nd commit message:

build: Fix kernel module building on Darwin/OSX

Darwin/OSX build host does not have module-init-tools which is
required to generated modules.dep file. Switch to modules.order
file marker which is always generated instead.

Change-Id: I20c0fccd905fa668202c3e7284a8778db3728a65

This is the 3rd commit message:

kernel: Change path to kernel/<vendor>/<device>

Derive the kernel path from the device's own path (just replace "device"
with "kernel")

Change-Id: Idd44a0489e1ce280adf5ec4d9cfe2385c75dd115

This is the 4th commit message:

kernel: Improve support for non-arm architectures

Remove hardwired references to the ARM arch and toolchains, and replace
them with the respective android build variables

Change-Id: Iae3eb548ca1d58ac808b5fa430d415283a809106

This is the 5th commit message:

kernel: Fix ARM building

The default android ARM compiler, arm-androideabi-, does NOT work
for the Linux kernel. Special-case the ARM architecture to target
the ARM_EABI_TOOLCHAIN path directly

Change-Id: Ib672c99f114cb89d5fda3343d4dc68810d042d35

This is the 6th commit message:

kernel: allow TARGET_KERNEL_MODULES to overwrite kernel modules

This is necessary to use compat-wireless since it needs to build a newer
version of cfg80211 (and sometimes mac80211) than the kernel sources version.
There are probably other instances of this type of need.

Change-Id: Ib5bf818286bc20987d8b9f9480a43f3e7690e239

This is the 7th commit message:

drewis: shorten warnings to fit on standard 80 column term window
Signed-off-by: Andrew Sutherland <dr3wsuth3rland@gmail.com>
kernel: use prebuilt by defalult

to build the kernel inline specifiy BUILD_KERNEL=true on the
command line. since the source is not automatically synced we let it
fallback to prebuilt even if BUILD_KERNEL is defined when the source
dir is not present.
to sync the source run find_deps after setting environment with envsetup.sh

Change-Id: Ic80cdd1ba0934d96ec75a9f11db26944f536f6a0
kernel.mk: make use of ccache when requested

Change-Id: I9b6e28711bd5f590a76ac2b62a50b1d2de014e3e
kernel: Fix ccache inclusion logic

Builds were broken when CCACHE was missing from the environment
Change-Id: Ie8d6048f4600f1dc9c298593a50e37af04b96438
kernel: allow true or 1 to define BUILD_KERNEL

equivalent changes should be made in device folders to avoid copying
prebuilt modules when BUILD_KERNEL is defined
eg. ifeq (,$(filter true 1,$(BUILD_KERNEL)))

Change-Id: Ifd0262f1ce9a97356532b74197d5ccb919ec1f05
fix up ota_from_target_files symlink detection.
ota: Remove cruft we don't care about

Skip the date check (downgrade to your content), and don't include
recovery in otapackages.
5.0.0 update: We want the recovery patchstuff back
Allow a device to generically define its own headers

We have a few cases of devices including specific versions of projects
just because of modified headers (msm_mdp.h comes to mind), and I just
had enough of ifdeffing header files for specific cases (the P990 needs
a lot of these).
Now... if a target defines a TARGET_SPECIFIC_HEADER_PATH, any headers in
there will take precedence over the standard ones; for example, on the
p990, I have

TARGET_SPECIFIC_HEADER_PATH := device/lge/p990/include

which makes, for example, the
device/lge/p990/include/hardware_legacy/AudioHardwareInterface.h be
used instead of
hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h
whenever a source file uses <hardware_legacy/AudioHardwareInterface.h>

Change-Id: I41b62668b60e3f62a6ebd3738d8d2675103a81e6a

build: fix target header overlay

LOCAL_C_INCLUDES as defined by the makefile should be put AFTER
the overlay includes so the overlay always takes precedence.

Change-Id: I489b2aab6dbacd9122d834f85e07b63ed1271f07
build: remove OpenWnn packages

we are going to remove these from the tree

Change-Id: Id4ad6ce8e8cda70f22253da56b806909e1a49fa6
Fix clean and clobber.

Change-Id: I6559ee0bd333fa7a16a53ad3da37e146283a9857
envsetup: add breakfast

Change-Id: I9ac8a4025d9ccfd5bee31a5fe9d1b490171bcbe7
add support for overriding build.prop settings.

Change-Id: Ie4224d608b7bcb0c2087bd77bc954f8f5f9b6495
envsetup: add evgerrit

Change-Id: I1635e51f7a97823a43d17284f64212a8ba61ce64
build in colors: Install outputs in blue/yellow [basic ics version]

"target prefix:" in yellow
"Install: file" in cyan

should be in a single command line else there are sync problems
in multithread (-j X)

These colors can be tuned in core/Makefile if you use a white terminal.
can be disabled with "export BUILD_WITH_COLORS=0"

Only the most important output is colored to reduce ics merge problems

Change-Id: I0e585079fde6900799ef209367a523d94a51cda5

Colors: add more colors to final build steps

also fix releasetool echo and visible recovery echos

Change-Id: Icf5d88468572f935610c544bf1d5d356ec9870d3

build in colors: host C/C++

Change-Id: Ic415cab53a2efa104c9d4b31ddbe8c8eb74e493d
build-with-colors: moar colors

- rename CL_PFX and CL_INS to better match the
  colors they show.
- add more colors.

Output of:
- most host stuff is yellow
- most target stuff is green
- installing/copying files is cyan
- import/export includes and notice files is cyan
- bootimage/recoveryimage is cyan
- and some more colors in many places ;)

Change-Id: I5532afa4ba608e0a7c408516dc9f912f9ca389f7
Note that update-api is a lie.

Change-Id: Idc2d92630e94ccbd60b5d5447c3762db8e5096f8
Print md5sum for otapackage zips.
Merge: Add MOTD option in updater-script.

This will create a message that is displayed while the user is flashing
the rom. To define the MOTD, just define 'PRODUCT_MOTD'. Currently this
is being used in the evervolv vendor for defining a seperate message
for each phone/device. As of right now the script splits the lines @
48 characters. You can also use \n for a new line.

Change-Id: I7830b7558523f25b5c1225d00497c56e4fb40882