Advertisement
stream13

easy Makefile for kernel module

Sep 2nd, 2014
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 0.26 KB | None | 0 0
  1. NAME=your_mod_name
  2. obj-m += $(NAME).o
  3.  
  4. all: kernel
  5.  
  6. kernel:
  7.     make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
  8.  
  9. clean:
  10.     make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
  11.  
  12.  
  13. im:
  14.     sudo insmod $(NAME).ko
  15.  
  16. rm:
  17.     sudo insmod $(NAME)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement