public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: Kai Germaschewski <kai-germaschewski@uiowa.edu>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Lista Linux-Kernel <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: Re: [PATCH][RFC] gcc3 arch options
Date: Mon, 27 May 2002 23:42:48 +0200	[thread overview]
Message-ID: <20020527214248.GA1848@werewolf.able.es> (raw)
In-Reply-To: <Pine.LNX.4.44.0205271030240.24699-100000@chaos.physics.uiowa.edu>


On 2002.05.27 Kai Germaschewski wrote:
>On Mon, 27 May 2002, David Woodhouse wrote:
>
>> jamagallon@able.es said:
>> > +CFLAGS += $(shell if $(CC) -march=pentium-mmx -S -o /dev/null -xc /
>> > dev/null >/dev/null 2>&1; then echo "-march=pentium-mmx"; else echo
>> > "-march=i586"; fi)
>> 
>> Doesn't this run the shell command every time $(CFLAGS) is used?
>
>CFLAGS is initially defined with ':=', which, as opposed to '=' means to 
>evaluate directly and store the resulting string, so it should be fine. 
>
>Even if it wasn't, only the evaluations from the top-level Makefile would
>cause the command to be executed, make will always pass down the evaluated 
>result to the subdir makes.
>

It even does not depend on that. That is exactly the difference between
$(shell ) and backquoting.

Try this (with both = and :=):

# Makefile

A=
B=
#A:=
#B:=
A+=$(shell date)
B+=`date`

all:
    @echo "A="$(A)
    @sleep 2
    @echo "A="$(A)
    @sleep 2
    @echo "B="$(B)
    @sleep 2
    @echo "B="$(B)


-- 
J.A. Magallon                           #  Let the source be with you...        
mailto:jamagallon@able.es
Mandrake Linux release 8.3 (Cooker) for i586
Linux werewolf 2.4.19-pre8-jam4 #2 SMP dom may 26 11:20:42 CEST 2002 i686

  parent reply	other threads:[~2002-05-27 21:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-27 15:00 [PATCH][RFC] gcc3 arch options J.A. Magallon
2002-05-27 15:08 ` Thunder from the hill
2002-05-27 15:18 ` David Woodhouse
2002-05-27 15:47   ` Kai Germaschewski
2002-05-27 16:01     ` Thunder from the hill
2002-05-27 21:42     ` J.A. Magallon [this message]
2002-05-27 22:47       ` Kai Germaschewski
  -- strict thread matches above, loose matches on Subject: below --
2002-05-27 15:33 Thunder from the hill

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=20020527214248.GA1848@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dwmw2@infradead.org \
    --cc=kai-germaschewski@uiowa.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    /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