Don't have a ton of experience w/ kernel drivers, but I believe this should work.
Root issue you're running up against is that this is a kbuild makefile (check out documentation here: https://www.kernel.org/doc/Documentation/kbuild/modules.txt ). To build, you'll need to:
- Install the
linux-current-headers
package. This will download the build tools + linux headers you need to compile to /lib/modules/<linux version>/build
- In the directory of the driver you want to compile, run:
make -C /lib/modules/<linux version>/build M=$PWD
This will run make in the /lib/modules/<linux version>/build
directory, setting the directory of the repo you cloned to the variable M. The Makefile in the /lib/modules/...
directory contains the kbuild logic which will load the Makefile in the directory set in M and build the module.