blob: cb4cb117f54de12a174ca116d47959fab023a81e [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 \
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
33include $(BUILD_STATIC_LIBRARY)
34
35include $(CLEAR_VARS)
36LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080037LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080038 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080039 builtins.cpp \
40 devices.cpp \
41 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080042 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080043 property_service.cpp \
44 signal_handler.cpp \
45 ueventd.cpp \
46 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080047 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080048
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080049LOCAL_MODULE:= init
50
51LOCAL_FORCE_STATIC_EXECUTABLE := true
52LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
53LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
54
Kenny Rootb5982bf2012-10-16 23:07:05 -070055LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080056 libinit \
57 libfs_mgr \
58 liblogwrap \
59 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070060 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080061 liblog \
62 libc \
63 libselinux \
64 libmincrypt \
65 libext4_utils_static
Stephen Smalleye46f9d52012-01-13 08:48:47 -050066
Ying Wangdbb78d62014-11-24 15:43:34 -080067# Create symlinks
68LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
69 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
70 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -080071
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080072include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -080073
74
75
76
77include $(CLEAR_VARS)
78LOCAL_MODULE := init_tests
79LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -080080 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080081 util_test.cpp \
82
83LOCAL_SHARED_LIBRARIES += \
84 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070085 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080086
87LOCAL_STATIC_LIBRARIES := libinit
88include $(BUILD_NATIVE_TEST)