# Generated automatically from Makefile.in by configure.
# Makefile.in -- template makefile for compiling the Toshiba Linux Utiltites
#
# Copyright 1997-2000  Jonathan A. Buzzard (jonathan@buzzard.org.uk)
# Copyright 1997-2000  Jonathan A. Buzzard (jonathan@buzzard.org.uk)
#
# $Log: Makefile.in,v $
# Revision 1.1  1999/12/17 12:37:48  jab
# Initial revision
#
#
# 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.
#
#

VERSION=1.9.9
PROGRAMS = tosh_lcd 

INSTALL = /usr/bin/install -c
BININSTALL = ${INSTALL}
MANINSTALL = ${INSTALL} -m 644
prefix = /usr/local
BINDESTDIR = /usr/local/bin
MANDESTDIR = ${prefix}/man
YACC = bison -y
LEX = flex
LEXLIB = -lfl
MODDIR = /lib/modules/`uname -r`/misc

CC = gcc
LD = ld
LDFLAGS = -s
KERNEL = -D__KERNEL__ -DKERNEL -DMODULE 
CFLAGS = -m486 -O2 -Wall -I../../src -DLINUX  -I/usr/X11R6/include -I/usr/lib/glib/include

LCD_OBJS = tosh_lcd.o
OBJS = $(LCD_OBJS)

LNK_OBJS = ../../src/sci.o 

XLIBS = -L/usr/X11R6/lib -lX11
WMLIBS = -L/usr/X11R6/lib -lXpm -lX11 -lXext
GTKLIBS = -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXext -lX11 -lm
GTKFLAGS = -I/usr/X11R6/include -I/usr/lib/glib/include
XMESSAGE = /usr/X11R6/bin/xmessage
WALL = /usr/bin/wall

.c.o:
	$(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -DBINDIR=\"$(BINDESTDIR)\"\
	-DXMESSAGE=\"$(XMESSAGE)\" -DWALL=\"$(WALL)\" -c $<


all: $(PROGRAMS) 

tosh_lcd: $(LCD_OBJS)
	$(CC) $(LDFLAGS) -o $@ $(LCD_OBJS) $(LNK_OBJS)

install: all
	if [ "`ls -l /dev/toshiba 2>/dev/null | awk '{print $$6}'`" != "181" ] \
		; then rm -f/dev/toshiba ; mknod -m 666 /dev/toshiba c 10 181 ; fi
	$(BININSTALL) toshiba.o $(MODDIR)
	$(BININSTALL) -m 755 $(PROGRAMS) $(BINDESTDIR)
	chmod 4755 $(BINDESTDIR)/thotswap	
	if ! modprobe -c | grep -q 'alias char-major-10-181 toshiba' ; then \
		if [ -r /etc/modutils/aliases ] ; then \
			echo 'alias char-major-10-181 toshiba' \
				>> /etc/modutils/aliases ; \
			/sbin/update-modules ; \
		else \
			echo 'alias char-major-10-181 toshiba' \
				>> /etc/conf.modules ; \
		fi ; \
	fi

clean:
	rm -f *.o *.bak $(PROGRAMS) core  a.out

distclean: clean
	rm -f Makefile

depend:
	cp Makefile Makefile.bak
	sed '/^#----- dependences -----/q' Makefile.bak >Makefile
	echo >>Makefile
	$(CC) $(CFLAGS) -M $(OBJS:.o=.c) |\
	sed 's/\/usr\/[^ ]* *//g;/^  \\$$/d' |\
	grep -v '^ \\$$' >>Makefile

#----- dependences -----

tosh_lcd.o: tosh_lcd.c \
 ../../src/sci.h ../../src/toshiba.h
