blob: de065dca8723b62f91333e2eda76b3352c0ded79 [file] [log] [blame]
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08001# Copyright 2005 The Android Open Source Project
2
3LOCAL_PATH:= $(call my-dir)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -08004
Elliott Hughesc0e919c2015-02-04 14:46:36 -08005# --
6
Elliott Hughesc0e919c2015-02-04 14:46:36 -08007ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Elliott Hughesf682b472015-02-06 12:19:48 -08008init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_DISABLE_SELINUX=1
Elliott Hughesc0e919c2015-02-04 14:46:36 -08009else
Elliott Hughesf682b472015-02-06 12:19:48 -080010init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_DISABLE_SELINUX=0
Elliott Hughesc0e919c2015-02-04 14:46:36 -080011endif
12
Elliott Hughesf682b472015-02-06 12:19:48 -080013init_options += -DLOG_UEVENTS=0
14
15init_cflags += \
16 $(init_options) \
17 -Wall -Wextra \
18 -Wno-unused-parameter \
19 -Werror \
Elliott Hughesc0e919c2015-02-04 14:46:36 -080020
Elliott Hughes9efd95b2015-03-30 14:37:11 -070021init_clang := true
22
Elliott Hughesc0e919c2015-02-04 14:46:36 -080023# --
24
Elliott Hughesf682b472015-02-06 12:19:48 -080025include $(CLEAR_VARS)
26LOCAL_CPPFLAGS := $(init_cflags)
27LOCAL_SRC_FILES:= \
28 init_parser.cpp \
Elliott Hughesda40c002015-03-27 23:20:44 -070029 log.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080030 parser.cpp \
31 util.cpp \
32
Dan Albertc007bc32015-03-16 10:08:46 -070033LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughesf682b472015-02-06 12:19:48 -080034LOCAL_MODULE := libinit
Elliott Hughes9efd95b2015-03-30 14:37:11 -070035LOCAL_CLANG := $(init_clang)
Elliott Hughesf682b472015-02-06 12:19:48 -080036include $(BUILD_STATIC_LIBRARY)
37
38include $(CLEAR_VARS)
39LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080040LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080041 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080042 builtins.cpp \
43 devices.cpp \
44 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080045 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080046 property_service.cpp \
47 signal_handler.cpp \
48 ueventd.cpp \
49 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080050 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080052LOCAL_MODULE:= init
Andres Moralesdb5f5d42015-05-08 08:30:33 -070053LOCAL_C_INCLUDES += \
54 system/extras/ext4_utils \
55 system/core/mkbootimg
56
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080057LOCAL_FORCE_STATIC_EXECUTABLE := true
58LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
59LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
60
Kenny Rootb5982bf2012-10-16 23:07:05 -070061LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080062 libinit \
63 libfs_mgr \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070064 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080065 liblogwrap \
66 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070067 libbase \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000068 libext4_utils_static \
69 libutils \
Elliott Hughesf682b472015-02-06 12:19:48 -080070 liblog \
71 libc \
72 libselinux \
73 libmincrypt \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000074 libc++_static \
Ed Tam438443e2015-04-13 16:29:05 -070075 libdl \
76 libsparse_static \
77 libz
Stephen Smalleye46f9d52012-01-13 08:48:47 -050078
Ying Wangdbb78d62014-11-24 15:43:34 -080079# Create symlinks
80LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
81 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
82 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080083
Elliott Hughes9efd95b2015-03-30 14:37:11 -070084LOCAL_CLANG := $(init_clang)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080085include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080086
87
88
89
90include $(CLEAR_VARS)
91LOCAL_MODULE := init_tests
92LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080093 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080094 util_test.cpp \
95
96LOCAL_SHARED_LIBRARIES += \
97 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070098 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080099
100LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes9efd95b2015-03-30 14:37:11 -0700101LOCAL_CLANG := $(init_clang)
Elliott Hughesf682b472015-02-06 12:19:48 -0800102include $(BUILD_NATIVE_TEST)