YCM-Generator
YCM-Generator copied to clipboard
Possibility avoiding the `make clean' step
For a Makefile project the generator runs make clean
before make [OPTS]
. Normally it's OK, but is undesirable when one wants to navigate through a large project he/she previously took hours to compile.
IMHO make --always-make [OPTS]
also does what we want. From the manual:
‘-B’ ‘--always-make’ Consider all targets out-of-date. GNU make proceeds to consider targets and their prerequisites using the normal algorithms; however, all targets so considered are always remade regardless of the status of their prerequisites.
This way the make clean
step can be avoided.
I strongly agree with this. The program cleaned my kernel build. At least I hope there is some warning about the clean operation.
Sorry for my delay in replying to this - it must have gotten lost in my inbox.
Part of the reason for using make clean
is that even if we use -B
on the first pass, we'll be storing the values of CC
/CXX
for the fake toolchain and marking those targets as compiled. The best solution to this is to use a build system that supports out of tree compilation (i.e. cmake or autotools), but that isn't always viable.
@shawn-peng Do you think a warning in the README would suffice?
@rdnetto Yes. Although I really hope there is no 'make clean', a warning will be fine if that is hard to achieve. I suggest to put it at the beginning in the 'Usage' section. Thanks.
Just release a YCM-Generator based tool, which basically process build log outputs and generate the corresponding compilation database file. The idea is to be faster (doesn't need a clean build or even an actual build) and more "cross-compilation friendly". I've used it successfully to index some large AOSP modules in ~1 minute and used its output with tools like YouCompleteMe, Deoplete and Rtags.
Feel free to try it out, open issues/feature requests and send PRs :)
https://github.com/nickdiego/compiledb-generator
Thanks,