:
# hexdump - dump a file as hexadecimal
# Copyright (c) 1991 Peter Miller
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
echo "#"
echo "# You may need to change this for your system."
echo "# The \`\`h'' directory supplements your system, not replacing it."
echo "# The first variation is for gcc when it isn't the native complier,"
echo "# the second variation is for systems with missing ANSI C include files,"
echo "# the third variation is for conforming ANSI C implementations."
echo "H = -I/usr/local/lib/gcc-include -I/usr/include -Ih"
echo "# H = -I/usr/include -Ih"
echo "# H ="
echo
echo "#"
echo "# the name of the compiler to use"
echo "#	cook will compile on non-ANSI-C compilers, but you need a"
echo "#	functioning stdarg.h, which rules out cc on Sun sparc."
echo "#	The supplied h/stdarg.h works on many systems, but not Sun sparc."
echo "#"
echo "CC = gcc"
echo
echo "#"
echo "# compiler flags, except include"
echo "#"
echo "CFLAGS = -O"
echo "# CFLAGS = -g"
echo
echo "#"
echo "# extra libraries required for your system"
echo "#"
echo "LIBRARIES ="
echo "# LIBRARIES = -lbsd"
echo
echo "# You should not need to alter anything below this point."
echo "#------------------------------------------------------------"
obj_files=
test_files=
echo
echo "all: hexdump"
for file in $*
do
	case $file in

	*.c)
		basename=`basename $file .c`
		dep=`c_incl -I. -ns -nc $file`
		echo
		echo "$basename.o: $file" $dep
		echo "	$(CC) $(CFLAGS) -I. $(H) -c $file"
		obj_files="$obj_files $basename.o"
		;;

	test/*/*)
		root=`basename $file .sh`
		echo
		echo "${root}: all $file"
		echo "	sh $file"
		test_files="$test_files ${root}"
		;;

	*)
		;;
	esac
done

echo
echo "hexdump:" $obj_files
echo "	$(CC) -o hexdump $obj_files $(LIBRARIES)"

echo
echo "sure:" $test_files
echo "	@echo Passed All Tests"

exit 0
