# [PATCH] Move "-include config.mak" to end of configuration section

12 messages from 2005-11-30 to 2005-12-03. Participants: Timo Hirvonen, Johannes Schindelin, Junio C Hamano, Alex Riesen.
Thread: https://gitlist.dev/t/2719

## Timo Hirvonen, 2005-11-30 23:23

Subject: [PATCH] Move "-include config.mak" to end of configuration section
Message-ID: <20051201012333.44bd81f2.tihirvon@gmail.com>
URL: https://gitlist.dev/e/20051201012333.44bd81f2.tihirvon%40gmail.com

```

This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.

---

 Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

fe5fece83b2ab0d67a4277d851faf50ad944cff4
diff --git a/Makefile b/Makefile
index 984d167..c44f5da 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ RPMBUILD = rpmbuild
 # explicitly what architecture to check for. Fix this up for yours..
 SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
 
-
+-include config.mak
 
 ### --- END CONFIGURATION SECTION ---
 
@@ -254,8 +254,6 @@ ifneq (,$(findstring arm,$(uname_M)))
 	ARM_SHA1 = YesPlease
 endif
 
--include config.mak
-
 ifndef NO_CURL
 	ifdef CURLDIR
 		# This is still problematic -- gcc does not always want -R.
-- 
0.99.9.GIT

```

## Johannes Schindelin, 2005-12-01 00:46

Subject: Re: [PATCH] Move "-include config.mak" to end of configuration section
Message-ID: <Pine.LNX.4.63.0512010144050.11941@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0512010144050.11941%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20051201012333.44bd81f2.tihirvon@gmail.com>

```
Hi,

On Thu, 1 Dec 2005, Timo Hirvonen wrote:

> This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.

... but it breaks setups where config.mak overrides platform 
dependent settings...

Hth,
Dscho

```

## Timo Hirvonen, 2005-12-01 01:32

Subject: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <20051201033201.02b47071.tihirvon@gmail.com>
URL: https://gitlist.dev/e/20051201033201.02b47071.tihirvon%40gmail.com
In-Reply-To: <Pine.LNX.4.63.0512010144050.11941@wbgn013.biozentrum.uni-wuerzburg.de>

```

This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.

Also remove GIT_LIST_TWEAK because it isn't used anymore.

---

 Makefile |   28 ++++++++++++----------------
 1 files changed, 12 insertions(+), 16 deletions(-)

f877acdc3f8c888dd82a1e81ce20c8715e3108e4
diff --git a/Makefile b/Makefile
index 984d167..00521fe 100644
--- a/Makefile
+++ b/Makefile
@@ -138,8 +138,6 @@ ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROG
 # Backward compatibility -- to be removed after 1.0
 PROGRAMS += git-ssh-pull$X git-ssh-push$X
 
-GIT_LIST_TWEAK =
-
 # Set paths to tools early so that they can be used for version tests.
 ifndef SHELL_PATH
 	SHELL_PATH = /bin/sh
@@ -154,20 +152,6 @@ endif
 PYMODULES = \
 	gitMergeCommon.py
 
-ifdef WITH_OWN_SUBPROCESS_PY
-	PYMODULES += compat/subprocess.py
-else
-	ifneq ($(shell $(PYTHON_PATH) -c 'import subprocess;print"OK"' 2>/dev/null),OK)
-		PYMODULES += compat/subprocess.py
-	endif
-endif
-
-ifdef WITH_SEND_EMAIL
-	SCRIPT_PERL += git-send-email.perl
-else
-	GIT_LIST_TWEAK += -e '/^send-email$$/d'
-endif
-
 LIB_FILE=libgit.a
 
 LIB_H = \
@@ -256,6 +240,18 @@ endif
 
 -include config.mak
 
+ifdef WITH_OWN_SUBPROCESS_PY
+	PYMODULES += compat/subprocess.py
+else
+	ifneq ($(shell $(PYTHON_PATH) -c 'import subprocess;print"OK"' 2>/dev/null),OK)
+		PYMODULES += compat/subprocess.py
+	endif
+endif
+
+ifdef WITH_SEND_EMAIL
+	SCRIPT_PERL += git-send-email.perl
+endif
+
 ifndef NO_CURL
 	ifdef CURLDIR
 		# This is still problematic -- gcc does not always want -R.
-- 
0.99.9.GIT

```

## Junio C Hamano, 2005-12-01 01:43

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <7vhd9tmw1g.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhd9tmw1g.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20051201033201.02b47071.tihirvon@gmail.com>

```
Honestly speaking, I'd personally prefer to just get rid of
"-include config.mak" from Makefile.  If somebody wants to keep
her customized set of configuration, she can have her own ./Make
script that would look like:

	#!/bin/sh
	make WITH_SEND_EMAIL=YesPlesae NO_EXPAT=NoThanks "$@"

```

## Johannes Schindelin, 2005-12-01 08:08

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <Pine.LNX.4.63.0512010906400.22709@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0512010906400.22709%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vhd9tmw1g.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Wed, 30 Nov 2005, Junio C Hamano wrote:

> Honestly speaking, I'd personally prefer to just get rid of "-include 
> config.mak" from Makefile.

But it is only one line, heck only 20 bytes!

And you can still use your "./Make" method, and it is not widely 
advertised, and you can override settings from the platform-dependent 
code, and I feel much better at having my littly config.mak, my precious!

Ciao,
Dscho

```

## Junio C Hamano, 2005-12-01 09:04

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <7vmzjlkx2f.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmzjlkx2f.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0512010906400.22709@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> But it is only one line, heck only 20 bytes!

Hey, don't get so piped up.  Timo's patch has already been
merged (thanks, Timo).

But think about it a bit.

If you need an override, you have to write down and maintain
those YesPlease _somewhere_ yourself anyway, outside what I
ship.  Either "config.mak" or "Make" script.

If we have '-include' in the Makefile, we need to make a
decision if what we are adding to the Makefile should be
overridable by that config.mak every time, exactly because
whatever is included becomes part of the Makefile.  IOW, that
"only 20 bytes" adds work for the Makefile maintainer.

"Make" script method is a command line override to the "make"
program, which takes precedence and does not have that problem.

```

## Alex Riesen, 2005-12-01 09:40

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <81b0412b0512010140m1b96db84x70c7d92f8f644a2a@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0512010140m1b96db84x70c7d92f8f644a2a%40mail.gmail.com
In-Reply-To: <7vmzjlkx2f.fsf@assigned-by-dhcp.cox.net>

```
On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > But it is only one line, heck only 20 bytes!
>
> Hey, don't get so piped up.  Timo's patch has already been
> merged (thanks, Timo).
>
> But think about it a bit.
>
> If you need an override, you have to write down and maintain
> those YesPlease _somewhere_ yourself anyway, outside what I
> ship.  Either "config.mak" or "Make" script.
>
> If we have '-include' in the Makefile, we need to make a
> decision if what we are adding to the Makefile should be
> overridable by that config.mak every time, exactly because
> whatever is included becomes part of the Makefile.  IOW, that
> "only 20 bytes" adds work for the Makefile maintainer.
>
> "Make" script method is a command line override to the "make"
> program, which takes precedence and does not have that problem.
>

I have even my specific targets in the config.mak (and would actually
like to have the default target put before including config.mak, so
default call to make is always the same).

```

## Junio C Hamano, 2005-12-01 09:45

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <7viru9jgku.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7viru9jgku.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <81b0412b0512010140m1b96db84x70c7d92f8f644a2a@mail.gmail.com>

```
Alex Riesen <raa.lkml@gmail.com> writes:

> I have even my specific targets in the config.mak (and would actually
> like to have the default target put before including config.mak, so
> default call to make is always the same).

Surely you can do that by having your own "makefile" and include
"Makefile" I ship, and run "make", which prefers makefile over
Makefile ;-).

```

## Alex Riesen, 2005-12-01 09:53

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <81b0412b0512010153t3f768a82m8f9a12effa4a715e@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0512010153t3f768a82m8f9a12effa4a715e%40mail.gmail.com
In-Reply-To: <7viru9jgku.fsf@assigned-by-dhcp.cox.net>

```
On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
> > I have even my specific targets in the config.mak (and would actually
> > like to have the default target put before including config.mak, so
> > default call to make is always the same).
>
> Surely you can do that by having your own "makefile" and include
> "Makefile" I ship, and run "make", which prefers makefile over
> Makefile ;-).

But that is not the same:
 - I can put my targets and variables either before or after Makefile,
not somewhere inbetween
 - I have to work on an especially brain-damaged filesystems, like FAT

```

## Junio C Hamano, 2005-12-01 10:16

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <7v7japjf53.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v7japjf53.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <81b0412b0512010153t3f768a82m8f9a12effa4a715e@mail.gmail.com>

```
Alex Riesen <raa.lkml@gmail.com> writes:

> On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
>> > I have even my specific targets in the config.mak (and would actually
>> > like to have the default target put before including config.mak, so
>> > default call to make is always the same).

Hmph.  Do you mean something like this?

-- >8 --
diff --git a/Makefile b/Makefile
index 00521fe..45db357 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+# The default target of this Makefile is...
+all:
+
 # Define MOZILLA_SHA1 environment variable when running make to make use of
 # a bundled SHA1 routine coming from Mozilla. It is GPL'd and should be fast
 # on non-x86 architectures (e.g. PowerPC), while the OpenSSL version (default

```

## Alex Riesen, 2005-12-01 12:51

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <81b0412b0512010451q14e2e833o86f59399ba83188b@mail.gmail.com>
URL: https://gitlist.dev/e/81b0412b0512010451q14e2e833o86f59399ba83188b%40mail.gmail.com
In-Reply-To: <7v7japjf53.fsf@assigned-by-dhcp.cox.net>

```
On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
> Alex Riesen <raa.lkml@gmail.com> writes:
>
> > On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
> >> > I have even my specific targets in the config.mak (and would actually
> >> > like to have the default target put before including config.mak, so
> >> > default call to make is always the same).
>
> Hmph.  Do you mean something like this?
>
> -- >8 --
> diff --git a/Makefile b/Makefile
> index 00521fe..45db357 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,3 +1,6 @@
> +# The default target of this Makefile is...
> +all:
> +

Yes. In fact, that is what I have in my tree :)

```

## Johannes Schindelin, 2005-12-03 02:31

Subject: Re: [PATCH] Move couple of ifdefs after "include config.mk"
Message-ID: <Pine.LNX.4.63.0512030323290.19086@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0512030323290.19086%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vmzjlkx2f.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Thu, 1 Dec 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > But it is only one line, heck only 20 bytes!
> 
> Hey, don't get so piped up.  Timo's patch has already been
> merged (thanks, Timo).

In case I did not make it clear: I was not mad or something like that. I 
only see 3 ways to go about that particular problem:

- maintain your private config.mak
- maintain your private Make (shell script)
- maintain your private Makefile

I actually did the third way for a while, always merging the newest 
version. But all of a sudden -- when I was working on another project, 
which *has* a config.mak -- I had the idea to do the first way.

Actually, the second way falls a little bit short for some of my 
applications: I sometimes override settings in the first part of the 
Makefile. This is not possible with Make.

> If you need an override, you have to write down and maintain
> those YesPlease _somewhere_ yourself anyway, outside what I
> ship.  Either "config.mak" or "Make" script.

As mentioned, with the difference that you just can't override some things 
in Make.

> If we have '-include' in the Makefile, we need to make a
> decision if what we are adding to the Makefile should be
> overridable by that config.mak every time, exactly because
> whatever is included becomes part of the Makefile.  IOW, that
> "only 20 bytes" adds work for the Makefile maintainer.

... which might have another (desired) effect: the structure of the 
Makefile is better. More organized.

Besides, if you change things in an organized Makefile, you tend to be a 
little bit more careful where you put things, so the cost of maintaining 
is not really high (happened to me...).

Hth,
Dscho

```
