#!/bin/bash if [ ! -d hardware/interfaces ] ; then echo "Where is hardware/interfaces?"; exit 1; fi 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 /dev/null) 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;