| 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))) | 
| Nick Kralevich | d34e407 | 2015-04-28 12:39:41 -0700 | [diff] [blame] | 8 | init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_PERMISSIVE_SELINUX=1 | 
| Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 9 | else | 
| Nick Kralevich | d34e407 | 2015-04-28 12:39:41 -0700 | [diff] [blame] | 10 | init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_PERMISSIVE_SELINUX=0 | 
| Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 11 | endif | 
 | 12 |  | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 13 | init_options += -DLOG_UEVENTS=0 | 
 | 14 |  | 
 | 15 | init_cflags += \ | 
 | 16 |     $(init_options) \ | 
 | 17 |     -Wall -Wextra \ | 
 | 18 |     -Wno-unused-parameter \ | 
 | 19 |     -Werror \ | 
| Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 20 |  | 
 | 21 | # -- | 
 | 22 |  | 
| Lee Campbell | 220ca84 | 2015-07-30 09:27:11 -0700 | [diff] [blame] | 23 | # If building on Linux, then build unit test for the host. | 
 | 24 | ifeq ($(HOST_OS),linux) | 
 | 25 | include $(CLEAR_VARS) | 
 | 26 | LOCAL_CPPFLAGS := $(init_cflags) | 
 | 27 | LOCAL_SRC_FILES:= \ | 
 | 28 |     parser/tokenizer.cpp \ | 
 | 29 |  | 
 | 30 | LOCAL_MODULE := libinit_parser | 
 | 31 | LOCAL_CLANG := true | 
 | 32 | include $(BUILD_HOST_STATIC_LIBRARY) | 
 | 33 |  | 
 | 34 | include $(CLEAR_VARS) | 
 | 35 | LOCAL_MODULE := init_parser_tests | 
 | 36 | LOCAL_SRC_FILES := \ | 
 | 37 |     parser/tokenizer_test.cpp \ | 
 | 38 |  | 
 | 39 | LOCAL_STATIC_LIBRARIES := libinit_parser | 
 | 40 | LOCAL_CLANG := true | 
 | 41 | include $(BUILD_HOST_NATIVE_TEST) | 
 | 42 | endif | 
 | 43 |  | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 44 | include $(CLEAR_VARS) | 
 | 45 | LOCAL_CPPFLAGS := $(init_cflags) | 
 | 46 | LOCAL_SRC_FILES:= \ | 
| Tom Cherry | fa0c21c | 2015-07-23 17:53:11 -0700 | [diff] [blame] | 47 |     action.cpp \ | 
| Jorge Lucangeli Obes | 24b2913 | 2016-10-27 10:33:03 -0400 | [diff] [blame] | 48 |     capabilities.cpp \ | 
| Mark Salyzyn | 62767fe | 2016-10-27 07:45:34 -0700 | [diff] [blame] | 49 |     descriptors.cpp \ | 
| Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 50 |     import_parser.cpp \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 51 |     init_parser.cpp \ | 
| Elliott Hughes | da40c00 | 2015-03-27 23:20:44 -0700 | [diff] [blame] | 52 |     log.cpp \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 53 |     parser.cpp \ | 
| Tom Cherry | bac3299 | 2015-07-31 12:45:25 -0700 | [diff] [blame] | 54 |     service.cpp \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 55 |     util.cpp \ | 
 | 56 |  | 
| Nick Kralevich | 8adb4d9 | 2017-01-03 08:37:54 -0800 | [diff] [blame] | 57 | LOCAL_STATIC_LIBRARIES := libbase libselinux liblog libprocessgroup libnl | 
| Jorge Lucangeli Obes | 24b2913 | 2016-10-27 10:33:03 -0400 | [diff] [blame] | 58 | LOCAL_WHOLE_STATIC_LIBRARIES := libcap | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 59 | LOCAL_MODULE := libinit | 
| Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 60 | LOCAL_SANITIZE := integer | 
| Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 61 | LOCAL_CLANG := true | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 62 | include $(BUILD_STATIC_LIBRARY) | 
 | 63 |  | 
 | 64 | include $(CLEAR_VARS) | 
 | 65 | LOCAL_CPPFLAGS := $(init_cflags) | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 66 | LOCAL_SRC_FILES:= \ | 
| Elliott Hughes | 2462790 | 2015-02-04 10:25:09 -0800 | [diff] [blame] | 67 |     bootchart.cpp \ | 
| Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 68 |     builtins.cpp \ | 
 | 69 |     devices.cpp \ | 
 | 70 |     init.cpp \ | 
| Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 71 |     keychords.cpp \ | 
| Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 72 |     property_service.cpp \ | 
| Paul Lawrence | db929bf | 2016-10-21 13:13:02 -0700 | [diff] [blame] | 73 |     seccomp.cpp \ | 
| Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 74 |     signal_handler.cpp \ | 
 | 75 |     ueventd.cpp \ | 
 | 76 |     ueventd_parser.cpp \ | 
| Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 77 |     watchdogd.cpp \ | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 78 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 79 | LOCAL_MODULE:= init | 
| Andres Morales | db5f5d4 | 2015-05-08 08:30:33 -0700 | [diff] [blame] | 80 | LOCAL_C_INCLUDES += \ | 
| Andres Morales | db5f5d4 | 2015-05-08 08:30:33 -0700 | [diff] [blame] | 81 |     system/core/mkbootimg | 
 | 82 |  | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 83 | LOCAL_FORCE_STATIC_EXECUTABLE := true | 
 | 84 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) | 
 | 85 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) | 
 | 86 |  | 
| Kenny Root | b5982bf | 2012-10-16 23:07:05 -0700 | [diff] [blame] | 87 | LOCAL_STATIC_LIBRARIES := \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 88 |     libinit \ | 
| Yabin Cui | 1051e10 | 2016-06-24 18:28:03 -0700 | [diff] [blame] | 89 |     libbootloader_message \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 90 |     libfs_mgr \ | 
| Sami Tolvanen | 99e3a92 | 2015-05-22 15:43:50 +0100 | [diff] [blame] | 91 |     libfec \ | 
 | 92 |     libfec_rs \ | 
| Mohamad Ayyash | 030ef359 | 2015-04-08 17:59:19 -0700 | [diff] [blame] | 93 |     libsquashfs_utils \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 94 |     liblogwrap \ | 
 | 95 |     libcutils \ | 
| Alex Deymo | 705353a | 2017-01-11 14:03:11 -0800 | [diff] [blame] | 96 |     libext4_utils \ | 
| Jeff Sharkey | 3b9c83a | 2016-02-03 14:44:44 -0700 | [diff] [blame] | 97 |     libbase \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 98 |     libc \ | 
 | 99 |     libselinux \ | 
| Paul Lawrence | db929bf | 2016-10-21 13:13:02 -0700 | [diff] [blame] | 100 |     libseccomp_policy \ | 
| William Roberts | bd2d961 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 101 |     liblog \ | 
| Josh Gao | 47763c3 | 2016-08-05 15:47:57 -0700 | [diff] [blame] | 102 |     libcrypto_utils \ | 
 | 103 |     libcrypto \ | 
| Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 104 |     libc++_static \ | 
| Ed Tam | 438443e | 2015-04-13 16:29:05 -0700 | [diff] [blame] | 105 |     libdl \ | 
| Alex Deymo | b0c3959 | 2017-01-11 14:37:50 -0800 | [diff] [blame] | 106 |     libsparse \ | 
| Collin Mulliner | f7e79b9 | 2016-06-01 21:03:55 +0000 | [diff] [blame] | 107 |     libz \ | 
| Nick Kralevich | 8adb4d9 | 2017-01-03 08:37:54 -0800 | [diff] [blame] | 108 |     libprocessgroup \ | 
 | 109 |     libnl \ | 
| Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 110 |  | 
| Jorge Lucangeli Obes | 24b2913 | 2016-10-27 10:33:03 -0400 | [diff] [blame] | 111 | # Create symlinks. | 
| Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 112 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ | 
 | 113 |     ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ | 
 | 114 |     ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd | 
| Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 115 |  | 
| Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 116 | LOCAL_SANITIZE := integer | 
| Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 117 | LOCAL_CLANG := true | 
| The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 118 | include $(BUILD_EXECUTABLE) | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 119 |  | 
 | 120 |  | 
| Jorge Lucangeli Obes | 24b2913 | 2016-10-27 10:33:03 -0400 | [diff] [blame] | 121 | # Unit tests. | 
 | 122 | # ========================================================= | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 123 | include $(CLEAR_VARS) | 
 | 124 | LOCAL_MODULE := init_tests | 
 | 125 | LOCAL_SRC_FILES := \ | 
| Elliott Hughes | 8d82ea0 | 2015-02-06 20:15:18 -0800 | [diff] [blame] | 126 |     init_parser_test.cpp \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 127 |     util_test.cpp \ | 
 | 128 |  | 
 | 129 | LOCAL_SHARED_LIBRARIES += \ | 
 | 130 |     libcutils \ | 
| Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 131 |     libbase \ | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 132 |  | 
 | 133 | LOCAL_STATIC_LIBRARIES := libinit | 
| Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 134 | LOCAL_SANITIZE := integer | 
| Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 135 | LOCAL_CLANG := true | 
| Mark Salyzyn | 62767fe | 2016-10-27 07:45:34 -0700 | [diff] [blame] | 136 | LOCAL_CPPFLAGS := -Wall -Wextra -Werror | 
| Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 137 | include $(BUILD_NATIVE_TEST) |