]> git.saurik.com Git - redis.git/blame - Makefile
Fix for skiplists backward link
[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
8 CCLINK?= -ldl -lnsl -lsocket
9else
10 CFLAGS?= -std=c99 -pedantic -O2 -Wall -W
11endif
12CCOPT= $(CFLAGS) $(CCLINK) $(ARCH)
01fe7151 13DEBUG?= -g -rdynamic -ggdb
ed9b544e 14
5f5b9840 15OBJ = adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o
ed9b544e 16BENCHOBJ = ae.o anet.o benchmark.o sds.o adlist.o zmalloc.o
17CLIOBJ = anet.o sds.o adlist.o redis-cli.o zmalloc.o
18
19PRGNAME = redis-server
20BENCHPRGNAME = redis-benchmark
21CLIPRGNAME = redis-cli
22
23all: redis-server redis-benchmark redis-cli
24
25# Deps (use make dep to generate this)
9e9c0ce1 26adlist.o: adlist.c adlist.h zmalloc.h
27ae.o: ae.c ae.h zmalloc.h
28anet.o: anet.c fmacros.h anet.h
29benchmark.o: benchmark.c fmacros.h ae.h anet.h sds.h adlist.h zmalloc.h
30dict.o: dict.c fmacros.h dict.h zmalloc.h
31lzf_c.o: lzf_c.c lzfP.h
32lzf_d.o: lzf_d.c lzfP.h
33pqsort.o: pqsort.c
34redis-cli.o: redis-cli.c fmacros.h anet.h sds.h adlist.h zmalloc.h
35redis.o: redis.c fmacros.h ae.h sds.h anet.h dict.h adlist.h zmalloc.h lzf.h pqsort.h config.h
36sds.o: sds.c sds.h zmalloc.h
37zmalloc.o: zmalloc.c config.h
ed9b544e 38
39redis-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
47redis-benchmark: $(BENCHOBJ)
48 $(CC) -o $(BENCHPRGNAME) $(CCOPT) $(DEBUG) $(BENCHOBJ)
49
50redis-cli: $(CLIOBJ)
51 $(CC) -o $(CLIPRGNAME) $(CCOPT) $(DEBUG) $(CLIOBJ)
52
53.c.o:
325d1eb4 54 $(CC) -c $(CFLAGS) $(DEBUG) $(COMPILE_TIME) $<
ed9b544e 55
56clean:
57 rm -rf $(PRGNAME) $(BENCHPRGNAME) $(CLIPRGNAME) *.o
58
59dep:
60 $(CC) -MM *.c
61
62test:
63 tclsh test-redis.tcl
64
65bench:
66 ./redis-benchmark
378fd421 67
68log:
69 git log '--pretty=format:%ad %s' --date=short > Changelog
fd8ccf44 70
7132bit:
72 make ARCH="-arch i386"