aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier.adi@gmail.com>2007-08-04 01:02:18 -0400
committerJosh Triplett <josh@freedesktop.org>2007-08-04 13:49:19 -0700
commitfdd259520bdb9469d3010fff3b35a9c1f1cc4c7f (patch)
treee9bb51c348dbf113f477ec8e74759833332efd9c /Makefile
parentAdd another test case to validation/comma.c (diff)
downloadsparse-fdd259520bdb9469d3010fff3b35a9c1f1cc4c7f.tar.gz
sparse-fdd259520bdb9469d3010fff3b35a9c1f1cc4c7f.tar.bz2
sparse-fdd259520bdb9469d3010fff3b35a9c1f1cc4c7f.zip
Makefile: improve flag handling
Tweak the makefile so that it respects CFLAGS set in the environment and it makes sure to link the shared libsparse with $(LDFLAGS). Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 97bfe3b..1e06794 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,10 @@ VERSION=0.3
OS=linux
-CC=gcc
-CFLAGS=-O2 -finline-functions -g -Wall -Wwrite-strings
-LDFLAGS=-g
+CC ?= gcc
+CFLAGS ?= -O2 -finline-functions -g
+CFLAGS += -Wall -Wwrite-strings
+LDFLAGS ?= -g
AR=ar
HAVE_LIBXML=$(shell pkg-config --exists libxml-2.0 && echo 'yes')
@@ -129,7 +130,7 @@ $(LIB_FILE): $(LIB_OBJS)
$(QUIET_AR)$(AR) rcs $@ $(LIB_OBJS)
$(SLIB_FILE): $(LIB_OBJS)
- $(QUIET_LINK)$(CC) -shared -o $@ $(LIB_OBJS)
+ $(QUIET_LINK)$(CC) $(LDFLAGS) -Wl,-soname,$@ -shared -o $@ $(LIB_OBJS)
evaluate.o: $(LIB_H)
expression.o: $(LIB_H)