summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2009-10-26 16:25:07 +0100
committerantirez <antirez@gmail.com>2009-10-26 16:25:07 +0100
commit325d1eb4a86b59eaa8c867b2bb0a7a827d98aaf0 (patch)
tree9e7cc5bbc9db8de0aa7133c1461ff20ecfa86745 /Makefile
parente3870fab57b8073de1ebc04bbd300c6ab45c1c34 (diff)
downloadredis-325d1eb4a86b59eaa8c867b2bb0a7a827d98aaf0.tar.gz
Merged Solaris patches provided by Alan Harder
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4fe428c41..43d273237 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,15 @@
# Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
# This file is released under the BSD license, see the COPYING file
+uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ifeq ($(uname_S),SunOS)
+ CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -D__EXTENSIONS__ -D_XPG6
+ CCLINK?= -ldl -lnsl -lsocket
+else
+ CFLAGS?= -std=c99 -pedantic -O2 -Wall -W
+endif
+CCOPT= $(CFLAGS) $(CCLINK) $(ARCH)
DEBUG?= -g -rdynamic -ggdb
-CFLAGS?= -std=c99 -O2 -pedantic -Wall -W
-CCOPT= $(CFLAGS) $(ARCH)
OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o
BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o
@@ -45,7 +51,7 @@ redis-cli: $(CLIOBJ)
$(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
.c.o:
- $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
+ $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
clean:
rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o