// Copyright (C) 2018 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // package { default_applicable_licenses: ["Android-Apache-2.0"], } python_binary_host { name: "gen_asm_x86", main: "gen_asm_x86.py", srcs: ["gen_asm_x86.py"], libs: ["asm_defs_lib"], } python_binary_host { name: "gen_asm_tests_x86", main: "gen_asm_tests_x86.py", srcs: [ "gen_asm_tests_x86.py", "gen_asm_x86.py", ], libs: ["asm_defs_lib"], } python_library_host { name: "asm_defs_lib", srcs: ["asm_defs.py"], } filegroup { name: "libberberis_assembler_gen_inputs_x86_32", srcs: [ "instructions/insn_def_x86.json", "instructions/insn_def_x86_32.json", ], } filegroup { name: "libberberis_assembler_gen_inputs_x86_64", srcs: [ "instructions/insn_def_x86.json", "instructions/insn_def_x86_64.json", ], } genrule { name: "libberberis_assembler_gen_public_headers_x86_32", out: [ "berberis/assembler/gen_assembler_common_x86-inl.h", "berberis/assembler/gen_assembler_x86_32-inl.h", ], srcs: [":libberberis_assembler_gen_inputs_x86_32"], tools: ["gen_asm_x86"], cmd: "$(location gen_asm_x86) --binary-assembler $(out) $(in)", } genrule { name: "libberberis_assembler_gen_public_headers_x86_64", out: [ "berberis/assembler/gen_assembler_common_x86-inl.h", "berberis/assembler/gen_assembler_x86_64-inl.h", ], srcs: [":libberberis_assembler_gen_inputs_x86_64"], tools: ["gen_asm_x86"], cmd: "$(location gen_asm_x86) --binary-assembler $(out) $(in)", } cc_library_static { name: "libberberis_assembler", defaults: ["berberis_defaults"], host_supported: true, srcs: [ "machine_code.cc", ], generated_headers: [ "libberberis_assembler_gen_public_headers_x86_32", "libberberis_assembler_gen_public_headers_x86_64", ], export_generated_headers: [ "libberberis_assembler_gen_public_headers_x86_32", "libberberis_assembler_gen_public_headers_x86_64", ], static_libs: ["libberberis_base"], export_include_dirs: ["include"], export_static_lib_headers: ["libberberis_base"], } cc_genrule { name: "libberberis_assembler_test_gen_sources", host_supported: true, out: [ "gen_asm_tests_ref.S", "gen_asm_tests_test.cc", ], arch: { x86: { srcs: [":libberberis_assembler_gen_inputs_x86_32"], }, x86_64: { srcs: [":libberberis_assembler_gen_inputs_x86_64"], }, }, tools: ["gen_asm_tests_x86"], cmd: "$(location gen_asm_tests_x86) $(out) $(in) --fast", } cc_test_library { name: "libberberis_assembler_unit_tests", defaults: ["berberis_defaults"], host_supported: true, header_libs: ["berberis_test_utils_headers"], srcs: [ "assembler_test.cc", "machine_code_test.cc", ], generated_sources: ["libberberis_assembler_test_gen_sources"], static_libs: [ "libberberis_assembler", "libberberis_base", ], shared: { enabled: false, }, }