# 
# <LIC_AMD_STD>
# Copyright (c) 2004 Advanced Micro Devices, Inc.
# 
# 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 2 of the License, 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
# 
# The full GNU General Public License is included in this distribution in the
# file called COPYING
# </LIC_AMD_STD>
# 
# <CTL_AMD_STD>
# </CTL_AMD_STD>
# 
# <DOC_AMD_STD>
# Linux Frame Buffer Device Configuration
# </DOC_AMD_STD>
#
#

CC =		gcc -Wall -O2 -I.
BISON =		bison -d
FLEX =		flex
INSTALL =	install
RM =		rm -f

All:		tvoset


tvoset:		tvoset.o modes.tab.o lex.yy.o

tvoset.o:	tvoset.c tvoset.h fb.h
modes.tab.o:	modes.tab.c tvoset.h fb.h
lex.yy.o:	lex.yy.c tvoset.h modes.tab.h

lex.yy.c:	modes.l
		$(FLEX) modes.l

modes.tab.c:	modes.y
		$(BISON) modes.y

install:	tvoset
		if [ -f /sbin/tvoset ]; then rm /sbin/tvoset; fi
		$(INSTALL) tvoset /usr/sbin
		if [ ! -c /dev/fb0 ]; then mknod /dev/fb0 c 29 0; fi
		if [ ! -c /dev/fb1 ]; then mknod /dev/fb1 c 29 32; fi
		if [ ! -c /dev/fb2 ]; then mknod /dev/fb2 c 29 64; fi
		if [ ! -c /dev/fb3 ]; then mknod /dev/fb3 c 29 96; fi
		if [ ! -c /dev/fb4 ]; then mknod /dev/fb4 c 29 128; fi
		if [ ! -c /dev/fb5 ]; then mknod /dev/fb5 c 29 160; fi
		if [ ! -c /dev/fb6 ]; then mknod /dev/fb6 c 29 192; fi
		if [ ! -c /dev/fb7 ]; then mknod /dev/fb7 c 29 224; fi

clean:
		$(RM) *.o tvoset lex.yy.c modes.tab.c modes.tab.h
		$(RM) /usr/sbin/tvoset 
