IOhannes m zmölnig wrote:
however, afaict, CFLAGS and LDFLAGS are commonly meant to be settable by the user, so setting those should not break the build system.
Exactly. Therefore a Makefile should *not* set CFLAGS, CXXFLAGS, LDFLAGS and the like, or only set them to some reasonable defaults which can be freely overridden by the user. Of course this means that build-specific options must be passed in the corresponding Makfile rules in addition to these variables.
This is only a convention, of course, but it's part of the GNU Coding Standards [1] and supported by automake and other build and packaging utilities. Users and packagers have come to expect that it works that way, so it's a good idea to follow this rule if you want to make users happy.
[1] http://www.gnu.org/prep/standards/html_node/Command-Variables.html
Albert