#! /bin/sh
#
# buildversion filename program version cflags

# ABOUT MOKit
# by Mike Ferris (mike@lorax.com)
#
# MOKit is a collection of useful and general objects.  Permission is 
# granted by the author to use MOKit in your own programs in any way 
# you see fit.  All other rights pertaining to the kit are reserved by the 
# author including the right to sell these objects as objects,  as part 
# of a LIBRARY, or as SOURCE CODE.  In plain English, I wish to retain 
# rights to these objects as objects, but allow the use of the objects 
# as pieces in a fully functional program.  Permission is also granted to 
# redistribute the source code of MOKit for FREE as long as this copyright 
# notice is left intact and unchanged.  NO WARRANTY is expressed or implied.  
# The author will under no circumstances be held responsible for ANY 
# consequences from the use of these objects.  Since you don't have to pay 
# for them, and full source is provided, I think this is perfectly fair.


if [ ! $# -eq 4 ] ; then
	echo "usage: buildversion filename program version cflags."
	echo "	filename is the version file to create."
	echo "	program is the name of the versioned file."
	echo "	version is the desired version string."
	echo "	cflags are the CFLAGS used to build the versioned file."
	exit 1
fi

rm -f $1
cat > $1 << EOF!
const char *version = "PROGRAM: $2 "
			"VERSION: $3 "
			"DEVELOPER: $USER "
			"BUILT: "__DATE__" "__TIME__" "
			"CFLAGS: $4";
EOF!
