blob: 94d3dad8e78edd60fccbe969adbe529c30adeebc [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
53
54LOCAL_FORCE_STATIC_EXECUTABLE := true
55LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
56LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
57
Kenny Rootb5982bf2012-10-16 23:07:05 -070058LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080059 libinit \
60 libfs_mgr \
61 liblogwrap \
62 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070063 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080064 liblog \
65 libc \
66 libselinux \
67 libmincrypt \
68 libext4_utils_static
Stephen Smalleye46f9d52012-01-13 08:48:47 -050069
Ying Wangdbb78d62014-11-24 15:43:34 -080070# Create symlinks
71LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
72 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
73 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080074
Elliott Hughes9efd95b2015-03-30 14:37:11 -070075LOCAL_CLANG := $(init_clang)
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 := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080084 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080085 util_test.cpp \
86
87LOCAL_SHARED_LIBRARIES += \
88 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070089 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080090
91LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes9efd95b2015-03-30 14:37:11 -070092LOCAL_CLANG := $(init_clang)
Elliott Hughesf682b472015-02-06 12:19:48 -080093include $(BUILD_NATIVE_TEST)