]> git.saurik.com Git - redis.git/blame - Makefile
non-blocking VM data structures, just a start
[redis.git] / Makefile
CommitLineData
ed9b544e 1# Redis Makefile
2# Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
3# This file is released under the BSD license, see the COPYING file
4
325d1eb4 5uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
6ifeq ($(uname_S),SunOS)
7 CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -D__EXTENSIONS__ -D_XPG6
a7866db6 8 CCLINK?= -ldl -lnsl -lsocket -lm
92f8e882 9 PTLINK?= -lpthread
325d1eb4 10else
d0ccebcf 11 CFLAGS?= -std=c99 -pedantic -O2 -Wall -W $(ARCH) $(PROF)
a7866db6 12 CCLINK?= -lm
92f8e882 13 PTLINK?= -lpthread
325d1eb4 14endif
d0ccebcf 15CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF)
01fe7151 16DEBUG?= -g -rdynamic -ggdb
ed9b544e 17
5f5b9840 18OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o
ed9b544e 19BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o
20CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o
21
22PRGNAME = redis-server
23BENCHPRGNAME = redis-benchmark
24CLIPRGNAME = redis-cli
25
26all: redis-server redis-benchmark redis-cli
27
28# Deps (use make dep to generate this)
9e9c0ce1 29adlist.o: adlist.c adlist.h zmalloc.h
64f36a58 30ae.o: ae.c ae.h zmalloc.h ae_select.c ae_epoll.c
266373b2 31ae_select.o: ae_select.c
9e9c0ce1 32anet.o: anet.c fmacros.h anet.h
33benchmark.o: benchmark.c fmacros.h ae.h anet.h sds.h adlist.h zmalloc.h
34dict.o: dict.c fmacros.h dict.h zmalloc.h
35lzf_c.o: lzf_c.c lzfP.h
36lzf_d.o: lzf_d.c lzfP.h
37pqsort.o: pqsort.c
38redis-cli.o: redis-cli.c fmacros.h anet.h sds.h adlist.h zmalloc.h
266373b2 39redis.o: redis.c fmacros.h config.h redis.h ae.h sds.h anet.h dict.h \
40 adlist.h zmalloc.h lzf.h pqsort.h staticsymbols.h
9e9c0ce1 41sds.o: sds.c sds.h zmalloc.h
42zmalloc.o: zmalloc.c config.h
ed9b544e 43
44redis-server: $(OBJ)
92f8e882 45 $(CC) -o $(PRGNAME) $(CCOPT) $(PTLINK) $(DEBUG) $(OBJ)
ed9b544e 46 @echo ""
47 @echo "Hint: To run the test-redis.tcl script is a good idea."
48 @echo "Launch the redis server with ./redis-server, then in another"
49 @echo "terminal window enter this directory and run 'make test'."
50 @echo ""
51
52redis-benchmark: $(BENCHOBJ)
53 $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ)
54
55redis-cli: $(CLIOBJ)
56 $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
57
58.c.o:
325d1eb4 59 $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
ed9b544e 60
61clean:
fc77604c 62 rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o *.gcda *.gcno *.gcov
ed9b544e 63
64dep:
65 $(CC) -MM *.c
66
bcfc686d 67staticsymbols:
68 tclsh utils/build-static-symbols.tcl > staticsymbols.h
69
ed9b544e 70test:
71 tclsh test-redis.tcl
72
73bench:
74 ./redis-benchmark
378fd421 75
76log:
77 git log '--pretty=format:%ad %s' --date=short > Changelog
fd8ccf44 78
7932bit:
80 make ARCH="-arch i386"
d0ccebcf 81
82gprof:
83 make PROF="-pg"
84
fc77604c 85gcov:
86 make PROF="-fprofile-arcs -ftest-coverage"
87
d0ccebcf 8832bitgprof:
89 make PROF="-pg" ARCH="-arch i386"