#!/bin/bash function do_subdirs { local subdirs="zafl" local my_cwd=$PWD for subdir in $subdirs do cd $subdir if [[ -x ./get-packages.sh ]]; then ./get-packages.sh "$@" fi done } function main() { set -x local here_dir=$(pwd) local grpc_packs="build-essential autoconf libtool pkg-config" # install each subdirectory that needs installing. do_subdirs "$@" # install my packages. sudo apt install -y $grpc_packs if [[ -d $here_dir/third-party/grpc ]]; then cd $here_dir/third-party/grpc if [[ ! -x third_party/protobuf/src/protoc ]] && [[ ! -x /usr/local/bin/protoc ]] ; then if [[ ! -f Makefile ]]; then cmake . fi make -j 3 sudo make install cd $here_dir/third-party/grpc pwd sudo make install fi cd $here_dir fi } main "$@"