I am just trying to learn how to driver modules for Linux Kernel. I followed Linux Device drivers 3rd edition book and started my work. I created a sample program and makefile. Please find my makefile contents below.
obj-m += testModule.o
make -C /lib/modules/3.2.36/build M=$(PWD) modules
I saved this makefile in my home directory. Whenever I am trying to execute this file using
make
command I am getting
make: *** No targets. Stop
error. Can someone please help me?
Thanks in advance.
all:ormy_program:orfoo:(the:is critical) immediately before the line that saysmake -C /lib/modules/3.2.36/build M=$(PWD) modules, and make sure that that line (themake -C ...line) is indented by a tab. – Scott Jan 30 at 1:36Makefiles is not necessarily bad, but you’re probably better off avoiding it. // @Benji: I disagree. It could have been asked on Stack Overflow or Super User, but it’s in scope for Unix and Linux. – Scott Jan 30 at 23:45