[EMAIL PROTECTED] a écrit :

Or what other solution is possible to test if a file (with spaces in his name) exist ?

You may try something like this :


# Testing "windir" var to find if we're running on Windows
ifdef windir

SHELL = cmd.exe
SEP  := $(strip \ )

define is-file-present
$(shell if exist "$(subst /,$(SEP),$(1))" (echo 1) else (echo 0))
endef

else

SHELL = /bin/sh
SEP  := /

define is-file-present
$(if $(wildcard $(1)),1,0)
endef

endif


MY_FILE1 := C:/Program Files/GNU/WinCvs 2.0/wincvs.exe
MY_FILE2 := C:/Program Files/GNU/WinCvs 2.0/wincvs.e_e

ifeq ($(call is-file-present,$(MY_FILE1)),1)
$(info $(MY_FILE1) is present)
else
$(info $(MY_FILE1) is not present)
endif

ifeq ($(call is-file-present,$(MY_FILE2)),1)
$(info $(MY_FILE2) is present)
else
$(info $(MY_FILE2) is not present)
endif

.PHONY: all

all:
        @echo Hello world



Output :
C:\>gnumake
C:/Program Files/GNU/WinCvs 2.0/wincvs.exe is present
C:/Program Files/GNU/WinCvs 2.0/wincvs.e_e is not present
Hello world



Regards,

--
Fabrice GIRARDOT





_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to