create new Makefile inside module source compilation folder having following line: obj-y += .o or if the source code is complicated, use the guidance from here. only then it's the right time to build module with make -C M=the_module_directory (example: make -C . M=extra/ )