diff options
author | Jaesoo Lee <jaesoo@google.com> | 2017-03-16 01:27:43 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-16 01:27:43 +0000 |
commit | 8b1c7e9956737cfe3e010f53819264beabfdae91 (patch) | |
tree | 7307f20470dcdfae4fc2274859a8130ea5f327d5 | |
parent | cfd9a11e48ece476400feee8fd50b64555ecdc46 (diff) | |
parent | 95a47feaf39ce17847247d4876a7ab88706b64b9 (diff) | |
download | android_external_toybox-8b1c7e9956737cfe3e010f53819264beabfdae91.tar.gz android_external_toybox-8b1c7e9956737cfe3e010f53819264beabfdae91.tar.bz2 android_external_toybox-8b1c7e9956737cfe3e010f53819264beabfdae91.zip |
added a new build module for statically linked toybox (toybox_static)
am: 95a47feaf3
Change-Id: I8b9ca8d6edb36a20a731a78d2bfcc501b4972855
-rw-r--r-- | Android.mk | 47 |
1 files changed, 42 insertions, 5 deletions
@@ -44,9 +44,7 @@ LOCAL_PATH := $(call my-dir) # # If you just want to use it as "toybox x" rather than "x", you can stop now. # # If you want this toy to have a symbolic link in /system/bin, add the toy to ALL_TOOLS. -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := \ +common_SRC_FILES := \ lib/args.c \ lib/dirtree.c \ lib/getmountlist.c \ @@ -210,7 +208,7 @@ LOCAL_SRC_FILES := \ toys/posix/wc.c \ toys/posix/xargs.c \ -LOCAL_CFLAGS += \ +common_CFLAGS := \ -std=c99 \ -Os \ -Wno-char-subscripts \ @@ -226,7 +224,16 @@ toybox_upstream_version := $(shell awk 'match($$0, /TOYBOX_VERSION.*"(.*)"/, ary toybox_sha := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null) toybox_version := $(toybox_upstream_version)-$(toybox_sha)-android -LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"' + +common_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"' + +############################################ +# toybox for /system +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(common_SRC_FILES) + +LOCAL_CFLAGS := $(common_CFLAGS) LOCAL_CLANG := true @@ -395,3 +402,33 @@ ALL_TOOLS := \ LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf toybox $(TARGET_OUT)/bin/$(t);) include $(BUILD_EXECUTABLE) + +############################################ +# static version to be installed in recovery + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(common_SRC_FILES) + +LOCAL_CFLAGS := $(common_CFLAGS) + +LOCAL_CLANG := true + +LOCAL_STATIC_LIBRARIES := liblog libcutils libselinux libcrypto libm libc + +# libc++_static is needed by static liblog +LOCAL_CXX_STL := libc++_static + +LOCAL_MODULE := toybox_static + +LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT)/sbin + +LOCAL_FORCE_STATIC_EXECUTABLE := true + +ALL_TOOLS := \ + modprobe \ + +# Install the symlinks. +LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,$(ALL_TOOLS),ln -sf ${LOCAL_MODULE} $(LOCAL_MODULE_PATH)/$(t);) + +include $(BUILD_EXECUTABLE) |