You cannot use the traditional Makefile style with Linux kernel modules; while you may be able to make something work, it will be a painful experience.
Start by reading the file Documentation/kbuild/modules.txt ; it describes exactly what you need to do when writing the Makefile module so that it can conveniently connect to the Kbuild core. Your Makefile will probably look something like this:
 ifneq ($(KERNELRELEASE),)  
Please believe me about it; while you might think that you are βjust one small changeβ to get your own Makefile , even minor changes in the kernel version will completely ruin your assembly again and again. Just take an hour to write a Kbuild -compatible Makefile for your module. I spent several weeks of my life trying to preserve a pre-existing Makefile when the Kbuild framework was introduced. Each new core made me lose hours of performance.
 source share