blob: 4bfd743dd8b29a60d36fe0f89bc81f4782de9aed [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 \
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -040048 capabilities.cpp \
Tom Cherryb7349902015-08-26 11:43:36 -070049 import_parser.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080050 init_parser.cpp \
Elliott Hughesda40c002015-03-27 23:20:44 -070051 log.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080052 parser.cpp \
Tom Cherrybac32992015-07-31 12:45:25 -070053 service.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -080054 util.cpp \
55
Collin Mullinerf7e79b92016-06-01 21:03:55 +000056LOCAL_STATIC_LIBRARIES := libbase libselinux liblog libprocessgroup
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -040057LOCAL_WHOLE_STATIC_LIBRARIES := libcap
Elliott Hughesf682b472015-02-06 12:19:48 -080058LOCAL_MODULE := libinit
Nick Kralevichf90b6532015-08-15 15:24:23 +000059LOCAL_SANITIZE := integer
Elliott Hughes1115c252015-06-10 22:43:51 -070060LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -080061include $(BUILD_STATIC_LIBRARY)
62
63include $(CLEAR_VARS)
64LOCAL_CPPFLAGS := $(init_cflags)
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080065LOCAL_SRC_FILES:= \
Elliott Hughes24627902015-02-04 10:25:09 -080066 bootchart.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080067 builtins.cpp \
68 devices.cpp \
69 init.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080070 keychords.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080071 property_service.cpp \
72 signal_handler.cpp \
73 ueventd.cpp \
74 ueventd_parser.cpp \
Elliott Hughesf3cf4382015-02-03 17:12:07 -080075 watchdogd.cpp \
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080076
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080077LOCAL_MODULE:= init
Andres Moralesdb5f5d42015-05-08 08:30:33 -070078LOCAL_C_INCLUDES += \
Andres Moralesdb5f5d42015-05-08 08:30:33 -070079 system/core/mkbootimg
80
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -080081LOCAL_FORCE_STATIC_EXECUTABLE := true
82LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
83LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
84
Kenny Rootb5982bf2012-10-16 23:07:05 -070085LOCAL_STATIC_LIBRARIES := \
Elliott Hughesf682b472015-02-06 12:19:48 -080086 libinit \
Yabin Cui1051e102016-06-24 18:28:03 -070087 libbootloader_message \
Elliott Hughesf682b472015-02-06 12:19:48 -080088 libfs_mgr \
Sami Tolvanen99e3a922015-05-22 15:43:50 +010089 libfec \
90 libfec_rs \
Mohamad Ayyash030ef3592015-04-08 17:59:19 -070091 libsquashfs_utils \
Elliott Hughesf682b472015-02-06 12:19:48 -080092 liblogwrap \
93 libcutils \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +000094 libext4_utils_static \
Jeff Sharkey3b9c83a2016-02-03 14:44:44 -070095 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -080096 libc \
97 libselinux \
William Robertsbd2d9612015-08-04 14:23:04 -070098 liblog \
Josh Gao47763c32016-08-05 15:47:57 -070099 libcrypto_utils \
100 libcrypto \
Paul Lawrenceb8c9d272015-03-26 15:49:42 +0000101 libc++_static \
Ed Tam438443e2015-04-13 16:29:05 -0700102 libdl \
103 libsparse_static \
Collin Mullinerf7e79b92016-06-01 21:03:55 +0000104 libz \
105 libprocessgroup
Stephen Smalleye46f9d52012-01-13 08:48:47 -0500106
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -0400107# Create symlinks.
Ying Wangdbb78d62014-11-24 15:43:34 -0800108LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
109 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
110 ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
Alex Ray18ccc1b2014-03-06 15:07:42 -0800111
Nick Kralevichf90b6532015-08-15 15:24:23 +0000112LOCAL_SANITIZE := integer
Elliott Hughes1115c252015-06-10 22:43:51 -0700113LOCAL_CLANG := true
The Android Open Source Projectdd7bc332009-03-03 19:32:55 -0800114include $(BUILD_EXECUTABLE)
Elliott Hughesf682b472015-02-06 12:19:48 -0800115
116
Jorge Lucangeli Obes24b29132016-10-27 10:33:03 -0400117# Unit tests.
118# =========================================================
Elliott Hughesf682b472015-02-06 12:19:48 -0800119include $(CLEAR_VARS)
120LOCAL_MODULE := init_tests
121LOCAL_SRC_FILES := \
Elliott Hughes8d82ea02015-02-06 20:15:18 -0800122 init_parser_test.cpp \
Elliott Hughesf682b472015-02-06 12:19:48 -0800123 util_test.cpp \
124
125LOCAL_SHARED_LIBRARIES += \
126 libcutils \
Dan Albertc007bc32015-03-16 10:08:46 -0700127 libbase \
Elliott Hughesf682b472015-02-06 12:19:48 -0800128
129LOCAL_STATIC_LIBRARIES := libinit
Nick Kralevichf90b6532015-08-15 15:24:23 +0000130LOCAL_SANITIZE := integer
Elliott Hughes1115c252015-06-10 22:43:51 -0700131LOCAL_CLANG := true
Elliott Hughesf682b472015-02-06 12:19:48 -0800132include $(BUILD_NATIVE_TEST)