X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/95bc195158d2d9951a8534a993182399f2bb49b8..864229585a407431c8bb4b156bfb1a828aeeff9f:/src/Makefile diff --git a/src/Makefile b/src/Makefile index b3ada6ff..38a68064 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,25 +17,11 @@ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') OPTIMIZATION?=-O2 DEPENDENCY_TARGETS=hiredis linenoise lua +# Default settings STD= -std=c99 -pedantic WARN= -Wall OPT= $(OPTIMIZATION) -ifeq ($(uname_S),SunOS) - FINAL_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -D__EXTENSIONS__ -D_XPG6 - FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) - FINAL_LIBS= $(LIBS) -ldl -lnsl -lsocket -lm -lpthread - DEBUG= -g -ggdb -else - FINAL_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) - FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) - FINAL_LIBS= $(LIBS) -lm -pthread - DEBUG= -g -rdynamic -ggdb -endif - -# Include paths to dependencies -FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src - # Default allocator ifeq ($(uname_S),Linux) MALLOC=jemalloc @@ -56,6 +42,21 @@ ifeq ($(USE_JEMALLOC),yes) MALLOC=jemalloc endif +ifeq ($(uname_S),SunOS) + FINAL_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) -D__EXTENSIONS__ -D_XPG6 + FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) + FINAL_LIBS= -ldl -lnsl -lsocket -lm -lpthread + DEBUG= -g -ggdb +else + FINAL_CFLAGS= $(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) + FINAL_LDFLAGS= $(LDFLAGS) $(REDIS_LDFLAGS) + FINAL_LIBS= -lm -pthread + DEBUG= -g -rdynamic -ggdb +endif + +# Include paths to dependencies +FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src + ifeq ($(MALLOC),tcmalloc) FINAL_CFLAGS+= -DUSE_TCMALLOC FINAL_LIBS+= -ltcmalloc @@ -198,7 +199,7 @@ bench: $(REDIS_BENCHMARK_NAME) @echo "" @echo "WARNING: if it fails under Linux you probably need to install libc6-dev-i386" @echo "" - $(MAKE) CFLAGS="$(CFLAGS) -m32" LDFLAGS="$(LDFLAGS) -m32" + $(MAKE) CFLAGS="-m32" LDFLAGS="-m32" gcov: $(MAKE) REDIS_CFLAGS="-fprofile-arcs -ftest-coverage -DCOVERAGE_TEST" REDIS_LDFLAGS="-fprofile-arcs -ftest-coverage"