1ifneq ($(KERNELRELEASE),) 2 obj-m += test-cmpxchg-nolock.o 3else 4KERNELDIR ?= /lib/modules/$(shell uname -r)/build 5PWD := $(shell pwd) 6KERNELRELEASE = $(shell cat $(KERNELDIR)/$(KBUILD_OUTPUT)/include/linux/version.h | sed -n 's/.*UTS_RELEASE.*\"\(.*\)\".*/\1/p') 7ifneq ($(INSTALL_MOD_PATH),) 8 DEPMOD_OPT := -b $(INSTALL_MOD_PATH) 9endif 10 11default: 12 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules 13 14modules_install: 15 $(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install 16 if [ -f $(KERNELDIR)/$(KBUILD_OUTPUT)/System.map ] ; then /sbin/depmod -ae -F $(KERNELDIR)/$(KBUILD_OUTPUT)/System.map $(DEPMOD_OPT) $(KERNELRELEASE) ; fi 17 18clean: 19 $(MAKE) -C $(KERNELDIR) M=$(PWD) clean 20endif 21