DEBFLAGS = -O2 CFLAGS += $(DEBFLAGS) CFLAGS += -I.. ifneq ($(KERNELRELEASE),) # call from kernel build system obj-m := scprint.o module_hunter.o else KERNELDIR ?= /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) default: analyze_this $(MAKE) -C $(KERNELDIR) M=$(PWD) modules endif clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions *.diff *.out analyze_this depend .depend dep: $(CC) $(CFLAGS) -M *.c > .depend analyze_this: analyze_this.c gcc -g analyze_this.c -o analyze_this ifeq (.depend,$(wildcard .depend)) include .depend endif