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. 18package { 19 // See: http://go/android-license-faq 20 // A large-scale-change added 'default_applicable_licenses' to import 21 // all of the 'license_kinds' from "art_license" 22 // to get the below license kinds: 23 // SPDX-license-identifier-Apache-2.0 24 default_applicable_licenses: ["art_license"], 25} 26 27cc_object { 28 name: "asm_defines.s", 29 host_supported: true, 30 device_supported: true, 31 defaults: ["art_debug_defaults"], 32 header_libs: [ 33 "art_libartbase_headers", // For base/bit_utils.h 34 "jni_headers", 35 "libart_headers", 36 "libdexfile_all_headers", // For dex/modifiers.h 37 ], 38 cflags: [ 39 // Produce text file rather than binary. 40 "-S", 41 // Suppress an error about the unused -c that precedes -S. 42 "-Wno-unused-command-line-argument", 43 ], 44 srcs: ["asm_defines.cc"], 45 apex_available: [ 46 "com.android.art", 47 "com.android.art.debug", 48 ], 49} 50 51// This extracts the compile-time constants from asm_defines.s and creates the header. 52cc_genrule { 53 name: "cpp-define-generator-asm-support", 54 host_supported: true, 55 device_supported: true, 56 srcs: [":asm_defines.s"], 57 out: ["asm_defines.h"], 58 tool_files: ["make_header.py"], 59 cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"", 60 target: { 61 darwin: { 62 enabled: false, 63 }, 64 windows: { 65 // When the module is enabled globally in the soong_config_variables 66 // stanza above, it gets enabled on windows too. Hence we need to 67 // disable it explicitly. 68 // TODO(b/172480617): Clean up with that. 69 enabled: false, 70 }, 71 }, 72 73 apex_available: [ 74 "com.android.art", 75 "com.android.art.debug", 76 ], 77} 78 79cc_library_headers { 80 name: "cpp-define-generator-definitions", 81 defaults: ["art_defaults"], 82 host_supported: true, 83 export_include_dirs: ["."], 84 85 apex_available: [ 86 "com.android.art", 87 "com.android.art.debug", 88 ], 89} 90 91python_binary_host { 92 name: "cpp-define-generator-test", 93 main: "make_header_test.py", 94 srcs: [ 95 "make_header.py", 96 "make_header_test.py", 97 ], 98 test_suites: ["general-tests"], 99} 100