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:= \ |
| 47 | init_parser.cpp \ |
Elliott Hughes | da40c00 | 2015-03-27 23:20:44 -0700 | [diff] [blame] | 48 | log.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 49 | parser.cpp \ |
| 50 | util.cpp \ |
| 51 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 52 | LOCAL_STATIC_LIBRARIES := libbase |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 53 | LOCAL_MODULE := libinit |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 54 | LOCAL_CLANG := true |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 55 | include $(BUILD_STATIC_LIBRARY) |
| 56 | |
| 57 | include $(CLEAR_VARS) |
| 58 | LOCAL_CPPFLAGS := $(init_cflags) |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 59 | LOCAL_SRC_FILES:= \ |
Elliott Hughes | 2462790 | 2015-02-04 10:25:09 -0800 | [diff] [blame] | 60 | bootchart.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 61 | builtins.cpp \ |
| 62 | devices.cpp \ |
| 63 | init.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 64 | keychords.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 65 | property_service.cpp \ |
| 66 | signal_handler.cpp \ |
| 67 | ueventd.cpp \ |
| 68 | ueventd_parser.cpp \ |
Elliott Hughes | f3cf438 | 2015-02-03 17:12:07 -0800 | [diff] [blame] | 69 | watchdogd.cpp \ |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 70 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 71 | LOCAL_MODULE:= init |
Andres Morales | cb3fce8 | 2015-05-08 08:30:33 -0700 | [diff] [blame] | 72 | LOCAL_C_INCLUDES += \ |
| 73 | system/extras/ext4_utils \ |
| 74 | system/core/mkbootimg |
| 75 | |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 76 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
| 77 | LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT) |
| 78 | LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) |
| 79 | |
Kenny Root | b5982bf | 2012-10-16 23:07:05 -0700 | [diff] [blame] | 80 | LOCAL_STATIC_LIBRARIES := \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 81 | libinit \ |
| 82 | libfs_mgr \ |
Mohamad Ayyash | 030ef359 | 2015-04-08 17:59:19 -0700 | [diff] [blame] | 83 | libsquashfs_utils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 84 | liblogwrap \ |
| 85 | libcutils \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 86 | libbase \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 87 | libext4_utils_static \ |
| 88 | libutils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 89 | liblog \ |
| 90 | libc \ |
| 91 | libselinux \ |
| 92 | libmincrypt \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 93 | libc++_static \ |
| 94 | libdl |
Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 95 | |
Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 96 | # Create symlinks |
| 97 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ |
| 98 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ |
| 99 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd |
Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 100 | |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 101 | LOCAL_CLANG := true |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 102 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | include $(CLEAR_VARS) |
| 108 | LOCAL_MODULE := init_tests |
| 109 | LOCAL_SRC_FILES := \ |
Elliott Hughes | 8d82ea0 | 2015-02-06 20:15:18 -0800 | [diff] [blame] | 110 | init_parser_test.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 111 | util_test.cpp \ |
| 112 | |
| 113 | LOCAL_SHARED_LIBRARIES += \ |
| 114 | libcutils \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 115 | libbase \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 116 | |
| 117 | LOCAL_STATIC_LIBRARIES := libinit |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 118 | LOCAL_CLANG := true |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 119 | include $(BUILD_NATIVE_TEST) |