Makefile: read input variable and set several variables
<p>I have a makefile where I want to read file name from input and then make other names based on it`s name. I have tried the following code</p>

<pre><code>mlext = .ml
testext = test.ml
nativeext = test.native

test: 
    @read -p "Enter file name: " file; \
    echo $$file$(mlext); \
    echo $$file$(testext); \
    echo $$file$(nativeext)
</code></pre>

<p>for example:</p>

<p>If i type: foo</p>

<p>then I want to get <code>foo.ml</code>, <code>footest.ml</code>, <code>footest.native</code></p>

<p>however, I can only get <code>foo.ml</code>. For the rest two i only get <code>.ml</code> and <code>.native</code></p>

<p>How can i fix this?</p>