Search code examples
makefilegnu

Is there a way to get if a recipe for a target failed or succeded into a variable?


I wanted to get if a recipe for a target failed or succeded into a variable. Is there a way I can do it? My final purpose is to be able to print a modified(or aditional) message instead of the message error that is shown if the recipe fails :

path: reciped for target X failed
make: *** [path] Error 1

Solution

  • Not really.

    GNU Make communicates with external environment only by files, so what you could do is write the message to file as part of the recipe.