[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: spaces...
From: |
address@hidden |
Subject: |
Re: spaces... |
Date: |
Tue, 01 Apr 2008 18:53:21 +0200 |
User-agent: |
Thunderbird 1.5.0.14 (Windows/20071210) |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: spaces...,
address@hidden <=