#
# Makefile for the dazukofs-filesystem routines.
#
#richard
EXTRA_CFLAGS += -Wall -pthread -g3 
DAZUKOFS_KERNEL_SRC     = /lib/modules/`uname -r`/build
DAZUKOFS_KERNEL_INSTALL = /lib/modules/`uname -r`/kernel/fs/dazukofs

obj-m += dazukofs.o

dazukofs-objs := super.o inode.o file.o dentry.o mmap.o group_dev.o ign_dev.o ctrl_dev.o dev.o event.o

dazukofs_modules:
	$(MAKE) -C $(DAZUKOFS_KERNEL_SRC) SUBDIRS="`pwd`" modules
	$(MAKE) showfiles

dazukofs_install: dazukofs_modules
	mkdir -p $(DAZUKOFS_KERNEL_INSTALL)
	cp dazukofs.ko $(DAZUKOFS_KERNEL_INSTALL)
	/sbin/depmod -a
showfiles:
	cd test && $(MAKE) showfiles

clean:
	rm -f Module.symvers
	make -C $(DAZUKOFS_KERNEL_SRC) SUBDIRS="`pwd`" clean
	rm test/showfiles test/lib/libdazukofs.so 
	
.PHONY: dazukofs_modules dazukofs_install clean showfiles
