X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/fd8ccf4419ab94ab5a9250c0dc7a8d1761056b48..16f9254761332a0f939cb145529d8ce5d55262a5:/Makefile diff --git a/Makefile b/Makefile index 4fe428c4..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 -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 +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