uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
OPTIMIZATION?=-O2
+LUA_CFLAGS=-O2 -Wall
+
ifeq ($(uname_S),Linux)
ifneq ($(FORCE_LIBC_MALLOC),yes)
USE_JEMALLOC=yes
endif
ifeq ($(uname_S),SunOS)
+ # make isinf() available
+ LUA_CFLAGS+=-D__C99FEATURES__=1
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
CCLINK?=-ldl -lnsl -lsocket -lm -lpthread
DEBUG?=-g -ggdb
CCLINK+= $(ALLOC_LINK)
CFLAGS+= $(ALLOC_FLAGS)
+LUA_CFLAGS+= $(ARCH)
CCOPT= $(CFLAGS) $(ARCH) $(PROF)
adlist.h zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h util.h
scripting.o: scripting.c redis.h fmacros.h config.h ae.h sds.h dict.h \
adlist.h zmalloc.h anet.h zipmap.h ziplist.h intset.h version.h util.h \
- sha1.h
+ sha1.h rand.h
rio.o: rio.c sds.h
sds.o: sds.c sds.h zmalloc.h
sha1.o: sha1.c sha1.h config.h
@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)linenoise$(ENDCOLOR)
@cd ../deps/linenoise && $(MAKE) ARCH="$(ARCH)"
@echo $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)Lua ansi$(ENDCOLOR)
- @cd ../deps/lua && $(MAKE) ARCH="$(ARCH)" ansi
+ @cd ../deps/lua && $(MAKE) CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(ARCH)" ansi
../deps/jemalloc/lib/libjemalloc.a:
cd ../deps/jemalloc && ./configure $(JEMALLOC_CFLAGS) --with-jemalloc-prefix=je_ --enable-cc-silence && $(MAKE) lib/libjemalloc.a