diff --git a/module/Makefile b/module/Makefile index 4962260..2d5fced 100644 --- a/module/Makefile +++ b/module/Makefile @@ -1,7 +1,6 @@ # Comment/uncomment the following line to disable/enable debugging #DEBUG = y - # Add your debugging flag (or not) to CFLAGS ifeq ($(DEBUG),y) DEBFLAGS = -O -g -DSCULL_DEBUG # "-O" is needed to expand inlines @@ -21,21 +20,31 @@ else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) +KBASE := /lib/modules/$(KVER) +KSRC ?= $(PWD) +KBUILD := $(KSRC) +MOD_DIR := $(KBASE)/kernel + +modules: default default: $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif - - clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions modules.order Module.symvers depend .depend dep: $(CC) $(CFLAGS) -M *.c > .depend +install: modules + @( [ `id -u` -ne 1 ] || { echo "Must be root to install modules"; exit 1; } ) + rm -f $(MOD_DIR)/extra/tty0tty.ko + $(MAKE) -C $(KERNELDIR) M=$(PWD) O=$(KBASE) modules_install + depmod -a ifeq (.depend,$(wildcard .depend)) include .depend endif +