blob: af1e9d3750fd37a5ea839ef3b8215f40c2dce448 [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"],
98 static_executable: true,
99 srcs: [
100 "bootchart.cpp",
101 "builtins.cpp",
102 "init.cpp",
103 "init_first_stage.cpp",
104 "keychords.cpp",
105 "property_service.cpp",
106 "reboot.cpp",
107 "signal_handler.cpp",
108 "ueventd.cpp",
109 "watchdogd.cpp",
110 ],
111 include_dirs: [
112 "system/core/mkbootimg"
113 ],
114 static_libs: [
115 "libinit",
116 "libbootloader_message",
117 "libfs_mgr",
118 "libfec",
119 "libfec_rs",
120 "libsquashfs_utils",
121 "liblogwrap",
122 "libext4_utils",
123 "libcutils",
124 "libbase",
125 "libc",
126 "libselinux",
127 "liblog",
128 "libcrypto_utils",
129 "libcrypto",
130 "libc++_static",
131 "libdl",
132 "libsparse",
133 "libz",
134 "libprocessgroup",
135 "libavb",
136 "libkeyutils",
137 ],
138 symlinks: [
139 "sbin/ueventd",
140 "sbin/watchdogd",
141 ],
142}
143*/
144
145// Tests
146// ------------------------------------------------------------------------------
147
148cc_test {
149 name: "init_tests",
150 defaults: ["init_defaults"],
151 srcs: [
152 "devices_test.cpp",
153 "init_parser_test.cpp",
154 "init_test.cpp",
155 "property_service_test.cpp",
156 "service_test.cpp",
157 "util_test.cpp",
158 ],
159 shared_libs: [
160 "libbase",
161 "libcutils",
162 "libselinux",
163 ],
164 static_libs: ["libinit"],
165}
166
167subdirs = ["*"]