
TCL = tclsh
TCL2H	= tcl2h.tcl
TCL2MAK = tcl2mak.tcl
TARGET = configSTR.h configSTR.mak configINT.h configINT.mak

GCC = gcc
INCLUDE = -I 
C_FLAGS = -Wall -O -pipe $(INCLUDE)
GLOBAL = configINT.tcl configSTR.tcl


ifneq ($(KERNELRELEASE),)
obj-m := tkusb.o
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

all auto rebuild:	$(TARGET) build_module
	 
build_module:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

new:	clean all
	
clean:
	rm -f tkusb.o tkusb.mod.o tkusb.ko tkusb.mod.c $(TARGET)

%.h: %.tcl $(TCL2H)
	$(TCL) $(TCL2H) $< > $@

%.mak: %.tcl $(TCL2MAK)
	$(TCL) $(TCL2MAK) $< > $@

endif
