blob: a6eb5d68f3e6ca560eb6c3513e41f18098f81d28 [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:= \
Tom Cherryfa0c21c2015-07-23 17:53:11 -070026 action.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080027 init_parser.cpp \
Elliott Hughesda40c002015-03-27 23:20:44 -070028 log.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080029 parser.cpp \
30 util.cpp \
31
Dan Albertc007bc32015-03-16 10:08:46 -070032LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughesf682b472015-02-06 12:19:48 -080033LOCAL_MODULE := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -070034LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080035include $(BUILD_STATIC_LIBRARY)
36
37include $(CLEAR_VARS)
38LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080039LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080040 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080041 builtins.cpp \
42 devices.cpp \
43 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080044 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080045 property_service.cpp \
46 signal_handler.cpp \
47 ueventd.cpp \
48 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080049 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080050
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080051LOCAL_MODULE:= init
Andres Moralescb3fce82015-05-08 08:30:33 -070052LOCAL_C_INCLUDES += \
53 system/extras/ext4_utils \
54 system/core/mkbootimg
55
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080056LOCAL_FORCE_STATIC_EXECUTABLE := true
57LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
58LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
59
Kenny Rootb5982bf2012-10-16 23:07:05 -070060LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080061 libinit \
62 libfs_mgr \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070063 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080064 liblogwrap \
65 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070066 libbase \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000067 libext4_utils_static \
68 libutils \
Elliott Hughesf682b472015-02-06 12:19:48 -080069 liblog \
70 libc \
71 libselinux \
72 libmincrypt \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000073 libc++_static \
74 libdl
Stephen Smalleye46f9d52012-01-13 08:48:47 -050075
Ying Wangdbb78d62014-11-24 15:43:34 -080076# Create symlinks
77LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
78 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
79 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080080
Elliott Hughes1115c252015-06-10 22:43:51 -070081LOCAL_CLANG := true
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080082include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080083
84
85
86
87include $(CLEAR_VARS)
88LOCAL_MODULE := init_tests
89LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080090 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080091 util_test.cpp \
92
93LOCAL_SHARED_LIBRARIES += \
94 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070095 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080096
97LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -070098LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080099include $(BUILD_NATIVE_TEST)