[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filenames with embedded spaces [Was: Query regarding make error]
From: |
J. Grant |
Subject: |
Re: Filenames with embedded spaces [Was: Query regarding make error] |
Date: |
Sun, 08 Feb 2004 22:56:45 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030824 |
Hello
Thanks for this info
Do paths with escaped spaces always work as you want?
Nope. The strings seem to loose their /escapedness/ after they are loaded.
addsuffix and addprefix both catch the "\ " as a normal space (rather
than escaped space) and then treat as two strings.
[makefile begins]
files = My\ Documents My\ Computer/Control\ Panel
.PHONY: all
all: $(files)
%:
@echo testing '$@'
@echo ' dir: $(dir $@)'
@echo ' notdir: $(notdir $@)'
@echo ' prefix&suffix: $(addsuffix -omega,$(addprefix alpha-,$@))'
[makefile ends]
I get output like
testing My Documents
dir: ./ ./
notdir: My Documents
prefix&suffix: alpha-My-omega alpha-Documents-omega
Seems like it added to 'files' as one string ok, but then treated as two
strings.
testing My Computer/Control Panel
dir: ./ Computer/ ./
notdir: My Control Panel
prefix&suffix: alpha-My-omega alpha-Computer/Control-omega alpha-Panel-omega
Not loaded ok as second string in 'files'. Do not know how it ended up
with the dir "Computer/", and the remainder 'My Control Panel' is not
what I was expecting.
Are people relying on make functioning in this fashion? Do you know why
the first string came out ok, but the second when wrong? The directory
parsing in strings must be the problem for "My\ Computer/Control\ Panel"
I think.
If fixing this to retain /escapedness/ is not suitable, perhaps an
alternative might be support %20 like html files use?
I would like to do the "d:\test.c" style path support too, if that would
be considered for inclusion?
The only other way I have been able to use quoted paths with make is to
create the complete commands in an external scripting language. i.e. I
created a Makefile like:
===============================
all:
gcc -o test "d:\test.c"
===============================
Kind regards
JG
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Filenames with embedded spaces [Was: Query regarding make error],
J. Grant <=