Thank you for your quick and precise answer.
Actually we can use the shell function "if exist".
I'm sorry because I have made an error in my tests, I have found my error in testing your
solution... So we can use wildcard function with spaces, we must only use "\ "
(without quotes) for real-spaces.
# So my function EXIST :
EXIST=$(wildcard $(subst $(SPACE_FAKE),\ ,$(1)))
# you can use this function like this :
$(call EXIST,
\
path/to/file$(SPACE_FAKE)or$(SPACE_FAKE)directory$(SPACE_FAKE)with$(SPACE_FAKE)spaces/file.exe
\
another/file/path.exe
\
)
You must only define $(SPACE_FAKE) like you want (or use directly "\ " always).
The idea is to replace the spaces in an environment variable, like in $(PATH), by
$(SPACE_FAKE) and the ";" by spaces. And so you can work with spaces easily.
The function wildcard can work with / or \ for the path.
The function wildcard allows you to tests many files at the same time and it
returns the list of founded files.
Another remark :
In my makefile, I test where can be my library files, so I test many possible path. With
wildcard function, it takes 5 seconds and with a call to the shell function "if
exist", it takes more than 3 minutes !
Best regards,
Fabien
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make