blob: 5d6d9797e95c6a1e4b166d6a98122a40caf6015a [file] [log] [blame]
Tom Cherry14fc0132017-05-09 17:11:57 -07001//
2// Copyright (C) 2017 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
17cc_defaults {
18 name: "init_defaults",
19 cpp_std: "experimental",
20 sanitize: {
21 misc_undefined: ["integer"],
22 },
23 tidy_checks: ["-misc-forwarding-reference-overload"],
24 cppflags: [
25 "-DLOG_UEVENTS=0",
26 "-Wall",
27 "-Wextra",
28 "-Wno-unused-parameter",
29 "-Werror",
30 "-DALLOW_LOCAL_PROP_OVERRIDE=0",
31 "-DALLOW_PERMISSIVE_SELINUX=0",
32 "-DREBOOT_BOOTLOADER_ON_PANIC=0",
33 "-DWORLD_WRITABLE_KMSG=0",
34 "-DDUMP_ON_UMOUNT_FAILURE=0",
35 "-DSHUTDOWN_ZERO_TIMEOUT=0",
36 ],
37 product_variables: {
38 debuggable: {
39 cppflags: [
40 "-UALLOW_LOCAL_PROP_OVERRIDE",
41 "-DALLOW_LOCAL_PROP_OVERRIDE=1",
42 "-UALLOW_PERMISSIVE_SELINUX",
43 "-DALLOW_PERMISSIVE_SELINUX=1",
44 "-UREBOOT_BOOTLOADER_ON_PANIC",
45 "-DREBOOT_BOOTLOADER_ON_PANIC=1",
46 "-UWORLD_WRITABLE_KMSG",
47 "-DWORLD_WRITABLE_KMSG=1",
48 "-UDUMP_ON_UMOUNT_FAILURE",
49 "-DDUMP_ON_UMOUNT_FAILURE=1",
50 ],
51 },
52 eng: {
53 cppflags: [
54 "-USHUTDOWN_ZERO_TIMEOUT",
55 "-DSHUTDOWN_ZERO_TIMEOUT=1",
56 ],
57 },
58 },
59}
60
61cc_library_static {
62 name: "libinit",
63 defaults: ["init_defaults"],
64 srcs: [
65 "action.cpp",
66 "capabilities.cpp",
67 "descriptors.cpp",
68 "devices.cpp",
Tom Cherryed506f72017-05-25 15:58:59 -070069 "firmware_handler.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -070070 "import_parser.cpp",
71 "init_parser.cpp",
72 "log.cpp",
73 "parser.cpp",
74 "service.cpp",
Tom Cherryed506f72017-05-25 15:58:59 -070075 "uevent_listener.cpp",
76 "ueventd_parser.cpp",
Tom Cherry14fc0132017-05-09 17:11:57 -070077 "util.cpp",
78 ],
79 whole_static_libs: ["libcap"],
80 static_libs: [
81 "libbase",
82 "libselinux",
83 "liblog",
84 "libprocessgroup",
85 ],
86}
87
88/*
89This is not yet ready, see the below TODOs for what is missing
90
91cc_binary {
92 // TODO: Missing,
93 //LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
94 //LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
95
96 name: "init",
97 defaults: ["init_defaults"],
Jin Qian041f8492017-07-06 11:43:45 -070098 required: [
99 "e2fsdroid",
100 "mke2fs",
101 ],
Tom Cherry14fc0132017-05-09 17:11:57 -0700102 static_executable: true,
103 srcs: [
104 "bootchart.cpp",
105 "builtins.cpp",
106 "init.cpp",
107 "init_first_stage.cpp",
108 "keychords.cpp",
109 "property_service.cpp",
110 "reboot.cpp",
111 "signal_handler.cpp",
112 "ueventd.cpp",
113 "watchdogd.cpp",
114 ],
115 include_dirs: [
116 "system/core/mkbootimg"
117 ],
118 static_libs: [
119 "libinit",
120 "libbootloader_message",
121 "libfs_mgr",
122 "libfec",
123 "libfec_rs",
124 "libsquashfs_utils",
125 "liblogwrap",
126 "libext4_utils",
127 "libcutils",
128 "libbase",
129 "libc",
130 "libselinux",
131 "liblog",
132 "libcrypto_utils",
133 "libcrypto",
134 "libc++_static",
135 "libdl",
136 "libsparse",
137 "libz",
138 "libprocessgroup",
139 "libavb",
140 "libkeyutils",
141 ],
142 symlinks: [
143 "sbin/ueventd",
144 "sbin/watchdogd",
145 ],
146}
147*/
148
149// Tests
150// ------------------------------------------------------------------------------
151
152cc_test {
153 name: "init_tests",
154 defaults: ["init_defaults"],
155 srcs: [
156 "devices_test.cpp",
157 "init_parser_test.cpp",
158 "init_test.cpp",
159 "property_service_test.cpp",
160 "service_test.cpp",
161 "util_test.cpp",
162 ],
163 shared_libs: [
164 "libbase",
165 "libcutils",
166 "libselinux",
167 ],
168 static_libs: ["libinit"],
169}
170
171subdirs = ["*"]