Computing Makefile variable on assignment

Viewed 15160

In a Makefile, I'm trying to assign the result of a shell command to a variable:

TMP=`mktemp -d /tmp/.XXXXX`

all:
    echo $(TMP)
    echo $(TMP)

but

$ make Makefile all

is echoing 2 different values, eg:

/tmp/.gLpm1T
/tmp/.aR4cDi

What is the syntax for mktemp to be computed on variable assignment?

Thank you.

2 Answers
Related