YCM-Generator icon indicating copy to clipboard operation
YCM-Generator copied to clipboard

Possibility avoiding the `make clean' step

Open wyl8899 opened this issue 8 years ago • 4 comments

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.

wyl8899 avatar Aug 02 '16 12:08 wyl8899

I strongly agree with this. The program cleaned my kernel build. At least I hope there is some warning about the clean operation.

shawn-peng avatar Oct 29 '16 02:10 shawn-peng

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 avatar Oct 30 '16 03:10 rdnetto

@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.

shawn-peng avatar Oct 30 '16 07:10 shawn-peng

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,

nickdiego avatar Aug 03 '17 00:08 nickdiego