Make kick work on delayed jobs too (#920).
[beanstalkd.git] / Makefile
blob436df24cde23206f2bad53538f869d1a405b2667
1 program := beanstalkd
2 export CFLAGS := -O2 -Wall -Werror
3 export LDFLAGS := -levent
5 sources := $(shell ls *.c | fgrep -v $(program))
6 objects := $(sources:.c=.o)
7 tests := $(sources:%=tests/test_%)
9 all: $(program)
11 debug: export CFLAGS := -g -pg -Wall -Werror -DDEBUG
12 debug: export LDFLAGS := -pg -levent
13 debug: all
15 check: export CFLAGS := -g -pg -Wall -Werror
16 check: export LDFLAGS := -pg -levent
17 check: tests/cutcheck $(objects)
18 ./tests/cutcheck
19 @echo
21 #ifneq ($(MAKECMDGOALS),clean)
22 -include $(sources:%.c=.%.d) .$(program).d
23 #endif
25 $(program): $(objects) $(program).o
27 tests/cutcheck.c: $(tests)
28 cutgen -o tests/cutcheck.c $(tests)
30 tests/cutcheck: tests/cutcheck.o $(objects) $(tests:.c=.o)
32 pkg: check-for-version $(program)-$(VERSION).tar.gz
34 check-for-version:
35 @test "$(VERSION)" || { echo Usage: make pkg 'VERSION=<vers>'; false; }
37 $(program)-%.tar.gz:
38 ./pkg.sh $(program) $* $@
40 clean:
41 rm -f $(program) *.o .*.d tests/*.o tests/cutcheck* core gmon.out
42 rm -f $(program)-*.tar.gz
44 # .DELETE_ON_ERROR:
45 .PHONY: all debug check pkg check-for-version clean
47 # This tells make how to generate dependency files
48 .%.d: %.c
49 @$(SHELL) -ec '$(CC) -MM $(CPPFLAGS) $< \
50 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
51 [ -s $@ ] || rm -f $@'