
KSRCDIR = /lib/modules/`uname -r`/
PROGS = kstrax_ctr.ko kstrax_buf.ko


#if KERNELRELEASE is defined, we've been invoked from the
#kernel build system and can use its language.

ifneq ($(KERNELRELEASE),)

#include $(M)/make_1mod
include $(M)/make_2mod

#Otherwise we were called directly from the command
#line; invoke the kernel build system.

else
	KERNELDIR ?= /lib/modules/$(shell uname -r)/build
	PWD := $(shell pwd)

all:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules

install: all
	mkdir $(KSRCDIR)/kernel/drivers/kstrax/; \
	cp $(PROGS) $(KSRCDIR)/kernel/drivers/kstrax; \
	depmod -a;

uninstall:
	rm -r -f $(KSRCDIR)/kernel/drivers/kstrax/; \
	depmod -a;

distclean: clean

clean:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) clean

endif

