convert remaining simple tests to use C harness
[beanstalkd.git] / Makefile.am
blob4869aa7c2772f990a4866060443582d9228f9d56
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         heap.c \
11         job.c \
12         ms.c \
13         net.c \
14         net_$(OS).c \
15         port.c \
16         primes.c \
17         prot.c \
18         sd-daemon.c \
19         srv.c \
20         time.c \
21         tube.c \
22         util.c
23 beanstalkd_SOURCES = beanstalkd.c $(aux_sources)
25 EXTRA_PROGRAMS = cutgen
26 cutgen_SOURCES = cutgen.c
28 tests = \
29         tests/test_heap.c \
30         tests/test_int.c \
31         tests/test_job.c
33 scripts = \
34         scripts/beanstalkd.init \
35         scripts/beanstalkd.sysconfig
37 readme = \
38         README-DEVELOPERS \
39         README-TESTS
41 EXTRA_DIST = cut.c $(tests) $(scripts) $(readme) cut.h sh-tests check.sh check-one.sh \
42         beanstalkd.spec.in \
43         version.h
44         t.h \
45         dat.h \
46         port.h \
47         sd-daemon.h
49 dist_doc_DATA = doc/protocol.txt
50 dist_man_MANS = doc/beanstalkd.1
52 version.h:
53         printf '#define VERSION "%s"\n' "$(VERSION)" >$@
55 beanstalkd.c: version.h
57 check-cut: tests/cutcheck
58         tests/cutcheck
60 check-shell: $(program)
61         SRCDIR=$(srcdir) $(srcdir)/check.sh $(srcdir)/sh-tests/*.sh
63 check: check-cut check-shell
65 tests/cutcheck.c: $(tests) cutgen
66         mkdir -p tests
67         ./cutgen -o tests/cutcheck.c $(tests:%=$(srcdir)/%)
69 tests/cutcheck: tests/cutcheck.o cut.o $(aux_sources:.c=.o) $(tests:.c=.o)
70         $(LINK) $^ $(beanstalkd_LDADD) $(LIBS)
72 CLEANFILES = cutgen tests/cutcheck* tests/*.o
74 DISTCLEANFILES = core core.* gmon.out $(program)-*.tar.gz
76 dist-hook:
77         echo -e '#!/bin/sh\n\n# This file was generated by "make dist".\necho $(VERSION)' > $(distdir)/version.sh
78         chmod +x $(distdir)/version.sh
79         sed -e 's/\@VERSION\@/$(VERSION)/' $(srcdir)/beanstalkd.spec.in > $(distdir)/beanstalkd.spec
80         cp $(srcdir)/NEWS.md $(distdir)/.