git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eygene Ryabinkin <rea-git@codelabs.ru>
Cc: sam@ravnborg.org, git@vger.kernel.org
Subject: Re: [PATCH] Teach Makefile to respect external variables: CFLAGS and others.
Date: Wed, 13 Jun 2007 00:39:28 -0700	[thread overview]
Message-ID: <7vhcpcfglr.fsf@assigned-by-dhcp.pobox.com> (raw)
In-Reply-To: <20070613071514.GP86872@void.codelabs.ru> (Eygene Ryabinkin's message of "Wed, 13 Jun 2007 11:15:14 +0400")

Eygene Ryabinkin <rea-git@codelabs.ru> writes:

> Junio, Sam, good day.
>
> Tue, Jun 12, 2007 at 11:07:56PM -0700, Junio C Hamano wrote:
>> I run "make CFLAGS=-O0 -g" all the time.  Also "make CC=echo"
>> seems to "work" as expected ;-).
>> 
>> Care to elaborate what problem you are trying to solve?
>
> As Sam Ravnborg kindly pointed out, you're using make variables
> and I am trying to give the respect to the environment variables.
>
> And the real problem is that one (for example, me) can try to
> build Git with the different compiler than CC (gccX or icc, for
> example).  And it is much better for lazy people to do 'export
> CC=whatever' once and then fire make any number of times ;))
>
> Answering Sam: yes, with my patch it is easier to inherit the
> variables from the environment.  But it is not clear if it is
> good or bad ;))
>
> But anyway, this patch is only my suggestion, and it can be
> thrown away :)

Oh, I will, very gladly ;-), as it is obviously inferior than
how we currently do our build.

I would personally hate environment affecting build (or anything
for that matter), as it makes it unnecessarily difficult to
diagnose when something goes wrong.  I consider that it is a
beautiful thing that make can take explicit override from the
command line.

Lazy people like me can always have a make wrapper.  E.g. I have
a checkout of my 'todo' branch at Meta in git.git repository, so
I would say

	$ Meta/Make -pedantic

to ask for specific set of CFLAGS.  If something goes wrong and
I need to ask for help from other people, it is crystal clear to
them that I am using something "customized" from the above
command line.

If you modify Makefile to allow the build procedure to be easily
contaminated with stray environment, and when your build breaks,
you would answer that your command line is:

	$ make

when asked how you tried to build things -- and leave people who
try to help you scratching their head, wasting their time.

  reply	other threads:[~2007-06-13  7:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13  5:42 [PATCH] Teach Makefile to respect external variables: CFLAGS and others Eygene Ryabinkin
2007-06-13  6:07 ` Junio C Hamano
2007-06-13  7:15   ` Eygene Ryabinkin
2007-06-13  7:39     ` Junio C Hamano [this message]
2007-06-13  7:53       ` Eygene Ryabinkin
2007-06-13  7:42     ` Matthias Lederhofer
2007-06-13  6:12 ` Sam Ravnborg

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=7vhcpcfglr.fsf@assigned-by-dhcp.pobox.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rea-git@codelabs.ru \
    --cc=sam@ravnborg.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).