Back to home page

Redis cross reference

 
 

    


0001 # Redis dependency Makefile
0002 
0003 uname_S:= $(shell sh -c 'uname -s 2>/dev/null || echo not')
0004 
0005 CCCOLOR="\033[34m"
0006 LINKCOLOR="\033[34;1m"
0007 SRCCOLOR="\033[33m"
0008 BINCOLOR="\033[37;1m"
0009 MAKECOLOR="\033[32;1m"
0010 ENDCOLOR="\033[0m"
0011 
0012 default:
0013         @echo "Explicit target required"
0014 
0015 .PHONY: default
0016 
0017 # Prerequisites target
0018 .make-prerequisites:
0019         @touch $@
0020 
0021 # Clean everything when CFLAGS is different
0022 ifneq ($(shell sh -c '[ -f .make-cflags ] && cat .make-cflags || echo none'), $(CFLAGS))
0023 .make-cflags: distclean
0024         -(echo "$(CFLAGS)" > .make-cflags)
0025 .make-prerequisites: .make-cflags
0026 endif
0027 
0028 # Clean everything when LDFLAGS is different
0029 ifneq ($(shell sh -c '[ -f .make-ldflags ] && cat .make-ldflags || echo none'), $(LDFLAGS))
0030 .make-ldflags: distclean
0031         -(echo "$(LDFLAGS)" > .make-ldflags)
0032 .make-prerequisites: .make-ldflags
0033 endif
0034 
0035 distclean:
0036         -(cd hiredis && $(MAKE) clean) > /dev/null || true
0037         -(cd linenoise && $(MAKE) clean) > /dev/null || true
0038         -(cd lua && $(MAKE) clean) > /dev/null || true
0039         -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true
0040         -(rm -f .make-*)
0041 
0042 .PHONY: distclean
0043 
0044 hiredis: .make-prerequisites
0045         @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
0046         cd hiredis && $(MAKE) static
0047 
0048 .PHONY: hiredis
0049 
0050 linenoise: .make-prerequisites
0051         @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
0052         cd linenoise && $(MAKE)
0053 
0054 .PHONY: linenoise
0055 
0056 ifeq ($(uname_S),SunOS)
0057   # Make isinf() available
0058   LUA_CFLAGS= -D__C99FEATURES__=1
0059 endif
0060 
0061 LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI $(CFLAGS)
0062 LUA_LDFLAGS+= $(LDFLAGS)
0063 
0064 lua: .make-prerequisites
0065         @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
0066         cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)"
0067 
0068 .PHONY: lua
0069 
0070 JEMALLOC_CFLAGS= -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops $(CFLAGS)
0071 JEMALLOC_LDFLAGS= $(LDFLAGS)
0072 
0073 jemalloc: .make-prerequisites
0074         @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
0075         cd jemalloc && ./configure --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
0076         cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a
0077 
0078 .PHONY: jemalloc