I'm updating a Makefile that accesses some resources from an external source, i.e. there is a rule of the form
$(External)/% :
cvs up $@
...which works as expected for unrestricted resources. Now, there has been a feature drift, and the external resources requires a more complex login, so the rule has changed to something not too different from this:
$(External)/% :
cvs -d :pserver:$(CVSUSER)@cvs-server up $@
...which makes the rule dependent on the variable CVSUSER. The quick and easy way to enforce this would be to abort with a helpful error message if it's undefined. But that's no fun, I'd like to read the variable CVSUSER from console if it's unset by the time it's needed. I naively tried
CVSUSER ?= $(shell read -p "User name: ")
but that obviously does not work :) How would you go about doing this?