OS = $(shell uname -s)

KMOD = elx_pt

ifndef KERN_VERS
       KERN_VERS=$(shell uname -r)
endif
ifndef VERSION
        VERSION=$(shell pwd|cut -f5 -d/)
endif

obj-m := $(KMOD).o

$(KMOD)-y :=	elx_pt_driver.o elx_sli.o

ifeq ($(OS), Linux)
all:	$(KMOD).ko
endif

ifeq ($(OS), FreeBSD)
all:	list_release_files
endif


$(KMOD).ko:	elx_pt_driver.c elx_sli.c
	make -C /lib/modules/$(KERN_VERS)/build M=$(PWD) modules

clean:
	rm -f *.o *.ko

RELEASE_FILES	= \
	elx_pt_driver.c \
	elx_pt_driver.h \
	elx_sli.c \
	elx_sli.h \
	ioctl.h \
	version.h \
	Makefile

list_release_files:
	@echo $(RELEASE_FILES)
