#!/bin/bash
-if [ ! -d hardware/interfaces ] ; then
- echo "Where is hardware/interfaces?";
- exit 1;
-fi
+source system/tools/hidl/update-makefiles-helper.sh
-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)
+do_makefiles_update \
+ "android.hardware:hardware/interfaces" \
+ "android.hidl:system/libhidl/transport"
-for p in $packages; do
- echo "Updating $p";
- hidl-gen -Lmakefile -r android.hardware:hardware/interfaces $p;
- hidl-gen -Landroidbp -r android.hardware:hardware/interfaces $p;
-done
-
-bp="hardware/interfaces/Android.bp"
-androidbps=$(find hardware/interfaces/*/ \
- -name "Android.bp" \
- -exec dirname {} \; \
- | sort)
-
-echo "Updating $bp"
-
-echo "// This is an autogenerated file, do not edit." > $bp;
-echo "subdirs = [" >> $bp;
-for a in $androidbps; do
- echo " \"${a#*hardware/interfaces/}\"," >> $bp;
-done
-echo "]" >> $bp;
\ No newline at end of file