In my project, I want to build a shared library libfoo.so
first, then build some test programs that use this shared library. For the test programs, if I use need
need libfoo.so
then they will be rebuilt every time libfoo.so
is updated. Instead, I want to build the test programs after libfoo.so
exists and the header files change (or build the test programs for the first).
The dependency on the header files can be done through gcc -MMD -MF
and needMakefileDependencies
.
How do I express the dependency on the existence of libfoo.so
without forcing rebuild every time?
Thanks!