summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPavel Roskin <proski@gnu.org>2005-08-06 05:36:15 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-12 17:38:22 (GMT)
commitb05701c5b4c7983ef04d8c286c65089596553bd6 (patch)
tree8ef311b46ed99bc45b95236a00f128f0a98171e0 /tools
parent5a571cdd8ab390e13fc02da6d6489d2ffa668aa4 (diff)
downloadgit-b05701c5b4c7983ef04d8c286c65089596553bd6.zip
git-b05701c5b4c7983ef04d8c286c65089596553bd6.tar.gz
git-b05701c5b4c7983ef04d8c286c65089596553bd6.tar.bz2
Make CFLAGS overridable from make command line.
This patch renames COPTS to CFLAGS, because it's COPTS that was user overridable. Also, -Wall is moved there because it's optional. What was CFLAGS is now ALL_CFLAGS, which users should not override. Defines are added to DEFINES. Since ALL_CFLAGS is recursively expanded, it uses the final value of DEFINES. Implicit rules are made explicit since the implicit rules use CFLAGS rather than ALL_CFLAGS. I believe that serious projects should not rely on implicit rules anyway. Percent rules are used because they are used already and because they don't need the .SUFFIXES target. [jc: in addition to updating the patch for 0.99.4, I fixed up a glitch in Pavel's original patch which compiled sha1.o out of mozilla-sha1/sha1.c, where it should have left the resulting object file in mozilla-sha1 directory for later "ar".] Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/Makefile7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/Makefile b/tools/Makefile
index e423af9..480ce4a 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -2,10 +2,9 @@
# Make Linus git-tools
#
CC=gcc
-COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+CFLAGS = -O2 -g -Wall
+ALL_CFLAGS = $(CFLAGS)
INSTALL=install
-HOME=$(shell echo $$HOME)
prefix=$(HOME)
bindir=$(prefix)/bin
# dest=
@@ -14,7 +13,7 @@ PROGRAMS=git-mailsplit git-mailinfo
SCRIPTS=git-applymbox git-applypatch
git-%: %.c
- $(CC) $(CFLAGS) -o $@ $(filter %.c,$^)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.c,$^)
all: $(PROGRAMS)