Home | History | Annotate | Download | only in cpp-define-generator
      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.
     18 cc_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     include_dirs: [
     27         "art/libartbase",
     28         "art/libdexfile",
     29         "art/libartbase",
     30         "art/runtime",
     31         "system/core/base/include",
     32     ],
     33     // Produce text file rather than binary.
     34     cflags: ["-S"],
     35     srcs: ["asm_defines.cc"],
     36 }
     37 
     38 // This extracts the compile-time constants from asm_defines.s and creates the header.
     39 cc_genrule {
     40     name: "cpp-define-generator-asm-support",
     41     host_supported: true,
     42     device_supported: true,
     43     srcs: [":asm_defines.s"],
     44     out: ["asm_defines.h"],
     45     tool_files: ["make_header.py"],
     46     cmd: "$(location make_header.py) \"$(in)\" > \"$(out)\"",
     47 }
     48 
     49 cc_library_headers {
     50     name: "cpp-define-generator-definitions",
     51     host_supported: true,
     52     export_include_dirs: ["."],
     53 }
     54 
     55 python_binary_host {
     56     name: "cpp-define-generator-test",
     57     main: "make_header_test.py",
     58     srcs: [
     59         "make_header.py",
     60         "make_header_test.py",
     61     ],
     62     test_suites: ["general-tests"],
     63 }
     64