obj-m := ecryptfs.o
ecryptfs-objs := dentry.o file.o inode.o main.o super.o mmap.o crypto.o keystore.o messaging.o netlink.o debug.o

KDIR := '/lib/modules/2.6.18-8.el5/build'
PWD := $(shell pwd)

all: default

install: default
	mkdir -p $(DESTDIR)//lib/modules/2.6.18-8.el5/kernel/fs/ecryptfs/
	cp ecryptfs.ko $(DESTDIR)//lib/modules/2.6.18-8.el5/kernel/fs/ecryptfs/
	depmod -a

default:
	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

clean:
	-rm -f Module.symvers
	-rm -f *.o
	-rm -f *.ko
	-rm -f *.mod.[co]
	-rm -f *~
	-rm -f .[a-z]*
	-rm -rf .tmp_versions
