It seems that no variation of
ifneq (,$(wildcard locationA/foo.locA)) @echo foo.locA exists else @echo foo.locA does NOT exist endif
works properly due to the way the "failure" case needs to be specified (i.e., the result of the $wildcard function is not just "empty").
(I tried for five minutes and couldn't make it generate anything but the file name or an empty string. But I'm not running MinGW so that's not really helpful...)
Why not just invert the sense of the test and compare for what you know is a valid result of the$wildcard?
ifeq (locationA/foo.locA,$(wildcard locationA/foo.locA)) @echo foo.locA exists else @echo foo.locA does NOT exist endif
Cheers, Ian
I have simplified this a little and would appreciate if you could double-check to see if that's an issue with make or if I'm doing something stupid. Try this: - Create directories source/foo/ - Create directories dest/foo/ - Add a file source/foo/test - Create a Makefile containing:
foo: dest/foo/test
dest/%/test: @echo Trying to create $@ @echo Wildcard is $(wildcard source/$*/test) ifeq (source/$*/test, $(wildcard source/$*/test)) @echo Everything is fime else @echo WHERE IS THE FILE??? endif
- Run it via make foo to see the effect.
In my understanding the ifeq *should* fire appropriately but it doesn't. Any ideas why?
Cheers, - Andreas
Oh, I should have added that changing
ifeq (source/$*/test, $(wildcard source/$*/test))
to
ifeq (source/foo/test, $(wildcard source/foo/test))
works fine, but neither do
ifeq (source/$*/test, $(wildcard source/foo/test)) ifeq (source/foo/test, $(wildcard source/$*/test))
Something special about $* in ifeq?
Cheers, - Andreas
Andreas Raab wrote:
I have simplified this a little and would appreciate if you could double-check to see if that's an issue with make or if I'm doing something stupid. Try this:
- Create directories source/foo/
- Create directories dest/foo/
- Add a file source/foo/test
- Create a Makefile containing:
foo: dest/foo/test
dest/%/test: @echo Trying to create $@ @echo Wildcard is $(wildcard source/$*/test) ifeq (source/$*/test, $(wildcard source/$*/test)) @echo Everything is fime else @echo WHERE IS THE FILE??? endif
- Run it via make foo to see the effect.
In my understanding the ifeq *should* fire appropriately but it doesn't. Any ideas why?
Cheers,
- Andreas
this works for me:
foo: dest/foo/test
dest/%/test: @echo Trying to create $@ @echo Wildcard is $(wildcard source/*/test) ifeq ("source/foo/test", "$(wildcard source/*/test)") @echo Everything is fime else @echo WHERE IS THE FILE??? endif
Andreas Raab schrieb:
Oh, I should have added that changing
ifeq (source/$*/test, $(wildcard source/$*/test))
to
ifeq (source/foo/test, $(wildcard source/foo/test))
works fine, but neither do
ifeq (source/$*/test, $(wildcard source/foo/test)) ifeq (source/foo/test, $(wildcard source/$*/test))
Something special about $* in ifeq?
Cheers,
- Andreas
Andreas Raab wrote:
I have simplified this a little and would appreciate if you could double-check to see if that's an issue with make or if I'm doing something stupid. Try this:
- Create directories source/foo/
- Create directories dest/foo/
- Add a file source/foo/test
- Create a Makefile containing:
foo: dest/foo/test
dest/%/test: @echo Trying to create $@ @echo Wildcard is $(wildcard source/$*/test) ifeq (source/$*/test, $(wildcard source/$*/test)) @echo Everything is fime else @echo WHERE IS THE FILE??? endif
- Run it via make foo to see the effect.
In my understanding the ifeq *should* fire appropriately but it doesn't. Any ideas why?
Cheers,
- Andreas
vm-dev@lists.squeakfoundation.org