2 # Copyright (C) 2009 Salvatore Sanfilippo <antirez at gmail dot com>
3 # This file is released under the BSD license, see the COPYING file
5 DEBUG?= -g -rdynamic -ggdb
6 CFLAGS?= -std=c99 -pedantic -O0 -Wall -W -DSDS_ABORT_ON_OOM
9 OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o
10 BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o
11 CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o
13 PRGNAME = redis-server
14 BENCHPRGNAME = redis-benchmark
15 CLIPRGNAME = redis-cli
17 all: redis-server redis-benchmark redis-cli
19 # Deps (use make dep to generate this)
20 adlist.o: adlist.c adlist.h zmalloc.h
21 ae.o: ae.c ae.h zmalloc.h
22 anet.o: anet.c fmacros.h anet.h
23 benchmark.o: benchmark.c fmacros.h ae.h anet.h sds.h adlist.h zmalloc.h
24 dict.o: dict.c fmacros.h dict.h zmalloc.h
25 lzf_c.o: lzf_c.c lzfP.h
26 lzf_d.o: lzf_d.c lzfP.h
28 redis-cli.o: redis-cli.c fmacros.h anet.h sds.h adlist.h zmalloc.h
29 redis.o: redis.c fmacros.h ae.h sds.h anet.h dict.h adlist.h zmalloc.h lzf.h pqsort.h config.h
30 sds.o: sds.c sds.h zmalloc.h
31 zmalloc.o: zmalloc.c config.h
34 $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ)
36 @echo "Hint: To run the test-redis.tcl script is a good idea."
37 @echo "Launch the redis server with ./redis-server, then in another"
38 @echo "terminal window enter this directory and run 'make test'."
41 redis-benchmark: $(BENCHOBJ)
42 $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ)
45 $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
48 $(CC) -c $(CCOPT) $(DEBUG) $(COMPILE_TIME) $<
51 rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o
63 git log '--pretty=format:%ad %s' --date=short > Changelog