Invalid syntax in Makefile?
Closed this issue · 4 comments
rpdelaney commented
Looking at the Makefile
again, this looks like it's invalid shell code:
export XDG_DATA_HOME ?= $${$$HOME/.local/share}
Based on my understanding, I would expect:
export XDG_DATA_HOME ?= $(HOME)/.local/share
However, I'm not a GNU Make guru. Is there some make magic going on here?
rpdelaney commented
@ahmedelgabri Would you be so kind as to weigh in on this?
ahmedelgabri commented
@rpdelaney I don't remember exactly why I did it this way. But I think the first one evaluates the whole expression which contains the $HOME
variable. While the second one only evaluates the $(HOME)
part.
I'm on phone so I can't check now.
rpdelaney commented
I did a little more research and you're right. This is just my ignorance of GNU Make showing. Sorry for the false alarm!
rpdelaney commented
Okay, I see the problem now. This actually fails to build when $XDG_DATA_HOME
is not set:
$ unset XDG_DATA_HOME
$ make install
/bin/sh: ${$HOME/.local/share}: bad substitution
make: *** [install] Error 1