blob: 939a9c71256c7ac841d6c7cd5952233e87c9a2ab [file] [log] [blame]
Iliyan Malchev7fd352e2016-08-10 08:02:31 -07001#!/bin/bash
2
3if [ ! -d hardware/interfaces ] ; then
4 echo "Where is hardware/interfaces?";
5 exit 1;
6fi
7
8packages=$(pushd hardware/interfaces > /dev/null; \
Iliyan Malchev15e15582016-09-17 18:42:46 -07009 find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
Iliyan Malchev7fd352e2016-08-10 08:02:31 -070010 cut -c3- | \
11 awk -F'/' \
12 '{printf("android.hardware"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
13 popd > /dev/null)
14
15for p in $packages; do
16 echo "Updating $p";
17 hidl-gen -Lmakefile -r android.hardware:hardware/interfaces $p;
Dan Willemsen242b34e2016-09-28 16:12:24 -070018 hidl-gen -Landroidbp -r android.hardware:hardware/interfaces $p;
Iliyan Malchev7fd352e2016-08-10 08:02:31 -070019done
Steven Moreland7b66dd92016-10-03 13:53:07 -070020
21bp="hardware/interfaces/Android.bp"
22androidbps=$(find hardware/interfaces/*/ \
23 -name "Android.bp" \
24 -exec dirname {} \; \
25 | sort)
26
27echo "Updating $bp"
28
29echo "// This is an autogenerated file, do not edit." > $bp;
30echo "subdirs = [" >> $bp;
31for a in $androidbps; do
32 echo " \"${a#*hardware/interfaces/}\"," >> $bp;
33done
34echo "]" >> $bp;