make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make target / dependency names with spaces


From: Eli Zaretskii
Subject: Re: make target / dependency names with spaces
Date: Sat, 11 Apr 2009 17:12:25 +0300

> Date: Sat, 11 Apr 2009 14:06:09 +0200
> From: grischka <address@hidden>
> CC:  address@hidden
> 
> > > some\ program\ name.exe
> >
> > This will only work in the commands (where simple quoting will also
> > work), but not in targets and dependencies, which is what the OP
> > wants.
> 
> You probably meant: This will only work in targets and dependencies
> but not in commands.

No, I meant what I said, but it looks like I was mistaken, sorry.
Somehow, I remembered Paul saying that file names with blanks cannot
be supported, but my failing memory betrayed me again, or so it seems.

> some\ program\ name.exe : some\ file.c other\ file.c
>          @echo gcc $^ -o $@
> some\ file.c other\ file.c :
>          @echo touch $@
> 
> touch some file.c
> touch other file.c
> gcc some file.c other file.c -o some program name.exe

Of course, in a real-life example, some additional juggling will be
needed, because each file name with spaces needs to be quoted on the
command line, or else:

    touch some file.c
    touch some file.c
    touch other file.c
    touch other file.c
    gcc some file.c other file.c -o some program name.exe
    gcc some file.c other file.c -o some program name.exe
    gcc: program: No such file or directory
    gcc: name.exe: No such file or directory
    make: *** [some program name.exe] Error 1

(And `touch' creates the files `some', `other', and `file.c'.)

Quoting inside $^ is not entirely trivial.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]