#
#	Makefile for making XNET-card device driver for Linux 1.2.x
#

#  The easy question: What compiler...
CC=	gcc -O6 -Wall
#
#  A tough one:  Did you compile your current kernel with  MODVERSIONS 
#                support ?  (If you didn't, the linkage of the produced
#                module will fail...)
#
CFLAGS=	-DCONFIG_MODVERSIONS
#
#  Another tough:  What is the directory where your modules go with
#		   your current kernel ?
#
MODDIR=/lib/modules/1.2.11/net

all:	pppd xdebug prtmem xnet.o

install: all
	install -c -m 644 xnet.o $(MODDIR)/xnet.o
	install -c -m 700 pppd	 /sbin/xnetpppd
	install -c -m 700 xdebug /sbin/xnetdebug

clean:
	rm -f *.o *~ pppd xdebug prtmem

# The driver itself:
xnet.o: xnet.c
	$(CC) $(CFLAGS) -DMODULE -D__KERNEL__ -c xnet.c

# PPP-state-machine:
pppd:	pppfsm.o devopen.o
	$(CC) $(CFLAGS) -o pppd pppfsm.o devopen.o

xdebug:	xdebug.o
	$(CC) $(CFLAGS) -o xdebug xdebug.o devopen.o

#
#  This program works only when the driver is compiled into the kernel,
#  and uses static allocation in the  $SRC/drivers/net/Space.c
#
prtmem:	prtmem.o
	$(CC) $(CFLAGS) -o prtmem prtmem.o devopen.o
