From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Victor Kaplansky" <victork@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Stefan Weil" <sw@weilnetz.de>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v3 2/2] make: load only required dependency files.
Date: Sun, 9 Aug 2015 15:20:30 +0300 [thread overview]
Message-ID: <20150809151159-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <CAFEAcA_JUZaW9ndA31bHemwV3=1Xf=jCJcqwLFtdRTVvVAh3+A@mail.gmail.com>
On Sun, Aug 09, 2015 at 12:54:37PM +0100, Peter Maydell wrote:
> On 9 August 2015 at 12:39, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Sun, Aug 09, 2015 at 12:39:59PM +0300, Victor Kaplansky wrote:
> >> - $(eval -include $(addsuffix *.d, $(sort $(dir $($v)))))
> >> + $(eval -include $(patsubst %.o,%.d,$(patsubst %.mo,%.d,$($v))))
> >> $(eval $v := $(filter-out %/,$($v))))
> >> endef
> >
> > Please add space after each comma.
>
> (I thought we discussed this in v1 review?)
>
> We don't seem to be completely consistent in our makefile
> style, but I would say that the majority of it is written
> in the same style used in the GNU Make docs, with no spaces
> after commas.
>
> In particular, $(patsubst %.o,%.d,$(THING)) and
> $(patsubst %.o, %.d, $(THING)) do *not* expand to the same thing;
> Make syntax for functions says the delimiter is 'comma', not
> 'comma followed by whitespace':
>
> FOO=bar.o baz.o boz.o
>
> all:
> @echo '$(patsubst %.o,%.d,$(FOO))'
> @echo '$(patsubst %.o, %.d, $(FOO))'
> manooth$ make -f test.mak
> bar.d baz.d boz.d
> bar.d baz.d boz.d
>
> Admittedly most of the time the extra whitespace that ends
> up in the output is unlikely to be problematic, but there
> might be rare cases when it is, so the better style
> recommendation is to not have spaces after the commas,
> because that is always safe and always the behaviour
> the author actually wanted.
>
> thanks
> -- PMM
OK, I'll merge this as is, we can tweak this with a patch on top if
desired.
Still - just corious about the motivation.
Extra whitespace in input -> extra whitespace in output, should
be harmless in both cases, should it not? E.g. do we prefer
A\
B
or
A \
B
?
First option never adds whitespace, but second one is more readable.
I'd argue if you write code where extra whitespace breaks things you are
doing something wrong.
--
MST
next prev parent reply other threads:[~2015-08-09 12:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-09 9:39 [Qemu-devel] [PATCH v3 0/2] make: Cleanup and fix of loading of dependency info Victor Kaplansky
2015-08-09 9:39 ` [Qemu-devel] [PATCH v3 1/2] make: fix where dependency *.d are stored Victor Kaplansky
2015-08-09 9:39 ` [Qemu-devel] [PATCH v3 2/2] make: load only required dependency files Victor Kaplansky
2015-08-09 11:39 ` Michael S. Tsirkin
2015-08-09 11:54 ` Peter Maydell
2015-08-09 12:20 ` Michael S. Tsirkin [this message]
2015-08-10 10:14 ` Peter Maydell
2015-08-10 10:21 ` Michael S. Tsirkin
2015-08-10 9:46 ` Victor Kaplansky
2015-08-09 11:40 ` [Qemu-devel] [PATCH v3 0/2] make: Cleanup and fix of loading of dependency info Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150809151159-mutt-send-email-mst@redhat.com \
--to=mst@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=ehabkost@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=sw@weilnetz.de \
--cc=victork@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.