0

I am trying to build the modules in folder "drivers/md/" using the steps in the answer How (recipe) to build only one kernel module?

But I am getting the below error

# make -C /lib/modules/$(uname -r)/build M=drivers/md modules
make: Entering directory '/usr/src/linux-headers-5.0.0-36-generic'
make[2]: *** No rule to make target 'drivers/md/bcache/alloc.o', needed by 
'drivers/md/bcache/bcache.o'.  Stop.
make[1]: *** [scripts/Makefile.build:515: drivers/md/bcache] Error 2
make: *** [Makefile:1614: _module_drivers/md] Error 2
make: Leaving directory '/usr/src/linux-headers-5.0.0-36-generic'

what am I doing wrong?

Haris
  • 149

1 Answers1

0

The error is telling you that you do not have a file drivers/md/bcache/alloc.o available to make, at a point where make is looking for it. Your path to file should normally look like ../drivers/md/bcache/alloc.o or even better you can add the exact directory using the -I argument to gcc.

For a full , less-ambiguous answer please add your MakeFile to your OP

NetIceGear
  • 641
  • 3
  • 8