Portability fixes.
[beanstalkd.git] / Makefile.am
blob4bffe72f047560ec1a9466ceac735ff3739633ef
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         port.c \
14         pq.c \
15         primes.c \
16         prot.c \
17         tube.c \
18         util.c
19 beanstalkd_SOURCES = beanstalkd.c $(aux_sources)
21 EXTRA_PROGRAMS = cutgen
22 cutgen_SOURCES = cutgen.c
24 tests = \
25         tests/test_job.c \
26         tests/test_pq.c
28 EXTRA_DIST = cut.c $(tests) cut.h sh-tests check.sh check-one.sh \
29         binlog.h \
30         conn.h \
31         job.h \
32         ms.h \
33         net.h \
34         port.h \
35         pq.h \
36         primes.h \
37         prot.h \
38         stat.h \
39         tube.h \
40         util.h
42 dist_doc_DATA = doc/protocol.txt
43 dist_man_MANS = doc/beanstalkd.1
45 check-cut: tests/cutcheck
46         tests/cutcheck
48 check-shell: $(program)
49         $(srcdir)/check.sh $(srcdir)/sh-tests/*.{commands,sh}
51 check: check-cut check-shell
53 tests/cutcheck.c: $(tests) cutgen
54         mkdir -p tests
55         ./cutgen -o tests/cutcheck.c $(tests:%=$(srcdir)/%)
57 tests/cutcheck: tests/cutcheck.o cut.o $(aux_sources:.c=.o) $(tests:.c=.o)
58         $(LINK) $^ $(beanstalkd_LDADD) $(LIBS)
60 CLEANFILES = cutgen tests/cutcheck* tests/*.o
62 DISTCLEANFILES = core core.* gmon.out $(program)-*.tar.gz
64 dist-hook:
65         echo -e '#!/bin/sh\n\n# This file was generated by "make dist".\necho $(VERSION)' > $(distdir)/version.sh
66         chmod +x $(distdir)/version.sh