blob: 5b8094fe0171853dbc0e5b2191547781636a0893 [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
21# --
22
Elliott Hughesf682b472015-02-06 12:19:48 -080023include $(CLEAR_VARS)
24LOCAL_CPPFLAGS := $(init_cflags)
25LOCAL_SRC_FILES:= \
26 init_parser.cpp \
27 parser.cpp \
28 util.cpp \
29
Dan Albertc007bc32015-03-16 10:08:46 -070030LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughesf682b472015-02-06 12:19:48 -080031LOCAL_MODULE := libinit
32include $(BUILD_STATIC_LIBRARY)
33
34include $(CLEAR_VARS)
35LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080036LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080037 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080038 builtins.cpp \
39 devices.cpp \
40 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080041 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080042 property_service.cpp \
43 signal_handler.cpp \
44 ueventd.cpp \
45 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080046 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080047
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048LOCAL_MODULE:= init
49
50LOCAL_FORCE_STATIC_EXECUTABLE := true
51LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
52LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
53
Kenny Rootb5982bf2012-10-16 23:07:05 -070054LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080055 libinit \
56 libfs_mgr \
57 liblogwrap \
58 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070059 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080060 liblog \
61 libc \
62 libselinux \
63 libmincrypt \
64 libext4_utils_static
Stephen Smalleye46f9d52012-01-13 08:48:47 -050065
Ying Wangdbb78d62014-11-24 15:43:34 -080066# Create symlinks
67LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
68 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
69 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080070
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080071include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080072
73
74
75
76include $(CLEAR_VARS)
77LOCAL_MODULE := init_tests
78LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080079 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080080 util_test.cpp \
81
82LOCAL_SHARED_LIBRARIES += \
83 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070084 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080085
86LOCAL_STATIC_LIBRARIES := libinit
87include $(BUILD_NATIVE_TEST)