summaryrefslogtreecommitdiffstats
path: root/update-makefiles.sh
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2017-03-20 04:19:10 -0700
committerSteven Moreland <smoreland@google.com>2017-03-20 04:26:20 -0700
commit3a18d73829936fd820eece982825b87c546a6257 (patch)
tree6a004eddc22862111c5816bf8b79c7d97ba8fffa /update-makefiles.sh
parente5796ef7a6f4a06ac1448cba5caac4c1a62427c1 (diff)
downloadandroid_hardware_interfaces-3a18d73829936fd820eece982825b87c546a6257.tar.gz
android_hardware_interfaces-3a18d73829936fd820eece982825b87c546a6257.tar.bz2
android_hardware_interfaces-3a18d73829936fd820eece982825b87c546a6257.zip
Use simplified update-makefiles.sh script.
Test: update-makefiles Bug: 35870521 Change-Id: I652db1f458f07f0b254966c2acee0b441a0bcae1
Diffstat (limited to 'update-makefiles.sh')
-rwxr-xr-xupdate-makefiles.sh52
1 files changed, 4 insertions, 48 deletions
diff --git a/update-makefiles.sh b/update-makefiles.sh
index d0cb91c38..88cc97b79 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,52 +1,8 @@
#!/bin/bash
-if [ ! -d hardware/interfaces ] ; then
- echo "Where is hardware/interfaces?";
- exit 1;
-fi
+source system/tools/hidl/update-makefiles-helper.sh
-if [ ! -d system/libhidl/transport ] ; then
- echo "Where is system/libhidl/transport?";
- exit 1;
-fi
+do_makefiles_update \
+ "android.hardware:hardware/interfaces" \
+ "android.hidl:system/libhidl/transport"
-packages=$(pushd hardware/interfaces > /dev/null; \
- find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
- cut -c3- | \
- awk -F'/' \
- '{printf("android.hardware"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
- popd > /dev/null)
-
-for p in $packages; do
- echo "Updating $p";
- hidl-gen -Lmakefile -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
- hidl-gen -Landroidbp -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
- rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
-done
-
-# subdirectories of hardware/interfaces which contain an Android.bp file
-android_dirs=$(find hardware/interfaces/*/ \
- -name "Android.bp" \
- -printf "%h\n" \
- | cut -d "/" -f1-3 \
- | sort | uniq)
-
-echo "Updating Android.bp files."
-
-for bp_dir in $android_dirs; do
- bp="$bp_dir/Android.bp"
- # locations of Android.bp files in specific subdirectory of hardware/interfaces
- android_bps=$(find $bp_dir \
- -name "Android.bp" \
- ! -path $bp_dir/Android.bp \
- -printf "%h\n" \
- | sort)
-
- echo "// This is an autogenerated file, do not edit." > "$bp";
- echo "subdirs = [" >> "$bp";
- for a in $android_bps; do
- echo " \"${a#$bp_dir/}\"," >> "$bp";
- done
- echo "]" >> "$bp";
-done