bug-make
[Top][All Lists]
Advanced

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

Re: Warnings on '$\\'


From: Alejandro Colomar
Subject: Re: Warnings on '$\\'
Date: Mon, 17 Apr 2023 21:39:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1

Hi Dmitry,

I've written some test to see what works and what doesn't:

$ cat Makefile 
foo.h: FORCE
        $(file > $@,$(foo))
        @:

single:=\

double:=\\

empty:=

space:= #

define foo
Aa \\
Ba \$(single)
Bb \$(single)\
Bc $(single)\
Bd $(single)$(single)
Ca \$(double)
Cb \$(double)\
Cc $(double)\
Cd $(double)$(double)
Da \$(empty)
Db \$(empty)\
Dc $(empty)\
Ea \$(space)
Eb \$(space)\
Ec $(space)\
F
endef

FORCE:


$ make
$ cat foo.h 
Aa \\
Ba \
Bb \ Bc  Bd 
Ca \\\
Cb \\\ Cc \\ Cd \\\\
Da \
Db \ Dc  Ea \
Eb \ Ec  F


So, the following work:


Ba \$(single)
Da \$(empty)
Ea \$(space)


Of course, $(single) is really empty, since the escape is used to escape
the newline in the definition.  So I would go for \$(empty) or \$(space),
and for simplicity, I'd prefer \$(empty).

Dmitry, why did $\\ work for you ($\ being my $(empty)), and not for me
(as $(empty)\)?

Thanks,
Alex


-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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