blob: d6c76639602e18a8023fd15bdc7be3e8b8103103 [file] [log] [blame]
Colin Crossfe6064a2016-08-30 13:49:26 -07001//
2// Copyright (C) 2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
David Srbecky0adf4d82018-10-01 18:17:45 +010017// This produces human-readable asm_defines.s with the embedded compile-time constants.
18cc_object {
19 name: "asm_defines.s",
Colin Crossfe6064a2016-08-30 13:49:26 -070020 host_supported: true,
David Srbecky0adf4d82018-10-01 18:17:45 +010021 device_supported: true,
Colin Crossfe6064a2016-08-30 13:49:26 -070022 defaults: [
23 "art_debug_defaults",
24 "art_defaults",
25 ],
Paul Duffineafeeb22019-07-19 10:22:32 +010026 header_libs: [
27 "art_libartbase_headers", // For base/bit_utils.h
Orion Hodson00cb81d2020-04-03 06:47:07 +010028 "jni_headers",
Paul Duffineafeeb22019-07-19 10:22:32 +010029 "libart_runtime_headers_ndk",
Martin Stjernholme6afa952020-04-09 00:13:45 +010030 "libc_headers", // TODO(b/153662223): Clean this up.
Paul Duffineafeeb22019-07-19 10:22:32 +010031 "libdexfile_all_headers", // For dex/modifiers.h
David Sehr334b9d72018-02-12 18:27:56 -080032 ],
David Srbecky0adf4d82018-10-01 18:17:45 +010033 // Produce text file rather than binary.
34 cflags: ["-S"],
35 srcs: ["asm_defines.cc"],
Jiyong Park7c2f69e2020-01-15 15:43:32 +090036 apex_available: [
37 "com.android.art.debug",
38 "com.android.art.release",
39 ],
Colin Crossfe6064a2016-08-30 13:49:26 -070040}
Igor Murashkin2bb70d32017-02-06 10:34:14 -080041
David Srbecky0adf4d82018-10-01 18:17:45 +010042// This extracts the compile-time constants from asm_defines.s and creates the header.
43cc_genrule {
Dan Willemsen2ca27802017-09-27 14:57:43 -070044 name: "cpp-define-generator-asm-support",
David Srbecky0adf4d82018-10-01 18:17:45 +010045 host_supported: true,
46 device_supported: true,
47 srcs: [":asm_defines.s"],
David Srbecky766e74f2018-10-02 17:12:24 +010048 out: ["asm_defines.h"],
David Srbecky0adf4d82018-10-01 18:17:45 +010049 tool_files: ["make_header.py"],
50 cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"",
Elliott Hughes221dfa62019-09-03 16:03:56 -070051 target: {
52 darwin: {
53 enabled: false,
54 },
55 },
Jiyong Park71f661c2020-04-28 18:20:43 +090056
57 apex_available: [
58 "com.android.art.debug",
59 "com.android.art.release",
60 ],
David Srbecky0adf4d82018-10-01 18:17:45 +010061}
62
63cc_library_headers {
64 name: "cpp-define-generator-definitions",
65 host_supported: true,
66 export_include_dirs: ["."],
Jiyong Park71f661c2020-04-28 18:20:43 +090067
68 apex_available: [
69 "com.android.art.debug",
70 "com.android.art.release",
71 ],
David Srbecky0adf4d82018-10-01 18:17:45 +010072}
73
74python_binary_host {
75 name: "cpp-define-generator-test",
76 main: "make_header_test.py",
77 srcs: [
78 "make_header.py",
79 "make_header_test.py",
80 ],
81 test_suites: ["general-tests"],
Igor Murashkin2bb70d32017-02-06 10:34:14 -080082}