blob: 6cd47f476a82d0459a4ed3ef121b41751a29988e [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 \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080050 property_service.cpp \
Keun-young Park8d01f632017-03-13 11:54:47 -070051 reboot.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080052 signal_handler.cpp \
53 ueventd.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080054 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080056LOCAL_MODULE:= init
Andres Moralesdb5f5d42015-05-08 08:30:33 -070057LOCAL_C_INCLUDES += \
Andres Moralesdb5f5d42015-05-08 08:30:33 -070058 system/core/mkbootimg
59
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080060LOCAL_FORCE_STATIC_EXECUTABLE := true
61LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
62LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
63
Kenny Rootb5982bf2012-10-16 23:07:05 -070064LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080065 libinit \
Yabin Cui1051e102016-06-24 18:28:03 -070066 libbootloader_message \
Elliott Hughesf682b472015-02-06 12:19:48 -080067 libfs_mgr \
Sami Tolvanen99e3a922015-05-22 15:43:50 +010068 libfec \
69 libfec_rs \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070070 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080071 liblogwrap \
Alex Deymo705353a2017-01-11 14:03:11 -080072 libext4_utils \
Bowgo Tsaiaaf70e72017-03-02 00:03:56 +080073 libcutils \
Jeff Sharkey3b9c83a2016-02-03 14:44:44 -070074 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080075 libc \
76 libselinux \
William Robertsbd2d9612015-08-04 14:23:04 -070077 liblog \
Josh Gao47763c32016-08-05 15:47:57 -070078 libcrypto_utils \
79 libcrypto \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000080 libc++_static \
Ed Tam438443e2015-04-13 16:29:05 -070081 libdl \
Alex Deymob0c39592017-01-11 14:37:50 -080082 libsparse \
Collin Mullinerf7e79b92016-06-01 21:03:55 +000083 libz \
Nick Kralevich8adb4d92017-01-03 08:37:54 -080084 libprocessgroup \
Elliott Hughesf8627ce2017-05-09 17:09:06 -070085 libavb \
86 libkeyutils \
Stephen Smalleye46f9d52012-01-13 08:48:47 -050087
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -040088# Create symlinks.
Ying Wangdbb78d62014-11-24 15:43:34 -080089LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
90 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
91 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080092
Nick Kralevichf90b6532015-08-15 15:24:23 +000093LOCAL_SANITIZE := integer
Elliott Hughes1115c252015-06-10 22:43:51 -070094LOCAL_CLANG := true
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080095include $(BUILD_EXECUTABLE)