Home | History | Annotate | Download | only in init
      1 # Copyright 2005 The Android Open Source Project
      2 
      3 LOCAL_PATH:= $(call my-dir)
      4 
      5 # --
      6 
      7 ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
      8 init_options += -DALLOW_LOCAL_PROP_OVERRIDE=1 -DALLOW_PERMISSIVE_SELINUX=1
      9 else
     10 init_options += -DALLOW_LOCAL_PROP_OVERRIDE=0 -DALLOW_PERMISSIVE_SELINUX=0
     11 endif
     12 
     13 init_options += -DLOG_UEVENTS=0
     14 
     15 init_cflags += \
     16     $(init_options) \
     17     -Wall -Wextra \
     18     -Wno-unused-parameter \
     19     -Werror \
     20 
     21 # --
     22 
     23 # If building on Linux, then build unit test for the host.
     24 ifeq ($(HOST_OS),linux)
     25 include $(CLEAR_VARS)
     26 LOCAL_CPPFLAGS := $(init_cflags)
     27 LOCAL_SRC_FILES:= \
     28     parser/tokenizer.cpp \
     29 
     30 LOCAL_MODULE := libinit_parser
     31 LOCAL_CLANG := true
     32 include $(BUILD_HOST_STATIC_LIBRARY)
     33 
     34 include $(CLEAR_VARS)
     35 LOCAL_MODULE := init_parser_tests
     36 LOCAL_SRC_FILES := \
     37     parser/tokenizer_test.cpp \
     38 
     39 LOCAL_STATIC_LIBRARIES := libinit_parser
     40 LOCAL_CLANG := true
     41 include $(BUILD_HOST_NATIVE_TEST)
     42 endif
     43 
     44 include $(CLEAR_VARS)
     45 LOCAL_CPPFLAGS := $(init_cflags)
     46 LOCAL_SRC_FILES:= \
     47     action.cpp \
     48     import_parser.cpp \
     49     init_parser.cpp \
     50     log.cpp \
     51     parser.cpp \
     52     service.cpp \
     53     util.cpp \
     54 
     55 LOCAL_STATIC_LIBRARIES := libbase libselinux
     56 LOCAL_MODULE := libinit
     57 LOCAL_SANITIZE := integer
     58 LOCAL_CLANG := true
     59 include $(BUILD_STATIC_LIBRARY)
     60 
     61 include $(CLEAR_VARS)
     62 LOCAL_CPPFLAGS := $(init_cflags)
     63 LOCAL_SRC_FILES:= \
     64     bootchart.cpp \
     65     builtins.cpp \
     66     devices.cpp \
     67     init.cpp \
     68     keychords.cpp \
     69     property_service.cpp \
     70     signal_handler.cpp \
     71     ueventd.cpp \
     72     ueventd_parser.cpp \
     73     watchdogd.cpp \
     74 
     75 LOCAL_MODULE:= init
     76 LOCAL_C_INCLUDES += \
     77     system/extras/ext4_utils \
     78     system/core/mkbootimg
     79 
     80 LOCAL_FORCE_STATIC_EXECUTABLE := true
     81 LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)
     82 LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
     83 
     84 LOCAL_STATIC_LIBRARIES := \
     85     libinit \
     86     libbootloader_message \
     87     libfs_mgr \
     88     libfec \
     89     libfec_rs \
     90     libsquashfs_utils \
     91     liblogwrap \
     92     libcutils \
     93     libext4_utils_static \
     94     libbase \
     95     libutils \
     96     libc \
     97     libselinux \
     98     liblog \
     99     libmincrypt \
    100     libcrypto_static \
    101     libc++_static \
    102     libdl \
    103     libsparse_static \
    104     libz
    105 
    106 # Create symlinks
    107 LOCAL_POST_INSTALL_CMD := $(hide) mkdir -p $(TARGET_ROOT_OUT)/sbin; \
    108     ln -sf ../init $(TARGET_ROOT_OUT)/sbin/ueventd; \
    109     ln -sf ../init $(TARGET_ROOT_OUT)/sbin/watchdogd
    110 
    111 LOCAL_SANITIZE := integer
    112 LOCAL_CLANG := true
    113 include $(BUILD_EXECUTABLE)
    114 
    115 
    116 
    117 
    118 include $(CLEAR_VARS)
    119 LOCAL_MODULE := init_tests
    120 LOCAL_SRC_FILES := \
    121     init_parser_test.cpp \
    122     util_test.cpp \
    123 
    124 LOCAL_SHARED_LIBRARIES += \
    125     libcutils \
    126     libbase \
    127 
    128 LOCAL_STATIC_LIBRARIES := libinit
    129 LOCAL_SANITIZE := integer
    130 LOCAL_CLANG := true
    131 include $(BUILD_NATIVE_TEST)
    132