diff options
author | 2016-12-04 14:02:00 -0700 | |
---|---|---|
committer | 2016-12-05 11:39:00 -0700 | |
commit | 00b6f68c5c72252542a1e8c5dda4b420ed02c947 (patch) | |
tree | d104ffc1dd209d6d98fc38fe00f105dc3d66bead | |
parent | 53b6fc5ddcf90c171f08b21c656b829d8ec9aa18 (diff) |
Move installd back to Android.mk.
An upcoming CL will be compiling an AIDL for installd, which the new
build system doesn't support yet.
Test: builds, boots
Bug: 13758960, 30944031
Change-Id: I47f9ef21eb6040072c402d40ae42a95d7bd0e61d
-rw-r--r-- | cmds/installd/Android.bp | 50 | ||||
-rw-r--r-- | cmds/installd/Android.mk | 43 | ||||
-rw-r--r-- | cmds/installd/tests/Android.bp | 16 | ||||
-rw-r--r-- | cmds/installd/tests/Android.mk | 31 |
4 files changed, 74 insertions, 66 deletions
diff --git a/cmds/installd/Android.bp b/cmds/installd/Android.bp index e3048c72a9..8b239ad9db 100644 --- a/cmds/installd/Android.bp +++ b/cmds/installd/Android.bp @@ -1,51 +1,3 @@ -cc_defaults { - name: "installd_defaults", - - cflags: [ - "-Wall", - "-Werror", - ], - srcs: [ - "commands.cpp", - "globals.cpp", - "utils.cpp", - ], - shared_libs: [ - "libbase", - "libcutils", - "liblog", - "liblogwrap", - "libselinux", - ], - - clang: true, -} - -// -// Static library used in testing and executable -// - -cc_library_static { - name: "libinstalld", - defaults: ["installd_defaults"], - - export_include_dirs: ["."], -} - -// -// Executable -// - -cc_binary { - name: "installd", - defaults: ["installd_defaults"], - srcs: ["installd.cpp"], - - static_libs: ["libdiskusage"], - - init_rc: ["installd.rc"], -} - // OTA chroot tool cc_binary { @@ -62,5 +14,3 @@ cc_binary { "liblog", ], } - -subdirs = ["tests"] diff --git a/cmds/installd/Android.mk b/cmds/installd/Android.mk index d29e5bac32..17886faf95 100644 --- a/cmds/installd/Android.mk +++ b/cmds/installd/Android.mk @@ -50,3 +50,46 @@ LOCAL_SRC_FILES := otapreopt_script.sh LOCAL_REQUIRED_MODULES := otapreopt otapreopt_chroot otapreopt_slot include $(BUILD_PREBUILT) + +common_src_files := commands.cpp globals.cpp utils.cpp +common_cflags := -Wall -Werror + +# +# Static library used in testing and executable +# + +include $(CLEAR_VARS) +LOCAL_MODULE := libinstalld +LOCAL_MODULE_TAGS := eng tests +LOCAL_SRC_FILES := $(common_src_files) +LOCAL_CFLAGS := $(common_cflags) +LOCAL_SHARED_LIBRARIES := \ + libbase \ + liblogwrap \ + libselinux \ + +LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk +LOCAL_CLANG := true +include $(BUILD_STATIC_LIBRARY) + +# +# Executable +# + +include $(CLEAR_VARS) +LOCAL_MODULE := installd +LOCAL_MODULE_TAGS := optional +LOCAL_CFLAGS := $(common_cflags) +LOCAL_SRC_FILES := installd.cpp $(common_src_files) +LOCAL_SHARED_LIBRARIES := \ + libbase \ + libcutils \ + liblog \ + liblogwrap \ + libselinux \ + +LOCAL_STATIC_LIBRARIES := libdiskusage +LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk +LOCAL_INIT_RC := installd.rc +LOCAL_CLANG := true +include $(BUILD_EXECUTABLE) diff --git a/cmds/installd/tests/Android.bp b/cmds/installd/tests/Android.bp deleted file mode 100644 index 447c8bdbcf..0000000000 --- a/cmds/installd/tests/Android.bp +++ /dev/null @@ -1,16 +0,0 @@ -// Build the unit tests for installd -cc_test { - name: "installd_utils_test", - clang: true, - srcs: ["installd_utils_test.cpp"], - shared_libs: [ - "libbase", - "libutils", - "liblog", - "libcutils", - ], - static_libs: [ - "libinstalld", - "libdiskusage", - ], -} diff --git a/cmds/installd/tests/Android.mk b/cmds/installd/tests/Android.mk new file mode 100644 index 0000000000..38a9f69964 --- /dev/null +++ b/cmds/installd/tests/Android.mk @@ -0,0 +1,31 @@ +# Build the unit tests for installd +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) +LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk + +# Build the unit tests. +test_src_files := \ + installd_utils_test.cpp + +shared_libraries := \ + libbase \ + libutils \ + libcutils \ + +static_libraries := \ + libinstalld \ + libdiskusage \ + +c_includes := \ + frameworks/native/cmds/installd + +$(foreach file,$(test_src_files), \ + $(eval include $(CLEAR_VARS)) \ + $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \ + $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \ + $(eval LOCAL_SRC_FILES := $(file)) \ + $(eval LOCAL_C_INCLUDES := $(c_includes)) \ + $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \ + $(eval LOCAL_CLANG := true) \ + $(eval include $(BUILD_NATIVE_TEST)) \ +) |