Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Oct 2013 21:30:28 +0200
From:      Pascal Schmid <pascal@lechindianer.de>
To:        freebsd-questions@freebsd.org
Cc:        kuuse@redantigua.com
Subject:   Re: FreeBSD Make question
Message-ID:  <52603AD4.7040405@lechindianer.de>
In-Reply-To: <21.DC.19454.E1830625@cdptpa-oedge03>
References:  <21.DC.19454.E1830625@cdptpa-oedge03>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/17/2013 09:18 PM, Thomas Mueller wrote:
>> I'm trying to write a Makefile for FreeBSD Make (not GNU Make), with target
>> names containg spaces.
>> Example:
>         
>> MY_TARGET=/home/joe/directory name with spaces/hello.c
>> ${MY_TARGET}:
>     @echo ${.TARGET}
>         
>> The output is truncated to '/home/joe/directory'
>> Is there any possible way to escape this properly?
>> I have read all the documentation I could find, and tried several ways
>> solving this problem, using quotes, escapes, substitutions.
>> The output is the same if as use sh, bash, or tcsh, so it isn't shell
>> related.
>> Are spaces simply not possible to use in target names?
> 
>> If I'm on the wrong list, or someone could point me into any direction to
>> solve this, I would gladly appreciate any hints.
> 
>> Best Regards,
>> Johan
> 
> I believe that in (quasi-)Unix in general, including FreeBSD and Linux, 
> you use backslash to escape an embedded space in directory or file names.
> 
> Backslash causes the following character to be interpreted as an ordinary 
> character with no special meaning.
> 
> Try
> 
> MY_TARGET=/home/joe/directory\ name\ with\ spaces/hello.c
> 
> Tom
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
> 

Have you tried different quotes? "'" does not have the same effect as "`" (backtick).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52603AD4.7040405>