Mar. 23rd, 2005
Makefile question for the LJ Genie
Mar. 23rd, 2005 08:59 pmDear wise and all-knowing LJ Genie, brought to us by the also quite wise but maybe not as all-knowing
madbard,
What's a good way to handle nested header file dependencies in a makefile? I'm in a situation where I need to compile (as a standalone executable) a small piece of a much larger piece of software, and there is a large src/include directory with many subdirectories. The source I need to compile #includes things in src/include and some of the subdirectories, and some of those headers in the subdirectories #include headers in other subdirectories, and of course those #include directives are relative (presumably to something specified in Makefile.global, but I'm not entirely clear on how) and so gcc complains that it can't find the correct headers.
If it was just a matter of dependencies that compile to object code and then get linked to each other, that wouldn't be an issue, but these are all headers. I can get it to compile if I dump all the relevant header files to one directory and then strip out the paths, but that's ugly. Please, LJ Genie, show me a better way!
Also, how can I keep my cat from having such bad catfood breath?
![[livejournal.com profile]](https://www.dreamwidth.org/img/external/lj-userinfo.gif)
What's a good way to handle nested header file dependencies in a makefile? I'm in a situation where I need to compile (as a standalone executable) a small piece of a much larger piece of software, and there is a large src/include directory with many subdirectories. The source I need to compile #includes things in src/include and some of the subdirectories, and some of those headers in the subdirectories #include headers in other subdirectories, and of course those #include directives are relative (presumably to something specified in Makefile.global, but I'm not entirely clear on how) and so gcc complains that it can't find the correct headers.
If it was just a matter of dependencies that compile to object code and then get linked to each other, that wouldn't be an issue, but these are all headers. I can get it to compile if I dump all the relevant header files to one directory and then strip out the paths, but that's ugly. Please, LJ Genie, show me a better way!
Also, how can I keep my cat from having such bad catfood breath?