Search code examples
makefilegnu-make

Prepend to Simply Expanded Variable


I am working with some MPI code that I need to run with mpirun.

I am using an already existing shell script and I want to prepend to an already existing line.

So the dream is:

app=mpirun $(app)

I know it is possible to append to a variable using +=, but can I prepend?


Solution

  • If app should become (or remain) a simply expanded variable, then the following would be enough:

    app := mpirun $(app)