> Depending on the all target will force building of the shared library even if I only intend to install the static one.

That bothers me less than the possibility of installing an outdated copy of the library does.

> Another way would be to create separate install rules such as "install", "install-all", "install-shared" etc

That's acceptable as long as the 'install' target is equivalent to 'install-all'.