Move "-include config.mak" to end of configuration section
PATCH 1/1 Move "-include config.mak" to end of configuration section
This makes it possible to define WITH_SEND_EMAIL etc. in config.mak.
---
Makefile | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
fe5fece83b2ab0d67a4277d851faf50ad944cff4
Makefile +1 -3
@@ -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.
Signature · 1 line
0.99.9.GIT
Hi,
Quoted 1 line · Timo Hirvonen
This makes it possible to define
WITH_SEND_EMAILetc. in config.mak.
... but it breaks setups where config.mak overrides platform dependent settings...
Hth,
Dscho
PATCH 1/1 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
Makefile +12 -16
@@ -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.
Signature · 1 line
0.99.9.GIT
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 "$@"
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Hi,
Quoted 2 lines · Junio C Hamano
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
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 1 line · Johannes Schindelin
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.
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 13 lines · Junio C Hamano
Quoted 1 line · Johannes Schindelin
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.
Quoted 9 lines
If we have '-include' in the
Makefile, we need to make a decision if what we are adding to theMakefileshould be overridable by that config.mak every time, exactly because whatever is included becomes part of theMakefile. IOW, that "only 20 bytes" adds work for theMakefilemaintainer."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).
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 3 lines · Alex Riesen
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 ;-).
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 7 lines · Junio C Hamano
Quoted 3 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 overMakefile;-).
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
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 4 lines · Alex Riesen
Quoted 3 lines · Junio C Hamano
Quoted 3 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).
Hmph. Do you mean something like this?
-- >8 --
Makefile +3 -0
@@ -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
Re: [PATCH] Move couple of ifdefs after "include config.mk"
Quoted 15 lines · Junio C Hamano
Quoted 4 lines · Alex Riesen
Quoted 3 lines · Junio C Hamano
Quoted 3 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).
Hmph. Do you mean something like this?
-- >8 --
Makefile +0
-0
Makefile line 3
Quoted 3 lines
Makefile +3
-0@@ -1,3 +1,6 @@ +# The default target of this Makefile is... +all: +
Yes. In fact, that is what I have in my tree :)
Re: [PATCH] Move couple of ifdefs after "include config.mk"
In reply to Junio C HamanoHi,
Quoted 6 lines · Junio C Hamano
Quoted 1 line · Johannes Schindelin
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.
Quoted 3 lines
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.
Quoted 5 lines
If we have '-include' in the
Makefile, we need to make a decision if what we are adding to theMakefileshould be overridable by that config.mak every time, exactly because whatever is included becomes part of theMakefile. IOW, that "only 20 bytes" adds work for theMakefilemaintainer.
... 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