On 1/13/21 10:45 PM, Masahiro Yamada wrote: > On Sun, Jan 10, 2021 at 3:21 AM Denis Efremov <efremov@xxxxxxxxx> wrote: >> >> Hi, >> >> Is there a general way to get information about what CONFIG_ options >> enable compilation of *.o (*.[ch]) file? Maybe with kconfig command or from >> some generated files? > > > As far as I know, there is no tool or kconfig command to know > what CONFIG option enables which object. > > I also check Makefiles as you did below. > > > > > This is my workflow. > > I have my own utility functions in ~/.bashrc > > kgrep - grep only Kconfig files > mgrep - grep only Makefiles > > function kgrep() > { > find . -name .repo -prune -o -name .git -prune -o -type f \ > \( -name 'Kconfig*' -o -name 'Config.in' \) \ > -print0 | xargs -0 grep --color -n "$@" > } > > function mgrep() > { > find . -name .repo -prune -o -name .git -prune -o -type f \ > \( -name 'Makefile*' -o -name 'Kbuild*' -o -name "*.mk" \) \ > -print0 | xargs -0 grep --color -n "$@" > } > > > Then, I get this: > > masahiro@grover:~/ref/linux-next$ mgrep floppy.o > ./drivers/block/Makefile:14:obj-$(CONFIG_BLK_DEV_FD) += floppy.o > ./drivers/ide/Makefile:92: ide-gd_mod-y += ide-floppy.o ide-floppy_ioctl.o > > > > Maybe, there is a better way... > I don't know of anything better. I have scripts (instead of functions) findconfig and findmakefile, but they are not as nice as your functions. -- ~Randy You can't do anything without having to do something else first. -- Belefant's Law