blob: 7f3788a20cab3acb9ef9a40f26c98dafb9db342a [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
7ifeq ($(strip $(INIT_BOOTCHART)),true)
Elliott Hughesf682b472015-02-06 12:19:48 -08008init_options += -DBOOTCHART=1
Elliott Hughesc0e919c2015-02-04 14:46:36 -08009else
Elliott Hughesf682b472015-02-06 12:19:48 -080010init_options += -DBOOTCHART=0
Elliott Hughesc0e919c2015-02-04 14:46:36 -080011endif
12
13ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
Elliott Hughesf682b472015-02-06 12:19:48 -080014init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_DISABLE_SELINUX=1
Elliott Hughesc0e919c2015-02-04 14:46:36 -080015else
Elliott Hughesf682b472015-02-06 12:19:48 -080016init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_DISABLE_SELINUX=0
Elliott Hughesc0e919c2015-02-04 14:46:36 -080017endif
18
Elliott Hughesf682b472015-02-06 12:19:48 -080019init_options += -DLOG_UEVENTS=0
20
21init_cflags += \
22 $(init_options) \
23 -Wall -Wextra \
24 -Wno-unused-parameter \
25 -Werror \
Elliott Hughesc0e919c2015-02-04 14:46:36 -080026
27# --
28
Elliott Hughesf682b472015-02-06 12:19:48 -080029include $(CLEAR_VARS)
30LOCAL_CPPFLAGS := $(init_cflags)
31LOCAL_SRC_FILES:= \
32 init_parser.cpp \
33 parser.cpp \
34 util.cpp \
35
36LOCAL_MODULE := libinit
37include $(BUILD_STATIC_LIBRARY)
38
39include $(CLEAR_VARS)
40LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080041LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080042 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080043 builtins.cpp \
44 devices.cpp \
45 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080046 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080047 property_service.cpp \
48 signal_handler.cpp \
49 ueventd.cpp \
50 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080051 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080052
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080053LOCAL_MODULE:= init
54
55LOCAL_FORCE_STATIC_EXECUTABLE := true
56LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
57LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
58
Kenny Rootb5982bf2012-10-16 23:07:05 -070059LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080060 libinit \
61 libfs_mgr \
62 liblogwrap \
63 libcutils \
64 libutils \
65 liblog \
66 libc \
67 libselinux \
68 libmincrypt \
69 libext4_utils_static
Stephen Smalleye46f9d52012-01-13 08:48:47 -050070
Ying Wangdbb78d62014-11-24 15:43:34 -080071# Create symlinks
72LOCAL_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 Ray18ccc1b2014-03-06 15:07:42 -080075
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080076include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080077
78
79
80
81include $(CLEAR_VARS)
82LOCAL_MODULE := init_tests
83LOCAL_SRC_FILES := \
84 util_test.cpp \
85
86LOCAL_SHARED_LIBRARIES += \
87 libcutils \
88 libutils \
89
90LOCAL_STATIC_LIBRARIES := libinit
91include $(BUILD_NATIVE_TEST)