OSDN Git Service

Use "git rev-parse" for the toybox version.
authorElliott Hughes <enh@google.com>
Sat, 18 Apr 2015 21:03:18 +0000 (14:03 -0700)
committerElliott Hughes <enh@google.com>
Wed, 22 Apr 2015 00:02:00 +0000 (17:02 -0700)
This is similar to upstream commit 90afbad4c1f115d5363fe99eb797d2458cd298a0,
but without relying on tags (which we don't have) and with an extra
"-android" on the end.

Change-Id: Iec1c50acf2615236213d511ff10845a31c9b9d0f

Android.mk

index b2e24ce..a7424da 100644 (file)
@@ -207,6 +207,9 @@ LOCAL_CFLAGS += \
     -ffunction-sections -fdata-sections \
     -fno-asynchronous-unwind-tables \
 
+toybox_version := $(shell git -C $(LOCAL_PATH) rev-parse --short=12 HEAD 2>/dev/null)-android
+LOCAL_CFLAGS += -DTOYBOX_VERSION='"$(toybox_version)"'
+
 LOCAL_CLANG := true
 
 LOCAL_SHARED_LIBRARIES := libcutils libselinux