I have 2 libraries in 2 different directories that I build with Makefiles.
library B depends on library A. If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A?
I am now rebuilding A, followed by B... but I'd like B to rebuild A automatically if it needs rebuilding. This is a streamlined example, but my real situation is
more complicated. I'd like the makefile for the final application to cause all
dependent libraries to build, if necessary so that I don't have to manually build them in the correct order.
I've tried "include ../A/Makefile" in B's Makefile, but I get errors. I think its because the directory doesn't change to ../A
Makefile:81: warning: overriding commands for target `all'
../A/Makefile:78: warning: ignoring old commands for target `all'
Makefile:98: warning: overriding commands for target `clean'
../A/Makefile:99: warning: ignoring old commands for target `clean'
make: *** No rule to make target `tinystr.o', needed by `A.a'. Stop.
If I modify a .cpp file in library A and run lib B's Makefile can I have B's makefile to automatically rebuild library A?
Generally, there is a top-level Makefile that you could build that will check all dependancies and build any libraries and/or re-link them as necessary. Building B and expecting A to rebuild sounds a little nuts.