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