#
# Makefile for nsp_cs
#

# $Id: Makefile,v 1.18 2001/08/09 05:09:14 elca Exp $

VERSION=2.7.1#

# If you use kernel 2.2, uncomennt this line
#NSP_KERNEL_2_2=1

ifdef NSP_KERNEL_2_2
PCMCIA_DEF = -DNSP_KERNEL_2_2=1 -I/usr/src/pcmcia-cs-3.1.26/include
else
PCMCIA_DEF =
endif

# Select your CPU type
# ARCH_DEF = -march=i386   # i386
# ARCH_DEF = -march=i486   # i486
# ARCH_DEF = -march=i586   # pentium / pentium MMX
ARCH_DEF = -march=i686     # pentium 2 / pentium 3 / pentium 4
# ARCH_DEF = -march=k6     # K6
# ARCH_DEF = -march=athlon # Athlon

TOPDIR   = /usr/src/linux
CC       = gcc

CFLAGS = -MD -O2 -Wall -Wstrict-prototypes -pipe -mpreferred-stack-boundary=2 \
	$(ARCH_DEF) \
	-D__KERNEL__ \
	-DMODULE -DMODVERSIONS -include $(TOPDIR)/include/linux/modversions.h \
	-DPCMCIA  \
	$(PCMCIA_DEF) -I$(TOPDIR)/include

.PHONY: clean dist all22

all: nsp_cs.o

all22:
	make NSP_KERNEL_2_2=1 TOPDIR=/usr/src/linux-2.2.19 all

.c.o:
	$(CC) $(CFLAGS) -c $<

nsp_cs.o: nsp_cs.c nsp_cs.h nsp_io.h nsp_message.c
	$(CC) $(CFLAGS) -c nsp_cs.c

nsp_cb.o: nsp_cb.c
	$(CC) $(CFLAGS) -c nsp_cb.c

clean:
	rm -f nsp_cs.o

dist:
	rm -rf nsp_cs-$(VERSION)/
	mkdir nsp_cs-$(VERSION)
	cp ChangeLog README.nsp_cs README.nsp_cs.eng Q_and_A.nsp_cs Q_and_A.nsp_cs.eng Makefile Configure.help.nsp_cs Configure.help.nsp_cs.eng nsp_cs-$(VERSION)/
	cp nsp_cs.c nsp_cs.h nsp_io.h nsp_debug.c nsp_message.c nsp_cs.conf nsp_cs.4 nsp_cs.4j nsp_cs-$(VERSION)/
	tar cvf nsp_cs-$(VERSION).tar nsp_cs-$(VERSION)/
	gzip -9f nsp_cs-$(VERSION).tar

# end
