summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Moreland2017-03-20 06:19:10 -0500
committerSteven Moreland2017-03-20 06:26:20 -0500
commit3a18d73829936fd820eece982825b87c546a6257 (patch)
tree6a004eddc22862111c5816bf8b79c7d97ba8fffa /update-makefiles.sh
parente5796ef7a6f4a06ac1448cba5caac4c1a62427c1 (diff)
downloadplatform-hardware-interfaces-3a18d73829936fd820eece982825b87c546a6257.tar.gz
platform-hardware-interfaces-3a18d73829936fd820eece982825b87c546a6257.tar.xz
platform-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 d0cb91c3..88cc97b7 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,52 +1,8 @@
1#!/bin/bash 1#!/bin/bash
2 2
3if [ ! -d hardware/interfaces ] ; then 3source system/tools/hidl/update-makefiles-helper.sh
4 echo "Where is hardware/interfaces?";
5 exit 1;
6fi
7 4
8if [ ! -d system/libhidl/transport ] ; then 5do_makefiles_update \
9 echo "Where is system/libhidl/transport?"; 6 "android.hardware:hardware/interfaces" \
10 exit 1; 7 "android.hidl:system/libhidl/transport"
11fi
12 8
13packages=$(pushd hardware/interfaces > /dev/null; \
14 find . -type f -name \*.hal -exec dirname {} \; | sort -u | \
15 cut -c3- | \
16 awk -F'/' \
17 '{printf("android.hardware"); for(i=1;i<NF;i++){printf(".%s", $i);}; printf("@%s\n", $NF);}'; \
18 popd > /dev/null)
19
20for p in $packages; do
21 echo "Updating $p";
22 hidl-gen -Lmakefile -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
23 rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
24 hidl-gen -Landroidbp -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport $p;
25 rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
26done
27
28# subdirectories of hardware/interfaces which contain an Android.bp file
29android_dirs=$(find hardware/interfaces/*/ \
30 -name "Android.bp" \
31 -printf "%h\n" \
32 | cut -d "/" -f1-3 \
33 | sort | uniq)
34
35echo "Updating Android.bp files."
36
37for bp_dir in $android_dirs; do
38 bp="$bp_dir/Android.bp"
39 # locations of Android.bp files in specific subdirectory of hardware/interfaces
40 android_bps=$(find $bp_dir \
41 -name "Android.bp" \
42 ! -path $bp_dir/Android.bp \
43 -printf "%h\n" \
44 | sort)
45
46 echo "// This is an autogenerated file, do not edit." > "$bp";
47 echo "subdirs = [" >> "$bp";
48 for a in $android_bps; do
49 echo " \"${a#$bp_dir/}\"," >> "$bp";
50 done
51 echo "]" >> "$bp";
52done