linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: Damien Lespiau <damien.lespiau@gmail.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] Beautify all & install Makefile targets
Date: Sun, 20 May 2007 17:35:16 -0700	[thread overview]
Message-ID: <4650E944.1060506@freedesktop.org> (raw)
In-Reply-To: <11796983862564-git-send-email-damien.lespiau@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1836 bytes --]

Damien Lespiau wrote:
> Beautify make's output like kbuild or git. The install
> target is especially much more readable.
> make V=1 (install) to get back to the old behaviour.

The Makefile currently doesn't require anything particularly special from
make, and in theory should work with any reasonable make, not just GNU make.
I hestitate to change that for purely aesthetic purposes.  The % rules seem
easy enough to replace with a suffix rule .c.o.  You can use substitution to
check V, like this:

josh@josh-mobile:/tmp$ cat Makefile 
V=@
Q=$(V:1=)
QUIET_SOMETHING=$(Q:@=@echo SOMETHING;)
#...

test:
        @echo V=$(V)
        @echo Q=$(Q)
        @echo QUIET_SOMETHING=$(QUIET_SOMETHING)
josh@josh-mobile:/tmp$ make
V=@
Q=@
QUIET_SOMETHING=@echo SOMETHING
josh@josh-mobile:/tmp$ make V=1
V=1
Q=
QUIET_SOMETHING=

You can write more rules of the form QUIET_SOMETHING=$(Q:@=value if quiet)

I'd also like to hear from other people on whether or not they prefer this
style of output.  It doesn't matter much to me either way.

> +	QUIET_LD       = @echo    '   ' LD'      '$@;

This always seems misleading to me, given that the corresponding rules run CC,
not LD.

> +	QUIET_INST_SH  = echo -n  '   ' INSTALL '';
> +	QUIET_INST     = @echo -n '   ' INSTALL '';

This doesn't appear to output the installed file; it took a minute to figure
out that install -v provides the output.  Could you add a comment about that?
Also, why not write these strings as (for example):

echo -n '    INSTALL '

? That seems cleaner than breaking the lines up into quoted whitespace and
unquoted text.

> +%.o: %.c
> +	$(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<

I think you can use $@ here rather than $*.o .  Also, as mentioned above, this
should become a suffix rule.

- Josh Triplett


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  parent reply	other threads:[~2007-05-21  0:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-20 21:59 [PATCH] Beautify all & install Makefile targets Damien Lespiau
2007-05-20 21:59 ` [PATCH] __DATE__ & __TIME expansion Damien Lespiau
2007-05-20 22:50   ` Neil Booth
2007-05-20 23:02     ` Josh Triplett
2007-05-20 23:49       ` Damien Lespiau
2007-05-21  0:06         ` Derek M Jones
2007-05-20 22:52   ` Josh Triplett
2007-05-21  0:35 ` Josh Triplett [this message]
2007-05-22 18:28   ` [PATCH] Beautify all & install Makefile targets Damien Lespiau

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=4650E944.1060506@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=damien.lespiau@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).