dir := test
-extra_cflags += -I.
+# save against changes in $(dir)
+test_src_dir := $(dir)
+extra_cflags += -I$(srcdir)
smtp_dummy_srcs = \
$(notmuch_compat_srcs) \
smtp_dummy_modules = $(smtp_dummy_srcs:.c=.o)
$(dir)/arg-test: $(dir)/arg-test.o command-line-arguments.o util/libutil.a
- $(call quiet,CC) -I. $^ -o $@
+ $(call quiet,CC) $^ -o $@
$(dir)/hex-xcode: $(dir)/hex-xcode.o command-line-arguments.o util/libutil.a
- $(call quiet,CC) -I. $^ -o $@ -ltalloc
+ $(call quiet,CC) $^ $(TALLOC_LDFLAGS) -o $@
random_corpus_deps = $(dir)/random-corpus.o $(dir)/database-test.o \
notmuch-config.o command-line-arguments.o \
test-binaries: $(TEST_BINARIES)
test: all test-binaries
- @${dir}/notmuch-test $(OPTIONS)
+ @${test_src_dir}/notmuch-test $(OPTIONS)
check: test
SRCS := $(SRCS) $(smtp_dummy_srcs)
-CLEAN := $(CLEAN) $(dir)/smtp-dummy $(dir)/smtp-dummy.o \
- $(dir)/symbol-test $(dir)/symbol-test.o \
- $(dir)/arg-test $(dir)/arg-test.o \
- $(dir)/hex-xcode $(dir)/hex-xcode.o \
+CLEAN += $(TEST_BINARIES) $(addsuffix .o,$(TEST_BINARIES)) \
$(dir)/database-test.o \
- $(dir)/random-corpus $(dir)/random-corpus.o \
- $(dir)/parse-time $(dir)/parse-time.o \
$(dir)/corpus.mail $(dir)/test-results $(dir)/tmp.*