extract_utils: Add ability to set custom device guard

In some cases we may not want to check against TARGET_DEVICE so allow
setting a custom variable to check against

Change-Id: Ia2fb338f453137a95a59c6940b0cc16b261505bf
gugelfrei
Rashed Abdel-Tawab 8 years ago
parent 5f173157c4
commit d53bff1f45
No known key found for this signature in database
GPG Key ID: D8D7566B7B517C32

@ -459,6 +459,7 @@ EOF
# write_headers: # write_headers:
# #
# $1: devices falling under common to be added to guard - optional # $1: devices falling under common to be added to guard - optional
# $2: custom guard - optional
# #
# Calls write_header for each of the makefiles and creates # Calls write_header for each of the makefiles and creates
# the initial path declaration and device guard for the # the initial path declaration and device guard for the
@ -466,13 +467,19 @@ EOF
# #
function write_headers() { function write_headers() {
write_header "$ANDROIDMK" write_header "$ANDROIDMK"
GUARD="$2"
if [ -z "$GUARD" ]; then
GUARD="TARGET_DEVICE"
fi
cat << EOF >> "$ANDROIDMK" cat << EOF >> "$ANDROIDMK"
LOCAL_PATH := \$(call my-dir) LOCAL_PATH := \$(call my-dir)
EOF EOF
if [ "$COMMON" -ne 1 ]; then if [ "$COMMON" -ne 1 ]; then
cat << EOF >> "$ANDROIDMK" cat << EOF >> "$ANDROIDMK"
ifeq (\$(TARGET_DEVICE),$DEVICE) ifeq (\$($GUARD),$DEVICE)
EOF EOF
else else
@ -481,7 +488,7 @@ EOF
exit 1 exit 1
fi fi
cat << EOF >> "$ANDROIDMK" cat << EOF >> "$ANDROIDMK"
ifneq (\$(filter $1,\$(TARGET_DEVICE)),) ifneq (\$(filter $1,\$($GUARD)),)
EOF EOF
fi fi

Loading…
Cancel
Save