threads / patch / 2719

patchMove "-include config.mak" to end of configuration section

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

## tl;dr

12 messages between Nov 30, 2005 and Dec 3, 2005. Diffs are folded; open one to read it.

replies: 11people: 4as markdown or json

Timo Hirvonen· Nov 30, 2005, 23:23 UTC · lore
This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.
---
 Makefile |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
fe5fece83b2ab0d67a4277d851faf50ad944cff4
Show changes to Makefile +1 −3
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· Dec 1, 2005, 00:46 UTC · re: Timo Hirvonen · lore

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

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· Dec 1, 2005, 01:32 UTC · re: Johannes Schindelin · lore

[PATCH] Move couple of ifdefs after "include config.mk"

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
Show changes to Makefile +12 −16
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· Dec 1, 2005, 01:43 UTC · re: Timo Hirvonen · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

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· Dec 1, 2005, 08:08 UTC · re: Junio C Hamano · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

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· Dec 1, 2005, 09:04 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

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· Dec 1, 2005, 09:40 UTC · re: Junio C Hamano · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
Show 22 quoted lines
> 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· Dec 1, 2005, 09:45 UTC · re: Alex Riesen · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

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· Dec 1, 2005, 09:53 UTC · re: Junio C Hamano · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
Show 7 quoted lines
> > 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· Dec 1, 2005, 10:16 UTC · re: Alex Riesen · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

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 --
Show changes to Makefile +3 −0
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· Dec 1, 2005, 12:51 UTC · re: Junio C Hamano · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

On 12/1/05, Junio C Hamano <junkio@cox.net> wrote:
Show 18 quoted lines
> 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· Dec 3, 2005, 02:31 UTC · re: Junio C Hamano · lore

Re: [PATCH] Move couple of ifdefs after "include config.mk"

Hi,
On Thu, 1 Dec 2005, Junio C Hamano wrote:
Show 6 quoted lines
> 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.

Show 5 quoted lines
> 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

← back to recent threads