X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/56906eefea4b77e1cd43d0b483d11470a3dab90d..d13f767cf2c23f47fd976380c8c8833ec525eccd:/Makefile diff --git a/Makefile b/Makefile index 4908de46..ba3d5009 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,16 @@ # Copyright (C) 2009 Salvatore Sanfilippo # 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 -lm +else + CFLAGS?= -std=c99 -pedantic -O2 -Wall -W $(ARCH) + CCLINK?= -lm +endif +CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) DEBUG?= -g -rdynamic -ggdb -CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -CCOPT= $(CFLAGS) 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 +52,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 @@ -61,3 +68,6 @@ bench: log: git log '--pretty=format:%ad %s' --date=short > Changelog + +32bit: + make ARCH="-arch i386"