summarylogtreecommitdiffstats
path: root/Makefile
blob: 59ad4471b657bf725362df4128c25aa7a4efe5d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
modname := shiftfs
obj-m := $(modname).o

KVERSION := $(shell uname -r)
KDIR ?= /lib/modules/`uname -r`/build
PWD := "$$(pwd)"

ifdef DEBUG
CFLAGS_$(obj-m) := -DDEBUG
endif

EXTRA_CFLAGS := -DSHIFTFS_MAGIC=0x6a656a62

default:
	$(MAKE) -C $(KDIR) M=$(PWD) EXTRA_CFLAGS="${EXTRA_CFLAGS}" modules

clean:
	$(MAKE) O=$(PWD) -C $(KDIR) M=$(PWD) clean

load:
	-rmmod $(modname)
	insmod $(modname).ko

install:	
	install -m 0755 -o root -g root $(modname).ko /lib/modules/$(KVERSION)/fs/
	depmod -a

uninstall:
	rm /lib/modules/$(KVERSION)/fs/$(modname).ko
	depmod -a