blob: 5239366f60db474ddcd7c16abed969eb4308319f [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001# Copyright 2005 The Android Open Source Project
2
3LOCAL_PATH:= $(call my-dir)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08004
Elliott Hughesc0e919c2015-02-04 14:46:36 -08005# --
6
Elliott Hughesc0e919c2015-02-04 14:46:36 -08007ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Tom Cherry663fdfc2017-03-10 14:46:38 -08008init_options += \
9 -DALLOW_LOCAL_PROP_OVERRIDE=1 \
10 -DALLOW_PERMISSIVE_SELINUX=1 \
Josh Gaobf2dd482017-03-28 13:07:15 -070011 -DREBOOT_BOOTLOADER_ON_PANIC=1 \
Keun-young Park2ba5c812017-03-29 12:54:40 -070012 -DWORLD_WRITABLE_KMSG=1 \
13 -DDUMP_ON_UMOUNT_FAILURE=1
Elliott Hughesc0e919c2015-02-04 14:46:36 -080014else
Tom Cherry663fdfc2017-03-10 14:46:38 -080015init_options += \
16 -DALLOW_LOCAL_PROP_OVERRIDE=0 \
17 -DALLOW_PERMISSIVE_SELINUX=0 \
Josh Gaobf2dd482017-03-28 13:07:15 -070018 -DREBOOT_BOOTLOADER_ON_PANIC=0 \
Keun-young Park2ba5c812017-03-29 12:54:40 -070019 -DWORLD_WRITABLE_KMSG=0 \
20 -DDUMP_ON_UMOUNT_FAILURE=0
Elliott Hughesc0e919c2015-02-04 14:46:36 -080021endif
22
Keun-young Parkc4ffa5c2017-03-28 09:41:36 -070023ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
24init_options += \
25 -DSHUTDOWN_ZERO_TIMEOUT=1
26else
27init_options += \
28 -DSHUTDOWN_ZERO_TIMEOUT=0
29endif
30
Elliott Hughesf682b472015-02-06 12:19:48 -080031init_options += -DLOG_UEVENTS=0
32
33init_cflags += \
34 $(init_options) \
35 -Wall -Wextra \
36 -Wno-unused-parameter \
37 -Werror \
Tom Cherry2bc00142017-03-13 11:58:58 -070038 -std=gnu++1z \
Elliott Hughesc0e919c2015-02-04 14:46:36 -080039
40# --
41
Elliott Hughesf682b472015-02-06 12:19:48 -080042include $(CLEAR_VARS)
43LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080044LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080045 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080046 builtins.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080047 init.cpp \
Bowgo Tsaid2620172017-04-17 22:17:09 +080048 init_first_stage.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080049 keychords.cpp \
Keun-young Park8d01f632017-03-13 11:54:47 -070050 reboot.cpp \
Luis Hector Chavez9f97f472017-09-06 13:43:57 -070051 sigchld_handler.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080052 ueventd.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080053 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080054
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055LOCAL_MODULE:= init
Andres Moralesdb5f5d42015-05-08 08:30:33 -070056
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080057LOCAL_FORCE_STATIC_EXECUTABLE := true
58LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
59LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
60
Kenny Rootb5982bf2012-10-16 23:07:05 -070061LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080062 libinit \
Yabin Cui1051e102016-06-24 18:28:03 -070063 libbootloader_message \
Elliott Hughesf682b472015-02-06 12:19:48 -080064 libfs_mgr \
Sami Tolvanen99e3a922015-05-22 15:43:50 +010065 libfec \
66 libfec_rs \
Steven Morelande055d732017-10-05 18:50:22 -070067 libhidl-gen-utils \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070068 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080069 liblogwrap \
Alex Deymo705353a2017-01-11 14:03:11 -080070 libext4_utils \
Bowgo Tsaiaaf70e72017-03-02 00:03:56 +080071 libcutils \
Jeff Sharkey3b9c83a2016-02-03 14:44:44 -070072 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080073 libc \
Steve Muckleaf1a9bf2017-07-17 15:14:02 -070074 libseccomp_policy \
Elliott Hughesf682b472015-02-06 12:19:48 -080075 libselinux \
William Robertsbd2d9612015-08-04 14:23:04 -070076 liblog \
Josh Gao47763c32016-08-05 15:47:57 -070077 libcrypto_utils \
78 libcrypto \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000079 libc++_static \
Ed Tam438443e2015-04-13 16:29:05 -070080 libdl \
Alex Deymob0c39592017-01-11 14:37:50 -080081 libsparse \
Collin Mullinerf7e79b92016-06-01 21:03:55 +000082 libz \
Nick Kralevich8adb4d92017-01-03 08:37:54 -080083 libprocessgroup \
Elliott Hughesf8627ce2017-05-09 17:09:06 -070084 libavb \
85 libkeyutils \
Tom Cherrya97faba2017-09-15 15:44:04 -070086 libprotobuf-cpp-lite \
Tom Cherry2ae2f602017-12-14 01:58:17 +000087 libpropertyinfoserializer \
88 libpropertyinfoparser \
Stephen Smalleye46f9d52012-01-13 08:48:47 -050089
Jin Qian00456972017-07-06 11:43:45 -070090LOCAL_REQUIRED_MODULES := \
91 e2fsdroid \
92 mke2fs \
Jaegeuk Kim899ad552017-11-28 19:26:34 -080093 sload_f2fs \
94 make_f2fs \
Jin Qian00456972017-07-06 11:43:45 -070095
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -040096# Create symlinks.
Ying Wangdbb78d62014-11-24 15:43:34 -080097LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
98 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
99 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -0800100
Tom Cherry2ffd65e2017-07-26 14:17:09 -0700101LOCAL_SANITIZE := signed-integer-overflow
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800102include $(BUILD_EXECUTABLE)