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 | |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 55 | LOCAL_STATIC_LIBRARIES := libbase |
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 | cb3fce8 | 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 \ |
| 86 | libfs_mgr \ |
Mohamad Ayyash | 030ef359 | 2015-04-08 17:59:19 -0700 | [diff] [blame] | 87 | libsquashfs_utils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 88 | liblogwrap \ |
| 89 | libcutils \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 90 | libbase \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 91 | libext4_utils_static \ |
| 92 | libutils \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 93 | liblog \ |
| 94 | libc \ |
| 95 | libselinux \ |
| 96 | libmincrypt \ |
Paul Lawrence | b8c9d27 | 2015-03-26 15:49:42 +0000 | [diff] [blame] | 97 | libc++_static \ |
| 98 | libdl |
Stephen Smalley | e46f9d5 | 2012-01-13 08:48:47 -0500 | [diff] [blame] | 99 | |
Ying Wang | dbb78d6 | 2014-11-24 15:43:34 -0800 | [diff] [blame] | 100 | # Create symlinks |
| 101 | LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \ |
| 102 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \ |
| 103 | ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd |
Alex Ray | 18ccc1b | 2014-03-06 15:07:42 -0800 | [diff] [blame] | 104 | |
Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 105 | LOCAL_SANITIZE := integer |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 106 | LOCAL_CLANG := true |
The Android Open Source Project | dd7bc33 | 2009-03-03 19:32:55 -0800 | [diff] [blame] | 107 | include $(BUILD_EXECUTABLE) |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | include $(CLEAR_VARS) |
| 113 | LOCAL_MODULE := init_tests |
| 114 | LOCAL_SRC_FILES := \ |
Elliott Hughes | 8d82ea0 | 2015-02-06 20:15:18 -0800 | [diff] [blame] | 115 | init_parser_test.cpp \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 116 | util_test.cpp \ |
| 117 | |
| 118 | LOCAL_SHARED_LIBRARIES += \ |
| 119 | libcutils \ |
Dan Albert | c007bc3 | 2015-03-16 10:08:46 -0700 | [diff] [blame] | 120 | libbase \ |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 121 | |
| 122 | LOCAL_STATIC_LIBRARIES := libinit |
Nick Kralevich | f90b653 | 2015-08-15 15:24:23 +0000 | [diff] [blame] | 123 | LOCAL_SANITIZE := integer |
Elliott Hughes | 1115c25 | 2015-06-10 22:43:51 -0700 | [diff] [blame] | 124 | LOCAL_CLANG := true |
Elliott Hughes | f682b47 | 2015-02-06 12:19:48 -0800 | [diff] [blame] | 125 | include $(BUILD_NATIVE_TEST) |