#! /bin/bash # INPUT: # build_tree -> base of where to build stuff # build_action -> what to do for each file we need to compile # build -> file containing instructions to build library # OUTPUT: # build_result -> result directory OLD_PATH="$PATH" PATH="../compile:$PATH" echo "${spacing}Calling '$build' to build sources" build_result="$build_tree"/`basename $build` rm -f $build_tree/current if test ! -d "$build_result"; then mkdir "$build_result" ln -sf `cd $build_result && pwd` $build_tree/current . test.lib.build . "$build" else ln -sf `cd $build_result && pwd` $build_tree/current echo " (build cached)" fi . "$build_action" PATH="$OLD_PATH"