#
#       Copyright (C) 1993 Bas Laarhoven.
#
# 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, 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; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
# $Source: /usr/src/distr/ftape-0.9.7/RCS/Makefile,v $
# $Author: bas $
#
# $Revision: 1.7 $
# $Date: 1993/12/04 12:53:35 $
# $State: Alpha $
#
#      Makefile for the QIC-40/80 floppy-tape driver for Linux.
#

# 
# Uncomment the following line if you used g++ to compile the kernel
#KERNEL_LANGUAGE_OPT=-DKERNEL_CPP_COMPILED -x c++

ifndef BUFFERS
BUFFERS = 3
endif
  
CFLAGS = -g -Wall -Wstrict-prototypes \
         -DLINUX -DKERNEL -D__KERNEL__ -DDYN_MODULE -DNR_BUFFERS=$(BUFFERS) \
         -O6 -fomit-frame-pointer -m486 $(KERNEL_LANGUAGE_OPT)

all: module

module: driver.o Makefile
	- rmmod driver
	insmod driver.o

driver.o: ftape-rw.o kernel-interface.o fdc-io.o ecc.o ftape-io.o calibr.o Makefile
	ld -r -o driver.o kernel-interface.o ftape-rw.o fdc-io.o ftape-io.o ecc.o calibr.o

fdc-io.o : fdc-io.c fdc-io.h Makefile \
        ftape-io.h ftape-rw.h kernel-interface.h 
	$(CC) $(CFLAGS) -c -o fdc-io.o fdc-io.c

ftape-io.o : ftape-io.c ftape-io.h Makefile \
        qic117.h fdc-io.h ftape-rw.h kernel-interface.h ftape-ioctl.h vendors.h
	$(CC) $(CFLAGS) -c -o ftape-io.o ftape-io.c

ecc.o : ecc.c ecc.h Makefile \
        fdc-io.h
	$(CC) $(CFLAGS) -c -o ecc.o ecc.c

ftape-rw.o : ftape-rw.c ftape-rw.h Makefile \
        kernel-interface.h qic117.h fdc-io.h ftape-io.h ecc.h
	$(CC) $(CFLAGS) -c -o ftape-rw.o ftape-rw.c

kernel-interface.o : kernel-interface.c kernel-interface.h Makefile \
        ftape-io.h ftape-rw.h fdc-io.h ftape-ioctl.h
	$(CC) $(CFLAGS) -c -o kernel-interface.o kernel-interface.c

calibr.o : calibr.c Makefile
	$(CC) $(CFLAGS) -c -o calibr.o calibr.c

clean:
	- rm -f a.out *.o core *~ OUTPUT gen_test
