#! /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}Parsing '$build' for build instructions" #cat "$build"|while read line; do while read line; do # Skip comments case $line in [[:space:]]*\#*|\#*) continue; ;; [[:space:]]*) continue; ;; esac build_result="$build_tree"/`echo $line|sed -e 's/.*source[[:space:]]*\([^ ]*\)/\1/'` 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 # Read and eval line eval "$line" else ln -sf `cd $build_result && pwd` $build_tree/current echo " (build cached)" fi . "$build_action" done <"$build" PATH="$OLD_PATH"