Commit 2ccb6e58 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Merge CCLINK with LDFLAGS

parent 367ac44a
...@@ -17,8 +17,7 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') ...@@ -17,8 +17,7 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
OPTIMIZATION?=-O3 OPTIMIZATION?=-O3
ifeq ($(uname_S),SunOS) ifeq ($(uname_S),SunOS)
CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W $(ARCH) $(PROF) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W $(ARCH) $(PROF)
CCLINK?=-ldl -lnsl -lsocket LDFLAGS?=-ldl -lnsl -lsocket
LDFLAGS?=-L.
DYLIBSUFFIX=so DYLIBSUFFIX=so
STLIBSUFFIX=a STLIBSUFFIX=a
DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
...@@ -31,8 +30,6 @@ ifeq ($(uname_S),SunOS) ...@@ -31,8 +30,6 @@ ifeq ($(uname_S),SunOS)
else else
ifeq ($(uname_S),Darwin) ifeq ($(uname_S),Darwin)
CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
CCLINK?=
LDFLAGS?=-L.
OBJARCH?=-arch i386 -arch x86_64 OBJARCH?=-arch i386 -arch x86_64
DYLIBSUFFIX=dylib DYLIBSUFFIX=dylib
STLIBSUFFIX=a STLIBSUFFIX=a
...@@ -45,8 +42,6 @@ ifeq ($(uname_S),Darwin) ...@@ -45,8 +42,6 @@ ifeq ($(uname_S),Darwin)
INSTALL= cp -a INSTALL= cp -a
else else
CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
CCLINK?=
LDFLAGS?=-L.
DYLIBSUFFIX=so DYLIBSUFFIX=so
STLIBSUFFIX=a STLIBSUFFIX=a
DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR) DYLIB_MINOR_NAME?=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
...@@ -59,7 +54,6 @@ else ...@@ -59,7 +54,6 @@ else
endif endif
endif endif
CCOPT= $(CFLAGS) $(CCLINK)
DEBUG?= -g -ggdb DEBUG?= -g -ggdb
PREFIX?=/usr/local PREFIX?=/usr/local
...@@ -89,10 +83,10 @@ static: $(STLIBNAME) ...@@ -89,10 +83,10 @@ static: $(STLIBNAME)
# Binaries: # Binaries:
hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME) hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME)
$(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) -levent example-libevent.c $(STLIBNAME) $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) -levent example-libevent.c $(STLIBNAME)
hiredis-example-libev: example-libev.c adapters/libev.h $(STLIBNAME) hiredis-example-libev: example-libev.c adapters/libev.h $(STLIBNAME)
$(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) -lev example-libev.c $(STLIBNAME) $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) -lev example-libev.c $(STLIBNAME)
ifndef AE_DIR ifndef AE_DIR
hiredis-example-ae: hiredis-example-ae:
...@@ -100,11 +94,11 @@ hiredis-example-ae: ...@@ -100,11 +94,11 @@ hiredis-example-ae:
@false @false
else else
hiredis-example-ae: example-ae.c adapters/ae.h $(STLIBNAME) hiredis-example-ae: example-ae.c adapters/ae.h $(STLIBNAME)
$(CC) -o $@ $(CCOPT) $(DEBUG) -I$(AE_DIR) $(LDFLAGS) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME) $(CC) -o $@ $(CFLAGS) $(DEBUG) -I$(AE_DIR) $(LDFLAGS) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME)
endif endif
hiredis-%: %.o $(STLIBNAME) hiredis-%: %.o $(STLIBNAME)
$(CC) -o $@ $(CCOPT) $(DEBUG) $(LDFLAGS) $< $(STLIBNAME) $(CC) -o $@ $(CFLAGS) $(DEBUG) $(LDFLAGS) $< $(STLIBNAME)
test: hiredis-test test: hiredis-test
./hiredis-test ./hiredis-test
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment