blob: 6737be4091df37e1a7d8374f37c81a2f03e3f2c4 [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
Lee Campbell220ca842015-07-30 09:27:11 -070023# If building on Linux, then build unit test for the host.
24ifeq ($(HOST_OS),linux)
25include $(CLEAR_VARS)
26LOCAL_CPPFLAGS := $(init_cflags)
27LOCAL_SRC_FILES:= \
28 parser/tokenizer.cpp \
29
30LOCAL_MODULE := libinit_parser
31LOCAL_CLANG := true
32include $(BUILD_HOST_STATIC_LIBRARY)
33
34include $(CLEAR_VARS)
35LOCAL_MODULE := init_parser_tests
36LOCAL_SRC_FILES := \
37 parser/tokenizer_test.cpp \
38
39LOCAL_STATIC_LIBRARIES := libinit_parser
40LOCAL_CLANG := true
41include $(BUILD_HOST_NATIVE_TEST)
42endif
43
Elliott Hughesf682b472015-02-06 12:19:48 -080044include $(CLEAR_VARS)
45LOCAL_CPPFLAGS := $(init_cflags)
46LOCAL_SRC_FILES:= \
Tom Cherryfa0c21c2015-07-23 17:53:11 -070047 action.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080048 init_parser.cpp \
Elliott Hughesda40c002015-03-27 23:20:44 -070049 log.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080050 parser.cpp \
Tom Cherrybac32992015-07-31 12:45:25 -070051 service.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080052 util.cpp \
53
Dan Albertc007bc32015-03-16 10:08:46 -070054LOCAL_STATIC_LIBRARIES := libbase
Elliott Hughesf682b472015-02-06 12:19:48 -080055LOCAL_MODULE := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -070056LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080057include $(BUILD_STATIC_LIBRARY)
58
59include $(CLEAR_VARS)
60LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080061LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080062 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080063 builtins.cpp \
64 devices.cpp \
65 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080066 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080067 property_service.cpp \
68 signal_handler.cpp \
69 ueventd.cpp \
70 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080071 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080072
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080073LOCAL_MODULE:= init
Andres Moralescb3fce82015-05-08 08:30:33 -070074LOCAL_C_INCLUDES += \
75 system/extras/ext4_utils \
76 system/core/mkbootimg
77
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080078LOCAL_FORCE_STATIC_EXECUTABLE := true
79LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
80LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
81
Kenny Rootb5982bf2012-10-16 23:07:05 -070082LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080083 libinit \
84 libfs_mgr \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070085 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080086 liblogwrap \
87 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -070088 libbase \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000089 libext4_utils_static \
90 libutils \
Elliott Hughesf682b472015-02-06 12:19:48 -080091 liblog \
92 libc \
93 libselinux \
94 libmincrypt \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000095 libc++_static \
96 libdl
Stephen Smalleye46f9d52012-01-13 08:48:47 -050097
Ying Wangdbb78d62014-11-24 15:43:34 -080098# Create symlinks
99LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
100 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
101 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -0800102
Elliott Hughes1115c252015-06-10 22:43:51 -0700103LOCAL_CLANG := true
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800104include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -0800105
106
107
108
109include $(CLEAR_VARS)
110LOCAL_MODULE := init_tests
111LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -0800112 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -0800113 util_test.cpp \
114
115LOCAL_SHARED_LIBRARIES += \
116 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -0700117 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -0800118
119LOCAL_STATIC_LIBRARIES := libinit
Elliott Hughes1115c252015-06-10 22:43:51 -0700120LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -0800121include $(BUILD_NATIVE_TEST)