Chen Jun ???? wrote:

> How can I do it? I know I can add another rule to accomplish that, e.g.

Why do you even need $(shell ...) here?  All the commands in the recipe
are implicitly evaluated by the shell, so just do your conditional there:

outfile = out.txt

$(outfile):
        @echo -n "STRT: $@ "; if [ -f $@ ]; then echo exist; else echo absent; 
fi
        @touch $@
        @echo -n "DONE: $@ "; if [ -f $@ ]; then echo exist; else echo absent; 
fi

Brian


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to