Fixes for make distcheck.
[beanstalkd.git] / Makefile.am
blob56a6ddbee82327216178e80eb4f31fc9b4f9dd2d
1 AUTOMAKE_OPTIONS = foreign no-dependencies subdir-objects
2 ACLOCAL_AMFLAGS = -I m4
4 program = beanstalkd
6 bin_PROGRAMS = $(program)
7 aux_sources = \
8         binlog.c \
9         conn.c \
10         job.c \
11         ms.c \
12         net.c \
13         pq.c \
14         primes.c \
15         prot.c \
16         tube.c \
17         util.c
18 beanstalkd_SOURCES = beanstalkd.c $(aux_sources)
20 EXTRA_PROGRAMS = cutgen
21 cutgen_SOURCES = cutgen.c
23 tests = \
24         tests/test_job.c \
25         tests/test_pq.c
27 EXTRA_DIST = cut.c $(tests) cut.h sh-tests check.sh check-one.sh \
28         binlog.h \
29         conn.h \
30         job.h \
31         ms.h \
32         net.h \
33         pq.h \
34         primes.h \
35         prot.h \
36         stat.h \
37         tube.h \
38         util.h
40 dist_doc_DATA = doc/protocol.txt
41 dist_man_MANS = doc/beanstalkd.1
43 check-cut: tests/cutcheck
44         tests/cutcheck
46 check-shell: $(program)
47         $(srcdir)/check.sh $(srcdir)/sh-tests/*.{commands,sh}
49 check: check-cut check-shell
51 tests/cutcheck.c: $(tests) cutgen
52         mkdir -p tests
53         ./cutgen -o tests/cutcheck.c $(tests:%=$(srcdir)/%)
55 tests/cutcheck: tests/cutcheck.o cut.o $(aux_sources:.c=.o) $(tests:.c=.o)
56         $(LINK) $^ $(beanstalkd_LDADD) $(LIBS)
58 CLEANFILES = cutgen tests/cutcheck* tests/*.o
60 DISTCLEANFILES = core core.* gmon.out $(program)-*.tar.gz
62 dist-hook:
63         echo -e '#!/bin/sh\n\n# This file was generated by "make dist".\necho $(VERSION)' > $(distdir)/version.sh
64         chmod +x $(distdir)/version.sh