BUILD.gn 4.1 KB
Newer Older
Z
zhong_ning 已提交
1 2 3 4 5 6 7 8 9 10 11
# Copyright (c) 2021 Huawei Device Co., Ltd.
# 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
H
handyohos 已提交
12
# limitations under the License.
X
xionglei6 已提交
13
import("//base/startup/init_lite/begetd.gni")
Z
zhong_ning 已提交
14 15
import("//build/ohos.gni")

H
handyohos 已提交
16 17
ohos_executable("begetctl") {
  sources = [
X
xionglei6 已提交
18
    "bootchart_cmd.c",
X
xionglei6 已提交
19
    "init_cmd_reboot.c",
H
handyohos 已提交
20 21
    "main.c",
    "misc_daemon.cpp",
Y
yanghongliang 已提交
22
    "param_cmd.c",
H
handyohos 已提交
23
    "service_control.c",
X
xionglei6 已提交
24
    "shell/shell_bas.c",
H
handyohos 已提交
25 26 27 28
  ]

  defines = [ "INIT_AGENT" ]

Y
yanghongliang 已提交
29 30 31 32
  if (defined(product_name) && product_name == "rk3568") {
    defines += [ "PRODUCT_RK" ]
  }

Z
zhong_ning 已提交
33
  include_dirs = [
X
xionglei6 已提交
34
    ".",
X
xionglei6 已提交
35
    "shell",
H
handyohos 已提交
36 37
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
Z
zhong_ning 已提交
38 39
    "//base/startup/init_lite/interfaces/innerkits/include",
    "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",
H
handyohos 已提交
40 41
    "//base/startup/init_lite/services/include/param/",
    "//base/startup/init_lite/services/param/include",
X
xionglei6 已提交
42
    "//base/startup/init_lite/services/loopevent/include",
H
handyohos 已提交
43
    "//third_party/bounds_checking_function/include",
Z
zhong_ning 已提交
44 45
  ]
  deps = [
46
    "//base/startup/init_lite/interfaces/innerkits:libbegetutil",
H
handyohos 已提交
47 48 49
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
    "//third_party/bounds_checking_function:libsec_static",
Z
zhong_ning 已提交
50
  ]
H
handyohos 已提交
51

X
xionglei6 已提交
52 53 54
  if (param_test) {
    sources += [ "//base/startup/init_lite/test/plugintest/plugin_param_cmd.c" ]
    deps += [
55
      "//base/startup/init_lite/interfaces/innerkits:libbeget_proxy",
X
xionglei6 已提交
56 57
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/param/watcher:param_watcheragent",
X
xionglei6 已提交
58
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
X
xionglei6 已提交
59 60 61 62 63 64 65
    ]
    defines += [
      "OHOS_SERVICE_DUMP",
      "INIT_TEST",
    ]
  }

X
xionglei6 已提交
66 67 68 69 70 71 72 73 74 75 76
  if (build_selinux) {
    include_dirs += [
      "//third_party/selinux/libselinux/include/",
      "//base/security/selinux/interfaces/policycoreutils/include/",
    ]
    deps += [
      "//third_party/selinux:libselinux",
    ]
    defines += [ "WITH_SELINUX" ]
  }

H
handyohos 已提交
77
  symlink_target_name = [
Y
yanghongliang 已提交
78 79 80 81 82 83 84 85 86
    "misc_daemon",
    "reboot",
    "devctl",
    "service",
    "service_control",
    "start_service",
    "stop_service",
    "service",
    "param",
H
handyohos 已提交
87 88
  ]

Z
zhong_ning 已提交
89 90
  install_images = [ "system" ]
  install_enable = true
H
handyohos 已提交
91

Z
zhong_ning 已提交
92 93
  part_name = "init"
}
X
xionglei6 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

ohos_executable("paramshell") {
  sources = [
    "param_cmd.c",
    "shell/shell_bas.c",
    "shell/shell_main.c",
  ]

  defines = [ "INIT_AGENT" ]

  include_dirs = [
    ".",
    "shell",
    "//base/startup/init_lite/services/include",
    "//base/startup/init_lite/services/log",
    "//base/startup/init_lite/interfaces/innerkits/include",
    "//base/startup/syspara_lite/interfaces/innerkits/native/syspara/include",
    "//base/startup/init_lite/services/include/param/",
X
xionglei6 已提交
112
    "//base/startup/init_lite/services/loopevent/include",
X
xionglei6 已提交
113 114 115 116 117 118 119 120 121 122 123 124
    "//base/startup/init_lite/services/param/include",
    "//third_party/bounds_checking_function/include",
  ]
  deps = [
    "//base/startup/init_lite/services/log:agent_log",
    "//base/startup/init_lite/services/param:param_client",
    "//third_party/bounds_checking_function:libsec_static",
  ]

  if (param_test) {
    sources += [ "//base/startup/init_lite/test/plugintest/plugin_param_cmd.c" ]
    deps += [
125
      "//base/startup/init_lite/interfaces/innerkits:libbeget_proxy",
X
xionglei6 已提交
126 127
      "//base/startup/init_lite/services/loopevent:loopevent",
      "//base/startup/init_lite/services/param/watcher:param_watcheragent",
X
xionglei6 已提交
128
      "//base/startup/syspara_lite/interfaces/innerkits/native/syspara:syspara",
X
xionglei6 已提交
129 130 131 132
    ]
    defines += [
      "OHOS_SERVICE_DUMP",
      "INIT_TEST",
X
xionglei6 已提交
133 134 135 136 137 138 139 140
    ]
  }

  install_images = [ "system" ]
  install_enable = true

  part_name = "init"
}