Makefile 446 B

1234567891011121314151617181920212223
  1. KERNEL_VER:=$(shell uname -r)
  2. KERNEL_DIR:=/lib/modules/$(KERNEL_VER)/build
  3. INSTALL_DIR:=/lib/modules/$(KERNEL_VER)/ttyPos
  4. obj-m := ttyPos.o
  5. all:
  6. $(MAKE) modules -C $(KERNEL_DIR) SUBDIRS=$(shell pwd)
  7. clean:
  8. $(RM) *.o *.ko *.mod.* .*.cmd *~
  9. $(RM) -r .tmp_versions
  10. install: all
  11. install -D -m 644 ttyPos.ko $(INSTALL_DIR)/ttyPos.ko
  12. /sbin/depmod -a
  13. uninstall:
  14. modprobe -r ttyPos ; echo -n
  15. $(RM) $(INSTALL_DIR)/ttyPos.ko
  16. /sbin/depmod -a