[Vm-dev] Make question
David T. Lewis
lewis at mail.msen.com
Tue Sep 5 11:07:51 UTC 2006
On Mon, Sep 04, 2006 at 07:58:01PM -0700, Andreas Raab wrote:
>
> I'm trying to rework the windows build structure and I'm running into a
> problem with make. Basically, what I'm trying to do is to test whether a
> file exists in a given location and if so, copy it, and if not, copy a
> default from elsewhere. This should look like here:
>
> foo.here:
> if $(file-exists locationA/foo.locA)
> cp locationA/foo.locA foo.here
> else
> cp locationB/foo.locB foo.here
> endif
If the tool chain is using bash, or if there is a /bin/test available,
then the following should work:
FOO-AT-A=locationA/foo.locA
FOO-AT-B=locationB/foo.locB
foo.here:
if test -r $(FOO-AT-A) ; \
then \
cp "$(FOO-AT-A)" $@; \
else \
cp "$(FOO-AT-B)" $@; \
fi
Dave
More information about the Vm-dev
mailing list