|
Make, only with dependencies |
Mark Oates
Member #1,146
March 2001
|
Hey guys, I'm looking for pointers on managing makefile targets and only linking the necessary binaries. Specifically, I'm compiling tests, I want to only compile and link the .o files necessary for that test. I believe this means the makefile will need to introspectively look into the source and headers for each object required, infer if any of the dependent files have been modified (including headers of dependencies), re-compile them, and then use those objects when linking the test. Right now the test file looks like this: https://github.com/MarkOates/fullscore/blob/master/Makefile#L80-L84 And I'm doing testing with Google Test on this project. Any tips on how to proceed? -- |
beoran
Member #12,636
March 2011
|
Personally, I would probably get CMake involved since it makes scripting for testing, etc that much easier. Of course, you could do it with pure make files but then there will be a lot of manual work getting things to work. |
bamccaig
Member #7,536
July 2006
|
Make handles static dependencies well. What it doesn't do very well is dynamic dependencies. For that you could generate a Makefile dynamically instead. I suppose that's what CMake and other related tools are sort of for. I just haven't found one that seemed worth the investment. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|