building individual files in subdirectories

Christoph Hellwig
2019-05-28T12:12:12Z

A few kernel modules have source files in multiple subdirectories.
Trying to build just a single object of a source file in such a
subdirectory currently doesn't work.

For example:

hch@brick:~/work/xfs$ make fs/xfs/libxfs/xfs_alloc.o
CALL scripts/checksyscalls.sh
CALL scripts/atomic/check-atomics.sh
DESCEND objtool
scripts/Makefile.build:42: fs/xfs/libxfs/Makefile: No such file or directory
make[1]: *** No rule to make target 'fs/xfs/libxfs/Makefile'. Stop.
make: *** [Makefile:1747: fs/xfs/libxfs/xfs_alloc.o] Error 2

Is there any reasonably easy way to get this to work?