X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/9e9c0ce1702db12a71bef5ef877b5bf97c3c935e..3c41331e118ca130736193b3ee26827c990b3537:/Makefile diff --git a/Makefile b/Makefile index f7c54647..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 -DEBUG?= -g -CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -DSDS_ABORT_ON_OOM -CCOPT= $(CFLAGS) +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 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"