Makefile:

1
2
3
4
5
6
TMP:=`mktemp -d /tmp/XXXXXX`

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

Executing Makefile:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

$ make Makefile all
make: Nothing to be done for `Makefile'.
echo `mktemp -d /tmp/XXXXXX`
/tmp/nZQ0NJ
echo `mktemp -d /tmp/XXXXXX`
/tmp/cDmN37