2010-03-21 10:54:08 +01:00
|
|
|
# -*- makefile -*-
|
|
|
|
|
2010-04-01 09:41:25 +02:00
|
|
|
# The major version of the library interface. This will control the soname.
|
|
|
|
# As such, this number must be incremented for any incompatible change to
|
|
|
|
# the library interface, (such as the deletion of an API or a major
|
|
|
|
# semantic change that breaks formerly functioning code).
|
2010-04-06 00:00:37 +02:00
|
|
|
#
|
2012-04-29 00:25:36 +02:00
|
|
|
LIBNOTMUCH_VERSION_MAJOR = 3
|
2010-04-01 09:41:25 +02:00
|
|
|
|
|
|
|
# The minor version of the library interface. This should be incremented at
|
2010-11-12 05:42:45 +01:00
|
|
|
# the time of release for any additions to the library interface,
|
|
|
|
# (and when it is incremented, the release version of the library should
|
|
|
|
# be reset to 0).
|
2013-12-04 17:19:46 +01:00
|
|
|
LIBNOTMUCH_VERSION_MINOR = 1
|
2010-04-01 09:41:25 +02:00
|
|
|
|
|
|
|
# The release version the library interface. This should be incremented at
|
|
|
|
# the time of release if there have been no changes to the interface, (but
|
|
|
|
# simply compatible changes to the implementation).
|
|
|
|
LIBNOTMUCH_VERSION_RELEASE = 0
|
|
|
|
|
2013-12-04 17:19:44 +01:00
|
|
|
# Note: Don't forget to change the VERSION macros in notmuch.h when
|
|
|
|
# any of the above change.
|
|
|
|
|
2010-04-30 21:00:24 +02:00
|
|
|
ifeq ($(PLATFORM),MACOSX)
|
2010-04-12 01:44:53 +02:00
|
|
|
LIBRARY_SUFFIX = dylib
|
|
|
|
# On OS X, library version numbers go before suffix.
|
|
|
|
LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
|
|
|
|
SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
|
|
|
|
LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
|
2010-04-15 01:18:19 +02:00
|
|
|
LIBRARY_LINK_FLAG = -dynamiclib -install_name $(SONAME) -compatibility_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR) -current_version $(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
|
2010-04-12 01:44:53 +02:00
|
|
|
else
|
|
|
|
LIBRARY_SUFFIX = so
|
|
|
|
LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
|
2010-04-01 09:41:25 +02:00
|
|
|
SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
|
|
|
|
LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
|
2011-11-13 17:34:42 +01:00
|
|
|
LIBRARY_LINK_FLAG = -shared -Wl,--version-script=notmuch.sym,-soname=$(SONAME) -Wl,--no-undefined
|
2012-10-24 23:43:28 +02:00
|
|
|
ifeq ($(PLATFORM),OPENBSD)
|
|
|
|
LIBRARY_LINK_FLAG += -lc
|
|
|
|
endif
|
2010-06-05 01:52:56 +02:00
|
|
|
ifeq ($(LIBDIR_IN_LDCONFIG),1)
|
2010-06-16 16:14:18 +02:00
|
|
|
ifeq ($(DESTDIR),)
|
2010-06-05 01:52:56 +02:00
|
|
|
LIBRARY_INSTALL_POST_COMMAND=ldconfig
|
|
|
|
endif
|
2010-04-12 01:44:53 +02:00
|
|
|
endif
|
2010-06-16 16:14:18 +02:00
|
|
|
endif
|
2010-04-01 07:47:12 +02:00
|
|
|
|
2010-03-10 19:59:57 +01:00
|
|
|
dir := lib
|
2011-03-10 00:02:42 +01:00
|
|
|
extra_cflags += -I$(srcdir)/$(dir) -fPIC
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2011-10-23 16:44:01 +02:00
|
|
|
# The (often-reused) $dir works fine within targets/prerequisites,
|
|
|
|
# but cannot be used reliably within commands, so copy its value to a
|
|
|
|
# variable that is not reused.
|
|
|
|
lib := $(dir)
|
|
|
|
|
2009-11-10 17:04:54 +01:00
|
|
|
libnotmuch_c_srcs = \
|
2010-04-15 01:03:18 +02:00
|
|
|
$(notmuch_compat_srcs) \
|
2010-11-11 08:26:31 +01:00
|
|
|
$(dir)/filenames.c \
|
2010-12-09 01:26:05 +01:00
|
|
|
$(dir)/string-list.c \
|
2009-11-10 17:04:54 +01:00
|
|
|
$(dir)/libsha1.c \
|
|
|
|
$(dir)/message-file.c \
|
2009-11-15 08:05:17 +01:00
|
|
|
$(dir)/messages.c \
|
2009-11-10 17:04:54 +01:00
|
|
|
$(dir)/sha1.c \
|
2011-10-23 17:05:13 +02:00
|
|
|
$(dir)/tags.c
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2009-11-10 17:04:54 +01:00
|
|
|
libnotmuch_cxx_srcs = \
|
|
|
|
$(dir)/database.cc \
|
lib: add date range query support
Add a custom value range processor to enable date and time searches of
the form date:since..until, where "since" and "until" are expressions
understood by the previously added date/time parser, to restrict the
results to messages within a particular time range (based on the Date:
header).
If "since" or "until" describes date/time at an accuracy of days or
less, the values are rounded according to the accuracy, towards past
for "since" and towards future for "until". For example,
date:november..yesterday would match from the beginning of November
until the end of yesterday. Expressions such as date:today..today
means since the beginning of today until the end of today.
Open-ended ranges are supported (since Xapian 1.2.1), i.e. you can
specify date:..until or date:since.. to not limit the start or end
date, respectively.
CAVEATS:
Xapian does not support spaces in range expressions. You can replace
the spaces with '_', or (in most cases) '-', or (in some cases) leave
the spaces out altogether.
Entering date:expr without ".." (for example date:yesterday) will not
work as you might expect. You can achieve the expected result by
duplicating the expr both sides of ".." (for example
date:yesterday..yesterday).
Open-ended ranges won't work with pre-1.2.1 Xapian, but they don't
produce an error either.
Signed-off-by: Jani Nikula <jani@nikula.org>
2012-10-30 21:32:37 +01:00
|
|
|
$(dir)/parse-time-vrp.cc \
|
2010-01-05 22:29:23 +01:00
|
|
|
$(dir)/directory.cc \
|
2009-11-10 17:04:54 +01:00
|
|
|
$(dir)/index.cc \
|
|
|
|
$(dir)/message.cc \
|
|
|
|
$(dir)/query.cc \
|
|
|
|
$(dir)/thread.cc
|
|
|
|
|
2011-06-22 02:25:06 +02:00
|
|
|
libnotmuch_modules := $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
|
2010-03-12 14:47:35 +01:00
|
|
|
|
2010-04-02 00:03:40 +02:00
|
|
|
$(dir)/libnotmuch.a: $(libnotmuch_modules)
|
|
|
|
$(call quiet,AR) rcs $@ $^
|
|
|
|
|
2013-01-21 20:41:15 +01:00
|
|
|
$(dir)/$(LIBNAME): $(libnotmuch_modules) notmuch.sym util/libutil.a parse-time-string/libparse-time-string.a
|
2012-10-30 21:32:36 +01:00
|
|
|
$(call quiet,CXX $(CXXFLAGS)) $(libnotmuch_modules) $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@ util/libutil.a parse-time-string/libparse-time-string.a
|
2011-06-22 02:25:06 +02:00
|
|
|
|
2011-10-23 16:44:01 +02:00
|
|
|
notmuch.sym: $(srcdir)/$(dir)/notmuch.h $(libnotmuch_modules)
|
|
|
|
sh $(srcdir)/$(lib)/gen-version-script.sh $< $(libnotmuch_modules) > $@
|
2010-03-12 14:47:35 +01:00
|
|
|
|
2010-04-01 09:41:25 +02:00
|
|
|
$(dir)/$(SONAME): $(dir)/$(LIBNAME)
|
2010-04-06 19:00:30 +02:00
|
|
|
ln -sf $(LIBNAME) $@
|
2010-04-01 09:41:25 +02:00
|
|
|
|
|
|
|
$(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
|
2010-04-06 19:00:30 +02:00
|
|
|
ln -sf $(LIBNAME) $@
|
2009-11-10 16:14:49 +01:00
|
|
|
|
2010-04-01 07:47:12 +02:00
|
|
|
install: install-$(dir)
|
|
|
|
|
2011-03-10 00:02:42 +01:00
|
|
|
install-$(dir): $(dir)/$(LIBNAME)
|
2011-01-26 14:29:15 +01:00
|
|
|
mkdir -p "$(DESTDIR)$(libdir)/"
|
|
|
|
install -m0644 "$(lib)/$(LIBNAME)" "$(DESTDIR)$(libdir)/"
|
|
|
|
ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(SONAME)"
|
|
|
|
ln -sf $(LIBNAME) "$(DESTDIR)$(libdir)/$(LINKER_NAME)"
|
|
|
|
mkdir -p "$(DESTDIR)$(includedir)"
|
2011-03-10 00:02:42 +01:00
|
|
|
install -m0644 "$(srcdir)/$(lib)/notmuch.h" "$(DESTDIR)$(includedir)/"
|
2010-06-05 01:52:56 +02:00
|
|
|
$(LIBRARY_INSTALL_POST_COMMAND)
|
2010-04-01 07:47:12 +02:00
|
|
|
|
2009-11-10 17:04:54 +01:00
|
|
|
SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
|
2011-06-25 14:45:58 +02:00
|
|
|
CLEAN += $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME)
|
2011-06-27 03:08:52 +02:00
|
|
|
CLEAN += $(dir)/$(LIBNAME) $(dir)/libnotmuch.a notmuch.sym
|
2011-06-25 14:45:58 +02:00
|
|
|
CLEAN += $(dir)/notmuch.h.gch
|