Commit graph

34344 commits

Author SHA1 Message Date
Dan Willemsen
fd69421a70 Merge "Create 'androidmk' rule to automatically run androidbp" into master-soong 2015-06-19 01:11:59 +00:00
Dan Willemsen
e1acfc85ce Merge "Fix bootstrap.bash -r with Android.bp" into master-soong 2015-06-19 00:52:01 +00:00
Dan Willemsen
bf9207aceb Create 'androidmk' rule to automatically run androidbp
This finds any Android.bp files with Android modules defined, and if
there isn't an Android.mk file in the same directory, it will run
androidbp to generate one in $OUT

Change-Id: Ie8aef492e8cd28f6c314ce1254730975a1b8991f
2015-06-18 12:56:43 -07:00
Colin Cross
8f101b45fc Allow common.Glob to be called by singletons
Make common.Glob take an interface that is the intersection of
blueprint.ModuleContext and blueprint.SingletonContext used by
Glob and GlobRule, allowing it to be called on either.  Also
move ExpandSources and Glob into AndroidModuleContext.

Change-Id: I8d1a3160c5dd201033afdb37210e82d8065b137d
2015-06-17 15:36:48 -07:00
Colin Cross
1f8c52be73 Add per-directory build targets
Build a map of blueprint directory to modules built from that
directory, and then add phony rules to build.ninja that emulate
the behavior of mma in the current build system.

Also fixes checkbuild to depend on checkbuild files and installable
files, but not installed files.

Change-Id: I8bad6e93387940df7439dbd4554f6d79f924c65f
2015-06-17 10:18:35 -07:00
Colin Cross
6a745c6ad0 Fix gofmt
Change-Id: I031ecd7f28a0fb29d8c5d322e4910cc4947b2fb8
2015-06-16 16:44:05 -07:00
Dan Willemsen
360a39c0f1 androidbp: Defer local path printing
This will defer printing the local path until the first module or
definition. Usually, there's a copyright comment at the top of the file
that will be now be printed first, then the LOCAL_PATH.

Change-Id: I349f7e30eaa99dcfdc73e96248774927a13be8cb
2015-06-11 18:26:25 -07:00
Dan Willemsen
98c93e9fbf Fix bootstrap.bash -r with Android.bp
Change-Id: I8182e57105b1c17254e082f6b72d2504befb7870
2015-06-10 18:07:39 -07:00
Ying Wang
3828490eef Allow to specify the output Android.mk file path.
- Allow to specify the output Android.mk file path.
  We need this to generate Android.mk into the out diretory.
- Makefile strings don't need quotes.
- Return non-zero exit code if it fails.
- Other trivial format changes.

Change-Id: I460083f6e0a2707cd4a6fe0bef3f8ae7562e9edb
2015-06-03 11:14:13 -07:00
Andres Morales
199ee3943e Merge "[androidbp] address comments aosp/149217" into master-soong 2015-05-27 01:44:24 +00:00
Colin Cross
e5ee41274a Rename Blueprints to Android.bp
Rename module definition files to Android.bp to avoid conflicts
with another project called Blueprint.

Change-Id: I105a07555eb7890f56120deab9036cf9ae5d8525
2015-05-20 13:10:32 -07:00
Colin Cross
3ab7d8835f Use proptools.CloneEmptyProperties
CloneEmptyProperties is much faster than CloneProperties followed
by ZeroProperties.  Cuts >100ms off soong_build runtime, which will
become more important when we start calling soong_build a second
time to automatically generate documentation.

Change-Id: I45d948b36d9937a21b13dab068c3ce9a60b5a59b
2015-05-19 13:03:01 -07:00
Colin Cross
d81496084b Fix repeated ccCmd dependencies on object files
ccCmd was being added as a dependency each time through the object
file loop, tripling the size of the build.ninja file.  Create a
new slice for dependencies on each object file.

Change-Id: Id768d8ea6e5300c15f0f1a5fac5fcbdfdf5e6b0a
2015-05-13 00:50:25 +00:00
Colin Cross
7d42bdad16 Merge "androidmk: make class+suffix into generic prefix" into master-soong 2015-05-13 00:50:10 +00:00
Colin Cross
f9964d5a8d Use far dependency for genrule tool
A far dependency will not inherit any of the variations from the current
module, allowing a device genrule to depend on a host tool to generate
the sources.

Change-Id: I7f622ddd31a81d605f55d5946a109ea53e864084
2015-05-12 20:46:49 +00:00
Colin Cross
3d289a4037 androidmk: make class+suffix into generic prefix
Allow variables to have a prefix, for example "target.arm.cflags".
Each prefixed name separated by a "." will become a nested map
property.

Change-Id: Ib982b8dcaf2f1dc919acb2767e769950916c50f7
2015-05-12 13:36:11 -07:00
Colin Cross
eae04e04ac androidmk: convert stems prefixed with LOCAL_MODULE to suffix
Convert stem: LOCAL_MODULE + "32" to suffix: "32"

Change-Id: I7126e814bd35f502196abc087b5d0afb825d3665
2015-05-12 11:38:37 -07:00
Colin Cross
a93000350a androidmk: strip LOCAL_PATH from export_include_dirs and local_include_dirs
Sort LOCAL_INCLUDE_DIRS values into local_include_dir include_dirs based
on whether they are prefixed with $(LOCAL_PATH)/, and strip $(LOCAL_PATH)/
from export_include_dirs.

Change-Id: I20f9f0f8385088660855c7ccf85b7933ff2dcd44
2015-05-12 11:38:37 -07:00
Colin Cross
f22982707d Check that local, top level, and exported include paths exist
Require directories listed in the include_dirs, local_include_dirs, and
exported_include_dirs properties to exist.

Change-Id: I5b079bd2c607839bb28dae43801cd7345bde2299
2015-05-12 11:36:53 -07:00
Colin Cross
4e13f6d573 androidmk: clean up nested comparisons for local variable names
Change-Id: If84dbce05f1a28a562c8dba3eceedfe92b8d5ba5
2015-05-12 18:18:05 +00:00
Colin Cross
f5f5dec662 androidmk: use a single map for property list
Change-Id: I08019443f5fcb012190486e9144a1bfec26761b4
2015-05-12 18:17:40 +00:00
Andres Morales
8ae47de451 [androidbp] address comments aosp/149217
Change-Id: I8b4bbbeef6c2c11080a4bc30820b2200ba78b7e9
2015-05-11 17:54:50 -07:00
Colin Cross
d3ba039f74 Separate HostOrDevice out of Arch
Take HostOrDevice out of Arch, and put it into AndroidModuleBase
instead.  Also separate out the host vs. device mutator from
ArchMutator.  This will make it possible for genrules to depend
on a host tool, regardless of which host arches it is compiled
for.

Change-Id: I22bbfd28b65c3eebdfa101a712f90dd615148dc8
2015-05-09 00:10:19 +00:00
Andres Morales
af11df1538 androidbp: handle suffix props, conditionals, map assignments
Change-Id: I6aec388e72d960d80943620024c2d16d51a0b095
2015-05-08 15:43:24 -07:00
Colin Cross
1fc2e892ab Add system/security and system/keymaster to root Blueprints
Change-Id: I63c9e59b33f4da52896643f568af4ed8183b0849
2015-05-07 16:09:44 -07:00
Colin Cross
2ba19d90c3 Add cc_benchmark module type
Change-Id: I83bed375fa77518baaab4260e714a9368761f0bc
2015-05-07 16:09:34 -07:00
Colin Cross
0af4b8468b Add support for building on Darwin hosts
Add toolchain and build rules for building on Darwin.

Change-Id: I78e21f4051b2941182121b28c9ddfa24396ada41
2015-05-07 14:09:48 -07:00
Colin Cross
5e1efb5812 Update build.ninja.in
Update build.ninja.in after Ib4bd1e0abc58ab514a7dd4a01008af645d6a3d13

Change-Id: I069a1334097966a748deacfc58d716d3ae554fef
2015-05-05 17:20:37 -07:00
Colin Cross
1ae151b814 Merge "Build rule updates for aosp" into master-soong 2015-05-05 23:47:37 +00:00
Colin Cross
74d1ec0c2c Build rule updates for aosp
Various build rule changes to match AOSP:
Add libunwind_llvm and libdl as dependencies for libc++ on device
Always add libcompiler_rt-extras as a dependency
Add libm, libc, and libdl as depnendencies for libc++ static binaries
Disable some clang warnings, and add some clang filtered cflags
Add -fstack-protector to host linux builds
Add jack_flags property to java modules (currently ignored)

Change-Id: Ic0da617bdeaf25f58cb8298dd9ea91b7d6509151
2015-05-04 17:02:18 -07:00
Colin Cross
66e70f0d62 Merge "Add per target archtecture properties" into master-soong 2015-05-04 21:05:40 +00:00
Colin Cross
c4c6df4214 Merge "cc: remove incorrect arch cflags" into master-soong 2015-05-04 21:05:34 +00:00
Andres Morales
da8706fed8 Initial androidbp translator.
Translates Android.bp files back to Android.mk

Change-Id: Ib4bd1e0abc58ab514a7dd4a01008af645d6a3d13
2015-04-30 18:51:10 -07:00
Colin Cross
b05bff2f26 Add per target archtecture properties
At least libcutils and boringssl need to set source files that
apply to x86 or x86_64, but only on the host or on the device.
Add new properties that can contain arch variant properties:
target.android_arm
target.android_arm64
target.android_mips
target.android_mips64
target.android_x86
target.android_x86_64
target.linux_x86
target.linux_x86_64
target.darwin_x86
target.darwin_x86_64

Change-Id: I5a7076653a7367a63daa7f7e34a6a28f5cbdfbe7
2015-04-30 16:35:06 -07:00
Colin Cross
6bedfaaeea cc: remove incorrect arch cflags
arm and host builds both got some extra global cflags from arm64,
remove them.

Change-Id: Ie4dcbb114714f4ae8b45304755978d66e13e889c
2015-04-30 16:35:03 -07:00
Colin Cross
3d7678f9d6 Fix java resource globbing
Handle java resource globbing in two passes, the first on the
list of resource dirs to produce a list of directories, and the
second to glob for files inside those directories using **/*.
Fixes incorrect jarSpec dir errors when the resource directories
list contains globs.

Change-Id: Icea5d8178336eb7de4ad91a9acba4822423d9f60
2015-04-29 14:59:23 -07:00
Colin Cross
6a114caa17 Fix globbing bugs
Fix two bugs in globbing: check for excludes before globs so that
excludes that contain globs are not treated as includes, and
remove the Generator attribute from globRule so that the rule
reruns if the command line changes, for example if the glob or
excludes list changes.

Change-Id: I216c0c925eeb00a3814300548c005bcdf64a1f30
2015-04-29 14:59:23 -07:00
Colin Cross
6f23ef6bf3 Move globbing on top of pathtools.GlobWithExcludes
pathtools.GlobWithExcludes contains all the features of
glob.GlobWithDepFile now, make GlobWithDepFile a wrapper
around GlobWithExcludes that writes the results to a file.

Change-Id: Ie75d9042845505f499aac7fa00d3c90f8ecab4f7
2015-04-29 14:59:23 -07:00
Colin Cross
d8e780df69 cc: make static or shared cflags apply to all source files
Make static or shared cflags properties apply to all source files,
not just the source files defined in the static or shared block.
Needed for libunwind, which passes -DUNW_ADDITIONAL_PREFIX to source
files for the static library, but not for the shared library.

Change-Id: I3cd88cc1099e505eeee077c697db00de22a8b03a
2015-04-29 14:59:23 -07:00
Colin Cross
0607cf7daa java: add genrule support to java builds
Add support for source files generated by genrule or gensrcs to
java builds.

Change-Id: I39762b2ab65fa4cf92724300edc4ba995845ce92
2015-04-29 14:59:07 -07:00
Colin Cross
d350ecd102 Add support for genrule
Add genrule, which uses a host executable (possibly built by the
build system) to generate a single source file.  This differs slightly
from gensrcs, which takes a list of sources and translates them through
a host executable to individual source files.

Change-Id: I94bda62c4c53fb3f3817def190e6a7561508d297
2015-04-29 14:58:16 -07:00
Dan Albert
c3144b1553 ndk: Use prebuilt NDK CRT objects.
Change-Id: Ie8d58fa7c4ef2a62338c20c3078603ac98be0f9c
2015-04-29 10:27:00 -07:00
Colin Cross
eb1e6cc62c java: add missing tool dependencies
Add missing dependencies on the jar, aapt, signapk, and zipalign
tools.

Change-Id: Ib70fdd41daf84c474f72e1219bf3d02931fcefd7
2015-04-28 15:34:45 -07:00
Colin Cross
5adac8a045 java: delete package-export.apk before rebuilding
Delete package-export.apk before rebuilding to avoid aapt warnings
about using -f on existing packages.

Change-Id: I189486c4b3bd5fa46eff2e3b6a244d28329e7f02
2015-04-28 15:34:44 -07:00
Colin Cross
a8a93d3769 cc: fix native tests
Add libgtest to native test dependencies before adding stl
dependencies to resolve link errors between libgtest and
libc++_static.

Install device native tests to /dava/nativetest32 and
/data/nativetest64.

Change-Id: I6d9ddba8d5cdbacaa86cae0833fd7e656657e4d9
2015-04-28 15:34:08 -07:00
Colin Cross
2732e9a43f cc: improve combined static/shared libraries
Allow combined static/shared libraries to specify separate dependencies,
and recompile objects if static or shared cflags are set.

Change-Id: I9fd71d8debd5ade5637389ee38e793082d6d18bb
2015-04-28 15:34:01 -07:00
Colin Cross
18b6dc5d25 cc: fix host gcc libraries
Host gcc libraries should only apply to static binaries, not all
static libraries.  Add c.staticBinary(), and rework everything
else to use c.static(), removing c.shared().

Change-Id: I8addae9b6848010cef94d873f48e7e358e4f5059
2015-04-28 14:12:00 -07:00
Colin Cross
c1e814dbf1 cc: remove --fix-cortex-a8 from non-Cortex A8 devcies
Pass --fix-cortex-a8 only on Cortex A8 and generic ARM builds, and
pass --no-fix-cortex-a8 on everything else.

Change-Id: I4b12afee4de443b5d55df66be3c6a05251715e31
2015-04-28 14:11:56 -07:00
Colin Cross
e11befc4e4 cc: finish unexporting DepNames and Flags
gorename missed DepNames and Flags on CCBase and CCLinked

Change-Id: I926227eef51fdbe10f22b743bf3e2265cdc6a9ad
2015-04-28 14:11:53 -07:00
Colin Cross
11f5654ba6 Extract jar files to different directory than compiling
Now that we use extractPrebuilts to extract compiled classes from
jars after jarjar, it needs to extract to a different directory
than used when compiling.  Extract them to extracted/classes.  Also
move the classes.list and resources.list file out of the classes
directory so they don't find themselves and end up in downstream
jars.

Change-Id: I070323466858edc7e33e14207c98f77d540882f3
2015-04-27 14:32:36 -07:00