Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Separate LDFLAGS and CFLAGS.
author
Junio C Hamano
<junkio@cox.net>
Sun, 13 Nov 2005 09:46:13 +0000
(
01:46
-0800)
committer
Junio C Hamano
<junkio@cox.net>
Mon, 14 Nov 2005 08:26:49 +0000
(
00:26
-0800)
Stuffing -L flag and friends meant for the linking phase into
ALL_CFLAGS is not right; honor LDFLAGS and introduce ALL_LDFLAGS
to separate them out.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
6d5410d
)
diff --git
a/Makefile
b/Makefile
index 5b2eca897386e17021d2a8a052b0c2759df96447..eeedf8ceb9627d2bb6ee8188ca9161acae825bf9 100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-52,10
+52,12
@@
GIT_VERSION = 0.99.9.GIT
GIT_VERSION = 0.99.9.GIT
-# CFLAGS
is
for the users to override from the command line.
+# CFLAGS
and LDFLAGS are
for the users to override from the command line.
CFLAGS = -g -O2 -Wall
CFLAGS = -g -O2 -Wall
+LDFLAGS =
ALL_CFLAGS = $(CFLAGS)
ALL_CFLAGS = $(CFLAGS)
+ALL_LDFLAGS = $(LDFLAGS)
prefix = $(HOME)
bindir = $(prefix)/bin
prefix = $(HOME)
bindir = $(prefix)/bin
@@
-187,9
+189,11
@@
ifeq ($(uname_S),Darwin)
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
## fink
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
## fink
- ALL_CFLAGS += -I/sw/include -L/sw/lib
+ ALL_CFLAGS += -I/sw/include
+ ALL_LDFLAGS += -L/sw/lib
## darwinports
## darwinports
- ALL_CFLAGS += -I/opt/local/include -L/opt/local/lib
+ ALL_CFLAGS += -I/opt/local/include
+ ALL_LDFLAGS += -L/opt/local/lib
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
@@
-211,7
+215,13
@@
endif
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
NEEDS_LIBICONV = YesPlease
ifeq ($(uname_S),OpenBSD)
NO_STRCASESTR = YesPlease
NEEDS_LIBICONV = YesPlease
- ALL_CFLAGS += -I/usr/local/include -L/usr/local/lib
+ ALL_CFLAGS += -I/usr/local/include
+ ALL_LDFLAGS += -L/usr/local/lib
+endif
+ifeq ($(uname_S),NetBSD)
+ NEEDS_LIBICONV = YesPlease
+ ALL_CFLAGS += -I/usr/pkg/include
+ ALL_LDFLAGS += -L/usr/pkg/lib -Wl,-rpath,/usr/pkg/lib
endif
ifneq (,$(findstring arm,$(uname_M)))
ARM_SHA1 = YesPlease
endif
ifneq (,$(findstring arm,$(uname_M)))
ARM_SHA1 = YesPlease
@@
-221,7
+231,7
@@
endif
ifndef NO_CURL
ifdef CURLDIR
ifndef NO_CURL
ifdef CURLDIR
- # This is still problematic -- gcc does not want -R.
+ # This is still problematic -- gcc does not
always
want -R.
ALL_CFLAGS += -I$(CURLDIR)/include
CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
else
ALL_CFLAGS += -I$(CURLDIR)/include
CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
else
@@
-369,12
+379,13
@@
git-cherry-pick: git-revert
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
git-%$X: %.o $(LIB_FILE)
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
git-%$X: %.o $(LIB_FILE)
- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+ $(CC) $(ALL_CFLAGS) -o $@ $(
ALL_LDFLAGS) $(
filter %.o,$^) $(LIBS)
git-mailinfo$X : SIMPLE_LIB += $(LIB_4_ICONV)
$(SIMPLE_PROGRAMS) : $(LIB_FILE)
$(SIMPLE_PROGRAMS) : git-%$X : %.o
git-mailinfo$X : SIMPLE_LIB += $(LIB_4_ICONV)
$(SIMPLE_PROGRAMS) : $(LIB_FILE)
$(SIMPLE_PROGRAMS) : git-%$X : %.o
- $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIB_FILE) $(SIMPLE_LIB)
+ $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
+ $(LIB_FILE) $(SIMPLE_LIB)
git-http-fetch$X: fetch.o
git-local-fetch$X: fetch.o
git-http-fetch$X: fetch.o
git-local-fetch$X: fetch.o
@@
-408,10
+419,10
@@
test: all
$(MAKE) -C t/ all
test-date$X: test-date.c date.o ctype.o
$(MAKE) -C t/ all
test-date$X: test-date.c date.o ctype.o
- $(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o ctype.o
+ $(CC) $(ALL_CFLAGS) -o $@
$(ALL_LDFLAGS)
test-date.c date.o ctype.o
test-delta$X: test-delta.c diff-delta.o patch-delta.o
test-delta$X: test-delta.c diff-delta.o patch-delta.o
- $(CC) $(ALL_CFLAGS) -o $@ $^
+ $(CC) $(ALL_CFLAGS) -o $@ $
(ALL_LDFLAGS) $
^
check:
for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done
check:
for i in *.c; do sparse $(ALL_CFLAGS) $(SPARSE_FLAGS) $$i; done