#!/bin/bash

find *.h *.c *.cpp -newer blindfold > .new_files
if [ -s .new_files ]; then
  version=`sed -n 's/#define BUILD_COUNT //p' version.c`
  version=`expr $version + 1`
  echo VERSION = $version
  cp version.c .bak.version.c    
  sed "s/#define BUILD_COUNT .*/#define BUILD_COUNT $version/" < .bak.version.c > version.c
  echo Build needed.   This is build $version
  /usr/bin/make
fi

