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 | |
| 7 | ifeq ($(strip $(INIT_BOOTCHART)),true) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 8 | init_options += -DBOOTCHART=1 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 9 | else |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 10 | init_options += -DBOOTCHART=0 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 11 | endif |
| 12 | |
| 13 | ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 14 | init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_DISABLE_SELINUX=1 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 15 | else |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 16 | init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_DISABLE_SELINUX=0 |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 17 | endif |
| 18 | |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 19 | init_options += -DLOG_UEVENTS=0 |
| 20 | |
| 21 | init_cflags += \ |
| 22 | $(init_options) \ |
| 23 | -Wall -Wextra \ |
| 24 | -Wno-unused-parameter \ |
| 25 | -Werror \ |
Elliott Hughes | c0e919c | 2015-02-04 14:46:36 -0800 | [diff] [blame] | 26 | |
| 27 | # -- |
| 28 | |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 29 | include $(CLEAR_VARS) |
| 30 | LOCAL_CPPFLAGS := $(init_cflags) |
| 31 | LOCAL_SRC_FILES:= \ |
| 32 | init_parser.cpp \ |
| 33 | parser.cpp \ |
| 34 | util.cpp \ |
| 35 | |
| 36 | LOCAL_MODULE := libinit |
| 37 | include $(BUILD_STATIC_LIBRARY) |
| 38 | |
| 39 | include $(CLEAR_VARS) |
| 40 | LOCAL_CPPFLAGS := $(init_cflags) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 41 | LOCAL_SRC_FILES:= \ |
Elliott Hughes | 2462790 | 2015-02-04 10:25:09 -0800 | [diff] [blame] | 42 | bootchart.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 43 | builtins.cpp \ |
| 44 | devices.cpp \ |
| 45 | init.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 46 | keychords.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 47 | property_service.cpp \ |
| 48 | signal_handler.cpp \ |
| 49 | ueventd.cpp \ |
| 50 | ueventd_parser.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 51 | watchdogd.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 52 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 53 | LOCAL_MODULE:= init |
| 54 | |
| 55 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 56 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 57 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) |
| 58 | |
Kenny Root | b5982bf | 2012-10-16 23:07:05 -0700 | [diff] [blame] | 59 | LOCAL_STATIC_LIBRARIES := \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 60 | libinit \ |
| 61 | libfs_mgr \ |
| 62 | liblogwrap \ |
| 63 | libcutils \ |
| 64 | libutils \ |
| 65 | liblog \ |
| 66 | libc \ |
| 67 | libselinux \ |
| 68 | libmincrypt \ |
| 69 | libext4_utils_static |
Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 70 | |
Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 71 | # Create symlinks |
| 72 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ |
| 73 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ |
| 74 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd |
Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 75 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 76 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame^] | 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | include $(CLEAR_VARS) |
| 82 | LOCAL_MODULE := init_tests |
| 83 | LOCAL_SRC_FILES := \ |
| 84 | util_test.cpp \ |
| 85 | |
| 86 | LOCAL_SHARED_LIBRARIES += \ |
| 87 | libcutils \ |
| 88 | libutils \ |
| 89 | |
| 90 | LOCAL_STATIC_LIBRARIES := libinit |
| 91 | include $(BUILD_NATIVE_TEST) |