# ------------------------------------------------------ #
# Makefile 						 #
# ------------------------------------------------------ #

KVER           := $(shell uname -r)
KDIR           := /lib/modules/$(KVER)/build
KMISC          := /lib/modules/$(KVER)/kernel/drivers/net/
KEXT           := $(shell echo $(KVER) | sed -ne 's/^2\.[567]\..*/k/p')o
KFLAG          := 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x

modules:
ifeq ($(KFLAG),24x)
	$(MAKE) -f Makefile_linux24x
else
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD)/src modules
endif


clean:
	rm -f *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags


install:
	install -m 644 -c r1000.$(KEXT) $(KMISC)


ifneq ($(KFLAG),24x)
include $(PWD)/src/Makefile_linux26x
endif
 

