The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 1 | # Copyright 2005 The Android Open Source Project |
| 2 | |
| 3 | LOCAL_PATH:= $(call my-dir) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 4 | |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 5 | # -- |
| 6 | |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 7 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Tom Cherry | 663fdfc | 2017-03-10 14:46:38 -0800 | [diff] [blame] | 8 | init_options += \ |
| 9 | -DALLOW_LOCAL_PROP_OVERRIDE=1 \ |
| 10 | -DALLOW_PERMISSIVE_SELINUX=1 \ |
Josh Gao | bf2dd48 | 2017-03-28 13:07:15 -0700 | [diff] [blame] | 11 | -DREBOOT_BOOTLOADER_ON_PANIC=1 \ |
Keun-young Park | 2ba5c81 | 2017-03-29 12:54:40 -0700 | [diff] [blame] | 12 | -DWORLD_WRITABLE_KMSG=1 \ |
| 13 | -DDUMP_ON_UMOUNT_FAILURE=1 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 14 | else |
Tom Cherry | 663fdfc | 2017-03-10 14:46:38 -0800 | [diff] [blame] | 15 | init_options += \ |
| 16 | -DALLOW_LOCAL_PROP_OVERRIDE=0 \ |
| 17 | -DALLOW_PERMISSIVE_SELINUX=0 \ |
Josh Gao | bf2dd48 | 2017-03-28 13:07:15 -0700 | [diff] [blame] | 18 | -DREBOOT_BOOTLOADER_ON_PANIC=0 \ |
Keun-young Park | 2ba5c81 | 2017-03-29 12:54:40 -0700 | [diff] [blame] | 19 | -DWORLD_WRITABLE_KMSG=0 \ |
| 20 | -DDUMP_ON_UMOUNT_FAILURE=0 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 21 | endif |
| 22 | |
Keun-young Park | c4ffa5c | 2017-03-28 09:41:36 -0700 | [diff] [blame] | 23 | ifneq (,$(filter eng,$(TARGET_BUILD_VARIANT))) |
| 24 | init_options += \ |
| 25 | -DSHUTDOWN_ZERO_TIMEOUT=1 |
| 26 | else |
| 27 | init_options += \ |
| 28 | -DSHUTDOWN_ZERO_TIMEOUT=0 |
| 29 | endif |
| 30 | |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 31 | init_options += -DLOG_UEVENTS=0 |
| 32 | |
| 33 | init_cflags += \ |
| 34 | $(init_options) \ |
| 35 | -Wall -Wextra \ |
| 36 | -Wno-unused-parameter \ |
| 37 | -Werror \ |
Tom Cherry | 2bc0014 | 2017-03-13 11:58:58 -0700 | [diff] [blame] | 38 | -std=gnu++1z \ |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 39 | |
| 40 | # -- |
| 41 | |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 42 | include $(CLEAR_VARS) |
| 43 | LOCAL_CPPFLAGS := $(init_cflags) |
Tom Cherry | 618d310 | 2018-01-19 14:25:48 -0800 | [diff] [blame] | 44 | LOCAL_SRC_FILES := main.cpp |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 45 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 46 | LOCAL_MODULE:= init |
Andres Morales | db5f5d4 | 2015-05-08 08:30:33 -0700 | [diff] [blame] | 47 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 48 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 49 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) |
| 50 | |
Kenny Root | b5982bf | 2012-10-16 23:07:05 -0700 | [diff] [blame] | 51 | LOCAL_STATIC_LIBRARIES := \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 52 | libinit \ |
Yabin Cui | 1051e10 | 2016-06-24 18:28:03 -0700 | [diff] [blame] | 53 | libbootloader_message \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 54 | libfs_mgr \ |
Sami Tolvanen | 99e3a92 | 2015-05-22 15:43:50 +0100 | [diff] [blame] | 55 | libfec \ |
| 56 | libfec_rs \ |
Steven Moreland | e055d73 | 2017-10-05 18:50:22 -0700 | [diff] [blame] | 57 | libhidl-gen-utils \ |
Mohamad Ayyash | 030ef359 | 2015-04-08 17:59:19 -0700 | [diff] [blame] | 58 | libsquashfs_utils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 59 | liblogwrap \ |
Alex Deymo | 705353a | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 60 | libext4_utils \ |
Steve Muckle | af1a9bf | 2017-07-17 15:14:02 -0700 | [diff] [blame] | 61 | libseccomp_policy \ |
Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 62 | libcrypto_utils \ |
Alex Deymo | b0c3959 | 2017-01-11 14:37:50 -0800 | [diff] [blame] | 63 | libsparse \ |
Nick Kralevich | 8adb4d9 | 2017-01-03 08:37:54 -0800 | [diff] [blame] | 64 | libprocessgroup \ |
Elliott Hughes | f8627ce | 2017-05-09 17:09:06 -0700 | [diff] [blame] | 65 | libavb \ |
| 66 | libkeyutils \ |
Tom Cherry | a97faba | 2017-09-15 15:44:04 -0700 | [diff] [blame] | 67 | libprotobuf-cpp-lite \ |
Tom Cherry | 2ae2f60 | 2017-12-14 01:58:17 +0000 | [diff] [blame] | 68 | libpropertyinfoserializer \ |
| 69 | libpropertyinfoparser \ |
Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 70 | |
Jiyong Park | 787322c | 2018-06-01 19:26:42 +0900 | [diff] [blame] | 71 | shared_libs := \ |
| 72 | libcutils \ |
| 73 | libbase \ |
| 74 | liblog \ |
| 75 | libcrypto \ |
| 76 | libdl \ |
| 77 | libz \ |
Jiyong Park | 012171d | 2018-06-19 16:55:05 +0900 | [diff] [blame] | 78 | libselinux \ |
Jiyong Park | 787322c | 2018-06-01 19:26:42 +0900 | [diff] [blame] | 79 | |
| 80 | ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true) |
| 81 | # init is static executable for non-system-as-root devices, because the dynamic linker |
| 82 | # and shared libs are not available before /system is mounted, but init has to run |
| 83 | # before the partition is mounted. |
| 84 | LOCAL_STATIC_LIBRARIES += $(shared_libs) libc++_static |
| 85 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 86 | else |
| 87 | LOCAL_SHARED_LIBRARIES := $(shared_libs) libc++ |
| 88 | endif |
| 89 | shared_libs := |
| 90 | |
Jin Qian | 0045697 | 2017-07-06 11:43:45 -0700 | [diff] [blame] | 91 | LOCAL_REQUIRED_MODULES := \ |
| 92 | e2fsdroid \ |
| 93 | mke2fs \ |
Jaegeuk Kim | 899ad55 | 2017-11-28 19:26:34 -0800 | [diff] [blame] | 94 | sload_f2fs \ |
| 95 | make_f2fs \ |
Jin Qian | 0045697 | 2017-07-06 11:43:45 -0700 | [diff] [blame] | 96 | |
Jorge Lucangeli Obes | 24b2913 | 2016-10-27 10:33:03 -0400 | [diff] [blame] | 97 | # Create symlinks. |
Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 98 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ |
| 99 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ |
| 100 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd |
Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 101 | |
Tom Cherry | 2ffd65e | 2017-07-26 14:17:09 -0700 | [diff] [blame] | 102 | LOCAL_SANITIZE := signed-integer-overflow |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 103 | include $(BUILD_EXECUTABLE) |