1// 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 17// This produces human-readable asm_defines.s with the embedded compile-time constants. 18cc_object { 19 name: "asm_defines.s", 20 host_supported: true, 21 device_supported: true, 22 defaults: [ 23 "art_debug_defaults", 24 "art_defaults", 25 ], 26 header_libs: [ 27 "art_libartbase_headers", // For base/bit_utils.h 28 "jni_headers", 29 "libart_runtime_headers_ndk", 30 "libdexfile_all_headers", // For dex/modifiers.h 31 ], 32 target: { 33 android: { 34 header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up. 35 }, 36 linux_bionic: { 37 header_libs: ["libc_headers"], // TODO(b/153662223): Clean this up. 38 }, 39 }, 40 // Produce text file rather than binary. 41 cflags: ["-S"], 42 srcs: ["asm_defines.cc"], 43 apex_available: [ 44 "com.android.art.debug", 45 "com.android.art.release", 46 ], 47} 48 49// This extracts the compile-time constants from asm_defines.s and creates the header. 50cc_genrule { 51 name: "cpp-define-generator-asm-support", 52 host_supported: true, 53 device_supported: true, 54 srcs: [":asm_defines.s"], 55 out: ["asm_defines.h"], 56 tool_files: ["make_header.py"], 57 cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"", 58 target: { 59 darwin: { 60 enabled: false, 61 }, 62 }, 63 64 apex_available: [ 65 "com.android.art.debug", 66 "com.android.art.release", 67 ], 68} 69 70cc_library_headers { 71 name: "cpp-define-generator-definitions", 72 host_supported: true, 73 export_include_dirs: ["."], 74 75 apex_available: [ 76 "com.android.art.debug", 77 "com.android.art.release", 78 ], 79} 80 81python_binary_host { 82 name: "cpp-define-generator-test", 83 main: "make_header_test.py", 84 srcs: [ 85 "make_header.py", 86 "make_header_test.py", 87 ], 88 test_suites: ["general-tests"], 89} 90