]> git.saurik.com Git - redis.git/blame - deps/Makefile
Make clear that contributing code to the Redis project means to release it under...
[redis.git] / deps / Makefile
CommitLineData
4b8a6394
PN
1# Redis dependency Makefile
2
de07849e 3uname_S:= $(shell sh -c 'uname -s 2>/dev/null || echo not')
4b8a6394
PN
4
5CCCOLOR="\033[34m"
6LINKCOLOR="\033[34;1m"
7SRCCOLOR="\033[33m"
8BINCOLOR="\033[37;1m"
9MAKECOLOR="\033[32;1m"
10ENDCOLOR="\033[0m"
11
12default:
13 @echo "Explicit target required"
14
de07849e
PN
15.PHONY: default
16
17# Prerequisites target
18.make-prerequisites:
19 @touch $@
20
21# Clean everything when CFLAGS is different
22ifneq ($(shell sh -c '[ -f .make-cflags ] && cat .make-cflags || echo none'), $(CFLAGS))
23.make-cflags: distclean
24 -(echo "$(CFLAGS)" > .make-cflags)
25.make-prerequisites: .make-cflags
4b8a6394
PN
26endif
27
de07849e
PN
28# Clean everything when LDFLAGS is different
29ifneq ($(shell sh -c '[ -f .make-ldflags ] && cat .make-ldflags || echo none'), $(LDFLAGS))
30.make-ldflags: distclean
31 -(echo "$(LDFLAGS)" > .make-ldflags)
32.make-prerequisites: .make-ldflags
33endif
4b8a6394
PN
34
35distclean:
36 -(cd hiredis && $(MAKE) clean) > /dev/null || true
37 -(cd linenoise && $(MAKE) clean) > /dev/null || true
38 -(cd lua && $(MAKE) clean) > /dev/null || true
39 -(cd jemalloc && [ -f Makefile ] && $(MAKE) distclean) > /dev/null || true
de07849e
PN
40 -(rm -f .make-*)
41
42.PHONY: distclean
43
44hiredis: .make-prerequisites
45 @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
46 cd hiredis && $(MAKE) static
47
48.PHONY: hiredis
49
50linenoise: .make-prerequisites
51 @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
52 cd linenoise && $(MAKE)
53
54.PHONY: linenoise
55
56ifeq ($(uname_S),SunOS)
57 # Make isinf() available
58 LUA_CFLAGS= -D__C99FEATURES__=1
59endif
60
61LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI $(CFLAGS)
62LUA_LDFLAGS+= $(LDFLAGS)
4b8a6394 63
de07849e
PN
64lua: .make-prerequisites
65 @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
66 cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)"
4b8a6394 67
de07849e 68.PHONY: lua
4b8a6394 69
de07849e
PN
70JEMALLOC_CFLAGS= -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops $(CFLAGS)
71JEMALLOC_LDFLAGS= $(LDFLAGS)
4b8a6394 72
de07849e
PN
73jemalloc: .make-prerequisites
74 @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
75 cd jemalloc && ./configure --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
4917a6a8 76 cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a
4b8a6394 77
de07849e 78.PHONY: jemalloc