.DEFAULT_GOAL=${IMG}
BUILD_DIR=build
IMG=${BUILD_DIR}/hd60M.img
BIN=${addprefix ${BUILD_DIR}/,${addsuffix .bin,${objects}}}
${IMG}:${BIN}
touch $@
make -n gives the result:
make: *** No rule to make target `${IMG}'. Stop.
If I change the first line to .DEFAULT_GOAL=build/hd60M.img, it works without error messages.
It seems that assignment to .DEFAULT_GOAL is not expanded. Why?