blob: 45b002de545759d095b4778b6621b62c80ca36a0 [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)))
Nick Kralevichd34e4072015-04-28 12:39:41 -07008init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_PERMISSIVE_SELINUX=1
Elliott Hughesc0e919c2015-02-04 14:46:36 -08009else
Nick Kralevichd34e4072015-04-28 12:39:41 -070010init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_PERMISSIVE_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 \
Elliott Hughesda40c002015-03-27 23:20:44 -070027 log.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080028 parser.cpp \
29 util.cpp \
30
Dan Albertc007bc32015-03-16 10:08:46 -070031LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughesf682b472015-02-06 12:19:48 -080032LOCAL_MODULE := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -070033LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080034include $(BUILD_STATIC_LIBRARY)
35
36include $(CLEAR_VARS)
37LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080038LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080039 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080040 builtins.cpp \
41 devices.cpp \
42 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080043 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080044 property_service.cpp \
45 signal_handler.cpp \
46 ueventd.cpp \
47 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080048 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050LOCAL_MODULE:= init
Andres Moralescb3fce82015-05-08 08:30:33 -070051LOCAL_C_INCLUDES += \
52 system/extras/ext4_utils \
53 system/core/mkbootimg
54
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080055LOCAL_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 \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070062 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080063 liblogwrap \
64 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070065 libbase \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000066 libext4_utils_static \
67 libutils \
Elliott Hughesf682b472015-02-06 12:19:48 -080068 liblog \
69 libc \
70 libselinux \
71 libmincrypt \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000072 libc++_static \
73 libdl
Stephen Smalleye46f9d52012-01-13 08:48:47 -050074
Ying Wangdbb78d62014-11-24 15:43:34 -080075# Create symlinks
76LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
77 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
78 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080079
Elliott Hughes1115c252015-06-10 22:43:51 -070080LOCAL_CLANG := true
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080082
83
84
85
86include $(CLEAR_VARS)
87LOCAL_MODULE := init_tests
88LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080089 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080090 util_test.cpp \
91
92LOCAL_SHARED_LIBRARIES += \
93 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070094 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080095
96LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -070097LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080098include $(BUILD_NATIVE_TEST)