1 # -*- makefile-gmake -*-
5 # save against changes in $(dir)
7 extra_cflags += -I$(srcdir)
10 $(notmuch_compat_srcs) \
13 smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)
15 $(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libnotmuch_util.a
16 $(call quiet,CC) $^ -o $@ $(LDFLAGS)
18 $(dir)/message-id-parse: $(dir)/message-id-parse.o lib/libnotmuch.a util/libnotmuch_util.a
19 $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)
21 $(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libnotmuch_util.a
22 $(call quiet,CC) $^ -o $@ $(LDFLAGS) $(TALLOC_LDFLAGS)
24 random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \
25 notmuch-config.o status.o command-line-arguments.o \
26 lib/libnotmuch.a util/libnotmuch_util.a \
27 parse-time-string/libparse-time-string.a
29 $(dir)/random-corpus: $(random_corpus_deps)
30 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(CONFIGURE_LDFLAGS)
32 $(dir)/smtp-dummy: $(smtp_dummy_modules)
33 $(call quiet,CC) $^ -o $@ $(LDFLAGS)
35 $(dir)/symbol-test: $(dir)/symbol-test.o lib/$(LINKER_NAME)
36 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) -Llib -lnotmuch $(XAPIAN_LDFLAGS)
38 $(dir)/parse-time: $(dir)/parse-time.o parse-time-string/parse-time-string.o
39 $(call quiet,CC) $^ -o $@ $(LDFLAGS)
41 $(dir)/make-db-version: $(dir)/make-db-version.o
42 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
44 $(dir)/ghost-report: $(dir)/ghost-report.o
45 $(call quiet,CXX) $^ -o $@ $(LDFLAGS) $(XAPIAN_LDFLAGS)
49 test_main_srcs=$(dir)/arg-test.c \
51 $(dir)/random-corpus.c \
54 $(dir)/symbol-test.cc \
55 $(dir)/make-db-version.cc \
56 $(dir)/ghost-report.cc \
57 $(dir)/message-id-parse.c
59 test_srcs=$(test_main_srcs) $(dir)/database-test.c
61 TEST_BINARIES := $(test_main_srcs:.c=)
62 TEST_BINARIES := $(TEST_BINARIES:.cc=)
64 test-binaries: $(TEST_BINARIES)
66 test: all test-binaries
68 @echo 'Use "$(MAKE) V=1" to see the details for passing and known broken tests.'
69 @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
71 # The user has explicitly enabled quiet execution.
73 @env NOTMUCH_TEST_QUIET=1 $(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
75 @$(NOTMUCH_SRCDIR)/$(test_src_dir)/notmuch-test $(OPTIONS)
81 SRCS := $(SRCS) $(test_srcs)
82 CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
83 $(dir)/database-test.o \
84 $(dir)/test-results $(dir)/tmp.*