I am updating a Makefile that accesses some resources from an external source, i.e. there is a rule of form
$(External)/% : cvs up $@
... which works as expected for unlimited resources. Now the function has drifted, and external resources require a more complex login, so the rule has changed to something that is not too different from this:
$(External)/% : cvs -d :pserver:$(CVSUSER)@cvs-server up $@
... which makes the rule dependent on the CVSUSER variable. A quick and easy way to enforce this will be to abort the message with a useful error message if it is undefined. But this is not fun, I would like to read the CVSUSER variable from the console if it was not configured by the time it was needed. I naively tried
CVSUSER ?= $(shell read -p "User name: ")
but that clearly doesn't work :) How would you do it?
source share