blob: 9d91a3fe7f50ba49ec418e0ceb53e652d741b378 [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
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000053LOCAL_C_INCLUDES += system/extras/ext4_utils
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080054LOCAL_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 \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000064 libext4_utils_static \
65 libutils \
Elliott Hughesf682b472015-02-06 12:19:48 -080066 liblog \
67 libc \
68 libselinux \
69 libmincrypt \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000070 libc++_static \
71 libdl
Stephen Smalleye46f9d52012-01-13 08:48:47 -050072
Ying Wangdbb78d62014-11-24 15:43:34 -080073# Create symlinks
74LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
75 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
76 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080077
Elliott Hughes9efd95b2015-03-30 14:37:11 -070078LOCAL_CLANG := $(init_clang)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080079include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080080
81
82
83
84include $(CLEAR_VARS)
85LOCAL_MODULE := init_tests
86LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080087 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080088 util_test.cpp \
89
90LOCAL_SHARED_LIBRARIES += \
91 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070092 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080093
94LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes9efd95b2015-03-30 14:37:11 -070095LOCAL_CLANG := $(init_clang)
Elliott Hughesf682b472015-02-06 12:19:48 -080096include $(BUILD_NATIVE_TEST)