[PATCH] Teach Makefile to respect external variables: CFLAGS and others.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eygene Ryabinkin
Date: Tuesday, June 12, 2007 - 10:42 pm

If one is not using the configure script, then there is no way to
redefine variables CFLAGS, LFLAGS, CC, AR, TAR, INSTALL, RPMBUILD,
TCL_PATCH and TCLTK_PATH.  This shouldn't be so, since these variables
can be manually set by user and we should respect them.

The patch originates from the FreeBSD port and was originally made
by Ed Schouten, ed at fxq dot nl.

Signed-off-by: Eygene Ryabinkin <rea-git@codelabs.ru>
---
 Makefile |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 30a4052..6cd9ea2 100644
--- a/Makefile
+++ b/Makefile
@@ -135,8 +135,8 @@ uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not')
 
 # CFLAGS and LDFLAGS are for the users to override from the command line.
 
-CFLAGS = -g -O2 -Wall
-LDFLAGS =
+CFLAGS ?= -g -O2 -Wall
+LDFLAGS ?=
 ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 STRIP ?= strip
@@ -172,13 +172,13 @@ GITWEB_SITE_FOOTER =
 
 export prefix bindir gitexecdir sharedir template_dir sysconfdir
 
-CC = gcc
-AR = ar
-TAR = tar
-INSTALL = install
-RPMBUILD = rpmbuild
-TCL_PATH = tclsh
-TCLTK_PATH = wish
+CC ?= gcc
+AR ?= ar
+TAR ?= tar
+INSTALL ?= install
+RPMBUILD ?= rpmbuild
+TCL_PATH ?= tclsh
+TCLTK_PATH ?= wish
 
 export TCL_PATH TCLTK_PATH
 
-- 
1.5.2.1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Teach Makefile to respect external variables: CFLA ..., Eygene Ryabinkin, (Tue Jun 12, 10:42 pm)
Re: [PATCH] Teach Makefile to respect external variables: ..., Eygene Ryabinkin, (Wed Jun 13, 12:15 am)
Re: [PATCH] Teach Makefile to respect external variables: ..., Matthias Lederhofer, (Wed Jun 13, 12:42 am)
Re: [PATCH] Teach Makefile to respect external variables: ..., Eygene Ryabinkin, (Wed Jun 13, 12:53 am)