Open seujza opened 5 years ago
What happens if you run make menuconfig
first?
Also fails with compiledb -n make O=build
after running `make O=build defconfig
Linux kernel comes with "scripts/clang-tools/gen_compile_commands.py" that can generate "compile_commands.json" by parsing ".cmd" files.
I've had success with gen_compile_commands.py
. However, it requires you to run a full build first, which takes a while. I was hoping compiledb -n
could make this faster, but I get this, even though I have generated a config and running make LLVM=1 -k
itself works fine:
$ compiledb -n make LLVM=1
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[1]: *** [/home/rrc/src/linux/Makefile:776: .config] Error 1
make[1]: Failed to remake makefile 'include/config/auto.conf.cmd'.
make[1]: Failed to remake makefile 'include/config/auto.conf'.
make: *** [Makefile:240: __sub-make] Error 2
The issue seems to be the -B
flag. It seems like compiledb tries to work around this, but the workaround isn't working for the linux kernel: https://github.com/nickdiego/compiledb/blob/master/compiledb/commands/make.py#L13
I've had success with
gen_compile_commands.py
. However, it requires you to run a full build first, which takes a while. I was hopingcompiledb -n
could make this faster, but I get this, even though I have generated a config and runningmake LLVM=1 -k
itself works fine:$ compiledb -n make LLVM=1 *** *** Configuration file ".config" not found! *** *** Please run some configurator (e.g. "make oldconfig" or *** "make menuconfig" or "make xconfig"). *** make[1]: *** [/home/rrc/src/linux/Makefile:776: .config] Error 1 make[1]: Failed to remake makefile 'include/config/auto.conf.cmd'. make[1]: Failed to remake makefile 'include/config/auto.conf'. make: *** [Makefile:240: __sub-make] Error 2
I encounter the same problem with compiledb -n make bzImage
Hi, when I exec
compiledb -n make
in Linux kernel source code,It's not working there is the log Thanks!