#!/bin/bash # # This checks that each header file can be compiled on its own. # sh_cc= sh_dir= sh_base=${0##*/} sh_tmpfile=/tmp/$sh_base-$USER.$$.c sh_outfile=$sh_tmpfile.out cd ${0%/*} sh_dir=${PWD%/*} function fail { local msg="$*" [[ -z "$msg" ]] && msg="failed" echo "$sh_base: $msg" >&2 exit 1 } function check_file { local file res file=$1 cat > $sh_tmpfile < [file 1] [file n]" fi sh_cc=$1 shift for file in "$@"; do check_file $file done