I am trying to compile a module with any source tree in the file system, but I am having problems with the Makefile. This was the original Makefile I had against the specified kernel:
obj-m += new-mod.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
This Makefile will compile correctly, but the goal is to compile it against any source tree. I tried just:
obj-m += new-mod.o
I thought everything was supposed to be, but I get the error:
make: *** No targets. Stop.
I also added:
all:
in the Makefile no difference except for the error message:
make: Nothing to be done for `all'
I tried a lot of documentation but no luck. I would really appreciate any help.