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 \ |
Tom Cherry | b734990 | 2015-08-26 11:43:36 -0700 | [diff] [blame] | 48 | import_parser.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 49 | init_parser.cpp \ |
Elliott Hughes | da40c00 | 2015-03-27 23:20:44 -0700 | [diff] [blame] | 50 | log.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 51 | parser.cpp \ |
Tom Cherry | bac3299 | 2015-07-31 12:45:25 -0700 | [diff] [blame] | 52 | service.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 53 | util.cpp \ |
| 54 | |
Collin Mulliner | f7e79b9 | 2016-06-01 21:03:55 +0000 | [diff] [blame] | 55 | LOCAL_STATIC_LIBRARIES := libbase libselinux liblog libprocessgroup |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 56 | LOCAL_MODULE := libinit |
Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 57 | LOCAL_SANITIZE := integer |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 58 | LOCAL_CLANG := true |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 59 | include $(BUILD_STATIC_LIBRARY) |
| 60 | |
| 61 | include $(CLEAR_VARS) |
| 62 | LOCAL_CPPFLAGS := $(init_cflags) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 63 | LOCAL_SRC_FILES:= \ |
Elliott Hughes | 2462790 | 2015-02-04 10:25:09 -0800 | [diff] [blame] | 64 | bootchart.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 65 | builtins.cpp \ |
| 66 | devices.cpp \ |
| 67 | init.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 68 | keychords.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 69 | property_service.cpp \ |
| 70 | signal_handler.cpp \ |
| 71 | ueventd.cpp \ |
| 72 | ueventd_parser.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 73 | watchdogd.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 74 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 75 | LOCAL_MODULE:= init |
Andres Morales | db5f5d4 | 2015-05-08 08:30:33 -0700 | [diff] [blame] | 76 | LOCAL_C_INCLUDES += \ |
| 77 | system/extras/ext4_utils \ |
| 78 | system/core/mkbootimg |
| 79 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 80 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 81 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 82 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) |
| 83 | |
Kenny Root | b5982bf | 2012-10-16 23:07:05 -0700 | [diff] [blame] | 84 | LOCAL_STATIC_LIBRARIES := \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 85 | libinit \ |
Yabin Cui | 46e0379 | 2016-04-06 15:56:49 -0700 | [diff] [blame] | 86 | libbootloader_message_writer \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 87 | libfs_mgr \ |
Sami Tolvanen | 99e3a92 | 2015-05-22 15:43:50 +0100 | [diff] [blame] | 88 | libfec \ |
| 89 | libfec_rs \ |
Mohamad Ayyash | 030ef359 | 2015-04-08 17:59:19 -0700 | [diff] [blame] | 90 | libsquashfs_utils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 91 | liblogwrap \ |
| 92 | libcutils \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 93 | libext4_utils_static \ |
Jeff Sharkey | 3b9c83a | 2016-02-03 14:44:44 -0700 | [diff] [blame] | 94 | libbase \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 95 | libc \ |
| 96 | libselinux \ |
William Roberts | bd2d961 | 2015-08-04 14:23:04 -0700 | [diff] [blame] | 97 | liblog \ |
Mattias Nissler | 097b6bb | 2016-03-31 16:32:09 +0200 | [diff] [blame] | 98 | libcrypto_utils_static \ |
Sami Tolvanen | 99e3a92 | 2015-05-22 15:43:50 +0100 | [diff] [blame] | 99 | libcrypto_static \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 100 | libc++_static \ |
Ed Tam | 438443e | 2015-04-13 16:29:05 -0700 | [diff] [blame] | 101 | libdl \ |
| 102 | libsparse_static \ |
Collin Mulliner | f7e79b9 | 2016-06-01 21:03:55 +0000 | [diff] [blame] | 103 | libz \ |
| 104 | libprocessgroup |
Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 105 | |
Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 106 | # Create symlinks |
| 107 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ |
| 108 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ |
| 109 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd |
Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 110 | |
Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 111 | LOCAL_SANITIZE := integer |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 112 | LOCAL_CLANG := true |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 113 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | include $(CLEAR_VARS) |
| 119 | LOCAL_MODULE := init_tests |
| 120 | LOCAL_SRC_FILES := \ |
Elliott Hughes | 8d82ea0 | 2015-02-06 20:15:18 -0800 | [diff] [blame] | 121 | init_parser_test.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 122 | util_test.cpp \ |
| 123 | |
| 124 | LOCAL_SHARED_LIBRARIES += \ |
| 125 | libcutils \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 126 | libbase \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 127 | |
| 128 | LOCAL_STATIC_LIBRARIES := libinit |
Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 129 | LOCAL_SANITIZE := integer |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 130 | LOCAL_CLANG := true |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 131 | include $(BUILD_NATIVE_TEST) |