]>
Commit | Line | Data |
---|---|---|
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 | 5 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
6 | ifeq ($(uname_S),SunOS) | |
7 | CFLAGS?= -std=c99 -pedantic -O2 -Wall -W -D__EXTENSIONS__ -D_XPG6 | |
8 | CCLINK?= -ldl -lnsl -lsocket | |
9 | else | |
10 | CFLAGS?= -std=c99 -pedantic -O2 -Wall -W | |
11 | endif | |
12 | CCOPT= $(CFLAGS) $(CCLINK) $(ARCH) | |
01fe7151 | 13 | DEBUG?= -g -rdynamic -ggdb |
ed9b544e | 14 | |
5f5b9840 | 15 | OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o |
ed9b544e | 16 | BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o |
17 | CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o | |
18 | ||
19 | PRGNAME = redis-server | |
20 | BENCHPRGNAME = redis-benchmark | |
21 | CLIPRGNAME = redis-cli | |
22 | ||
23 | all: redis-server redis-benchmark redis-cli | |
24 | ||
25 | # Deps (use make dep to generate this) | |
9e9c0ce1 | 26 | adlist.o: adlist.c adlist.h zmalloc.h |
27 | ae.o: ae.c ae.h zmalloc.h | |
28 | anet.o: anet.c fmacros.h anet.h | |
29 | benchmark.o: benchmark.c fmacros.h ae.h anet.h sds.h adlist.h zmalloc.h | |
30 | dict.o: dict.c fmacros.h dict.h zmalloc.h | |
31 | lzf_c.o: lzf_c.c lzfP.h | |
32 | lzf_d.o: lzf_d.c lzfP.h | |
33 | pqsort.o: pqsort.c | |
34 | redis-cli.o: redis-cli.c fmacros.h anet.h sds.h adlist.h zmalloc.h | |
35 | redis.o: redis.c fmacros.h ae.h sds.h anet.h dict.h adlist.h zmalloc.h lzf.h pqsort.h config.h | |
36 | sds.o: sds.c sds.h zmalloc.h | |
37 | zmalloc.o: zmalloc.c config.h | |
ed9b544e | 38 | |
39 | redis-server: $(OBJ) | |
40 | $(CC) -o $(PRGNAME) $(CCOPT) $(DEBUG) $(OBJ) | |
41 | @echo "" | |
42 | @echo "Hint: To run the test-redis.tcl script is a good idea." | |
43 | @echo "Launch the redis server with ./redis-server, then in another" | |
44 | @echo "terminal window enter this directory and run 'make test'." | |
45 | @echo "" | |
46 | ||
47 | redis-benchmark: $(BENCHOBJ) | |
48 | $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ) | |
49 | ||
50 | redis-cli: $(CLIOBJ) | |
51 | $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ) | |
52 | ||
53 | .c.o: | |
325d1eb4 | 54 | $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $< |
ed9b544e | 55 | |
56 | clean: | |
57 | rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o | |
58 | ||
59 | dep: | |
60 | $(CC) -MM *.c | |
61 | ||
62 | test: | |
63 | tclsh test-redis.tcl | |
64 | ||
65 | bench: | |
66 | ./redis-benchmark | |
378fd421 | 67 | |
68 | log: | |
69 | git log '--pretty=format:%ad %s' --date=short > Changelog | |
fd8ccf44 | 70 | |
71 | 32bit: | |
72 | make ARCH="-arch i386" |