0

For C/C++ build what option (if it exists) should be used to view all commands which were executed duration (make command). For a large project, I would like to know how exactly a particular .c file was compiled? What option was provided to gcc/clang?

If I execute ./configure make make install sometimes compiled commands are not visible.

  • What research did you do? `./configure` is not part of cmake. `What option was provided to gcc/clang?` `gcc` is not part of make. Overall, it's all _project specific_ and for _that particular project_ and _that particular build method_ there are different options. Cmake has a `--verbose` option, so _particular_ projects using cmake can use it, but every project has it's own. – KamilCuk Jun 01 '21 at 21:36
  • Let's say I have a random project and build works fine (./configure; make; make install etc). Every files compile without error. I'm interested in compiling particular file (clang/gcc filename.c). How I can get the proper way to compile it? – Ilya Zlatkin Jun 03 '21 at 14:48
  • Type `gcc filename.c` in your terminal. – KamilCuk Jun 03 '21 at 15:09
  • I want to figure out what are "". They supposed to be generated dynamically. Include paths are generated, paths to other dependencies etc. How to extra everything that is required for compilation? – Ilya Zlatkin Jun 03 '21 at 15:12
  • Yes - so enable verbose compilation _in that project_ . What research did you do? https://stackoverflow.com/questions/5820303/how-do-i-force-make-gcc-to-show-me-the-commands – KamilCuk Jun 03 '21 at 15:18
  • I'm try to figure out how some of the files are compiling for this project https://github.com/awslabs/aws-c-common, I saw this link. Don't know way, but commands from https://stackoverflow.com/questions/5820303/how-do-i-force-make-gcc-to-show-me-the-commands don't help – Ilya Zlatkin Jun 03 '21 at 15:36
  • And that project has `CMakeLists.txt`. As said, cmake has `--verbose` option that allows building with verbosity enable. But https://stackoverflow.com/a/50995904/9072753 should work - use `make VERBOSE=1` with cmake projects.. [Here is cmake manual](https://cmake.org/cmake/help/latest/manual/cmake.1.html), from it: `--verbose, -v Enable verbose output .. This option can be omitted if VERBOSE environment variable or CMAKE_VERBOSE_MAKEFILE cached variable is set.` – KamilCuk Jun 03 '21 at 15:40

0 Answers0