-1

I have huge directory with makefiles, .c, .h .cpp etc. The final output (binary) is built using make.

To do that I have to find and investigate the source files that use <aio.h> and <execinfo.h> headers. So how do I find the files that use #include <aio.h> and #include <execinfo.h>

Renaud Pacalet
  • 25,260
  • 3
  • 34
  • 51
Mike
  • 147
  • 2
  • 16
  • 2
    Grep or a grep-like. – Dave S Jan 02 '19 at 22:11
  • 2
    If you need to auto-generate build dependencies you should probably have a look at [this](http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/). – G.M. Jan 02 '19 at 22:22
  • Sounds like you're looking for [`mkdep`](https://www.freebsd.org/cgi/man.cgi?query=mkdep&sektion=1&apropos=0&manpath=FreeBSD+5.3-RELEASE) – Barmar Jan 02 '19 at 23:20
  • Possible duplicate of [Identify which file has included some particular header file](https://stackoverflow.com/q/3438600/608639) – jww Jan 04 '19 at 03:34

2 Answers2

0

For browsing big code, cscope or ctags is used. Both needs to generate database. For cscope it can be done by command cscope -b-q -k and later cscope-d will give console menu for search options. Find or grep will be slow for browsing of big code.

anand
  • 163
  • 7
0
find . -name '*.c (or*.h)' -exec grep "thing_to_Search_for" '{}' \; -print

This command helped me achieve the results I needed.

Mike
  • 147
  • 2
  • 16