]> git.saurik.com Git - redis.git/blame - Makefile
Fixed daemonization when using kqueue/kevent. Now the server initialization is perfor...
[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
325d1eb4 9else
d0ccebcf 10 CFLAGS?= -std=c99 -pedantic -O2 -Wall -W $(ARCH) $(PROF)
a7866db6 11 CCLINK?= -lm
325d1eb4 12endif
d0ccebcf 13CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) $(PROF)
01fe7151 14DEBUG?= -g -rdynamic -ggdb
ed9b544e 15
5f5b9840 16OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o
ed9b544e 17BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o
18CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o
19
20PRGNAME = redis-server
21BENCHPRGNAME = redis-benchmark
22CLIPRGNAME = redis-cli
23
24all: redis-server redis-benchmark redis-cli
25
26# Deps (use make dep to generate this)
9e9c0ce1 27adlist.o: adlist.c adlist.h zmalloc.h
64f36a58 28ae.o: ae.c ae.h zmalloc.h ae_select.c ae_epoll.c
266373b2 29ae_select.o: ae_select.c
9e9c0ce1 30anet.o: anet.c fmacros.h anet.h
31benchmark.o: benchmark.c fmacros.h ae.h anet.h sds.h adlist.h zmalloc.h
32dict.o: dict.c fmacros.h dict.h zmalloc.h
33lzf_c.o: lzf_c.c lzfP.h
34lzf_d.o: lzf_d.c lzfP.h
35pqsort.o: pqsort.c
36redis-cli.o: redis-cli.c fmacros.h anet.h sds.h adlist.h zmalloc.h
266373b2 37redis.o: redis.c fmacros.h config.h redis.h ae.h sds.h anet.h dict.h \
38 adlist.h zmalloc.h lzf.h pqsort.h staticsymbols.h
9e9c0ce1 39sds.o: sds.c sds.h zmalloc.h
40zmalloc.o: zmalloc.c config.h
ed9b544e 41
42redis-server: $(OBJ)
43 $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ)
44 @echo ""
45 @echo "Hint: To run the test-redis.tcl script is a good idea."
46 @echo "Launch the redis server with ./redis-server, then in another"
47 @echo "terminal window enter this directory and run 'make test'."
48 @echo ""
49
50redis-benchmark: $(BENCHOBJ)
51 $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ)
52
53redis-cli: $(CLIOBJ)
54 $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
55
56.c.o:
325d1eb4 57 $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
ed9b544e 58
59clean:
60 rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o
61
62dep:
63 $(CC) -MM *.c
64
bcfc686d 65staticsymbols:
66 tclsh utils/build-static-symbols.tcl > staticsymbols.h
67
ed9b544e 68test:
69 tclsh test-redis.tcl
70
71bench:
72 ./redis-benchmark
378fd421 73
74log:
75 git log '--pretty=format:%ad %s' --date=short > Changelog
fd8ccf44 76
7732bit:
78 make ARCH="-arch i386"
d0ccebcf 79
80gprof:
81 make PROF="-pg"
82
8332bitgprof:
84 make PROF="-pg" ARCH="-arch i386"