help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I defer make-var expansion until a command is executed


From: Brian Dessent
Subject: Re: Can I defer make-var expansion until a command is executed
Date: Sun, 03 Aug 2008 21:09:13 -0700

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]