#!/bin/ksh -p

# Trivial little wrapper script to make calling bdf_to_c.awk simpler.
# 
# Originally written by Philip Brown, 2002. Use/redistribute/modify freely. 
# version @(#) makevgafont 1.3@(#)

FILE="$1"

CC=${CC:-gcc}

case $FILE in
	*.bdf)
		;;
	*)
		print ERROR: must give a .bdf file
		exit 1
		;;
esac

if [[ ! -f $FILE ]]; then
	print ERROR: $FILE does not exist
	exit 1
fi

print Compiling "'vga_font'"
awk -f bdf_to_c.awk $FILE >vga_font.c
	$CC -c -D_KERNEL vga_font.c
	ld -r -o vga_font vga_font.o
print 'done. You should now be able to copy vga_font to /kernel/misc'
print ' (Dont forget to keep a backup of the current working one)'
