diff options
author | Pavel Roskin <proski@gnu.org> | 2005-08-06 01:36:15 -0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-12 10:38:22 -0700 |
commit | b05701c5b4c7983ef04d8c286c65089596553bd6 (patch) | |
tree | 8ef311b46ed99bc45b95236a00f128f0a98171e0 /tools | |
parent | 5a571cdd8ab390e13fc02da6d6489d2ffa668aa4 (diff) | |
download | git-b05701c5b4c7983ef04d8c286c65089596553bd6.tar.gz git-b05701c5b4c7983ef04d8c286c65089596553bd6.tar.xz |
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/Makefile | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/Makefile b/tools/Makefile index e423af959..480ce4aad 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) |