obj-m += wendy.o
OUT_DIR := build
CUR_DIR := $(shell pwd)

.PHONY: kern_mod install uninstall dirprepare clean

kern_mod: wendy.c dirprepare
	make -C /lib/modules/$(shell uname -r)/build M=$(CUR_DIR) MO=$(CUR_DIR)/$(OUT_DIR)

install:
	sudo insmod build/wendy.ko

uninstall:
	sudo rmmod wendy

dirprepare:
	mkdir -p $(CUR_DIR)/$(OUT_DIR)

clean:
	make -C /lib/modules/$(shell uname -r)/build M=$(CUR_DIR) clean