streamline tests with new ct features
[beanstalkd.git] / Makefile
blobc3bab2830bcd81e81ccf342c630bc29738970b2e
1 PREFIX=/usr/local
2 BINDIR=$(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 heap-test.o\
34 integ-test.o\
35 job-test.o\
36 util-test.o\
38 HFILES=\
39 dat.h\
40 sd-daemon.h\
42 CLEANFILES=\
43 vers.c\
45 .PHONY: all
46 all: $(TARG)
48 $(TARG): $(OFILES) $(MOFILE)
49 $(LINK.o) -o $@ $^ $(LDLIBS)
51 .PHONY: install
52 install: $(BINDIR) $(BINDIR)/$(TARG)
54 $(BINDIR):
55 $(INSTALL) -d $@
57 $(BINDIR)/%: %
58 $(INSTALL) $< $@
60 CLEANFILES:=$(CLEANFILES) $(TARG)
62 $(OFILES) $(MOFILE): $(HFILES)
64 .PHONY: clean
65 clean:
66 rm -f *.o $(CLEANFILES)
68 .PHONY: check
69 check: ct/_ctcheck
70 ct/_ctcheck
72 ct/_ctcheck: ct/_ctcheck.o ct/ct.o $(OFILES) $(TOFILES)
74 ct/_ctcheck.c: $(TOFILES) ct/gen
75 ct/gen $(TOFILES) >$@.part
76 mv $@.part $@
78 ct/ct.o ct/_ctcheck.o: ct/ct.h ct/internal.h
80 $(TOFILES): $(HFILES) ct/ct.h
82 CLEANFILES:=$(CLEANFILES) ct/_* ct/*.o
84 ifneq ($(shell ./verc.sh),$(shell cat vers.c 2>/dev/null))
85 .PHONY: vers.c
86 endif
87 vers.c:
88 ./verc.sh >vers.c
90 doc/beanstalkd.1 doc/beanstalkd.1.html: doc/beanstalkd.ronn
91 ronn $<
93 freebsd.o: darwin.c