shrink the hashmap when it's too sparse
[beanstalkd.git] / Makefile
bloba3f345fee3755f579de62dea79c5bab2c315c132
1 PREFIX=/usr/local
2 BINDIR=$(DESTDIR)$(PREFIX)/bin
3 CFLAGS=-Wall -Werror\
4 -Wformat=2\
5 -g\
7 LDFLAGS=
8 OS=$(shell uname|tr A-Z a-z)
9 INSTALL=install
11 VERS=$(shell ./vers.sh)
12 TARG=beanstalkd
13 MOFILE=main.o
14 OFILES=\
15 $(OS).o\
16 conn.o\
17 file.o\
18 heap.o\
19 job.o\
20 ms.o\
21 net.o\
22 primes.o\
23 prot.o\
24 sd-daemon.o\
25 serv.o\
26 time.o\
27 tube.o\
28 util.o\
29 vers.o\
30 walg.o\
32 TOFILES=\
33 testheap.o\
34 testjobs.o\
35 testserv.o\
36 testutil.o\
38 HFILES=\
39 dat.h\
40 sd-daemon.h\
42 ifeq ($(OS),linux)
44 LDLIBS=\
45 -lrt\
47 endif
49 CLEANFILES=\
50 vers.c\
52 .PHONY: all
53 all: $(TARG)
55 $(TARG): $(OFILES) $(MOFILE)
56 $(LINK.o) -o $@ $^ $(LDLIBS)
58 .PHONY: install
59 install: $(BINDIR)/$(TARG)
61 $(BINDIR)/%: %
62 $(INSTALL) -d $(dir $@)
63 $(INSTALL) $< $@
65 CLEANFILES:=$(CLEANFILES) $(TARG)
67 $(OFILES) $(MOFILE): $(HFILES)
69 .PHONY: clean
70 clean:
71 rm -f *.o $(CLEANFILES)
73 .PHONY: check
74 check: ct/_ctcheck
75 ct/_ctcheck
77 .PHONY: bench
78 bench: ct/_ctcheck
79 ct/_ctcheck -b
81 ct/_ctcheck: ct/_ctcheck.o ct/ct.o $(OFILES) $(TOFILES)
83 ct/_ctcheck.c: $(TOFILES) ct/gen
84 ct/gen $(TOFILES) >$@.part
85 mv $@.part $@
87 ct/ct.o ct/_ctcheck.o: ct/ct.h ct/internal.h
89 $(TOFILES): $(HFILES) ct/ct.h
91 CLEANFILES:=$(CLEANFILES) ct/_* ct/*.o
93 ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
94 .PHONY: vers.c
95 endif
96 vers.c:
97 ./verc.sh >vers.c
99 doc/beanstalkd.1 doc/beanstalkd.1.html: doc/beanstalkd.ronn
100 ronn $<
102 freebsd.o: darwin.c