3 # The major version of the library interface. This will control the soname.
4 # As such, this number must be incremented for any incompatible change to
5 # the library interface, (such as the deletion of an API or a major
6 # semantic change that breaks formerly functioning code).
8 # Note: We don't currently have plans to increment this at this time.
9 # If we *do* want to make an incompatible change to the library
10 # interface, we'll have to decide whether to increment this (creating
11 # a new soname) or to introduce symbol versioning to be able to
12 # provide support for both old and new interfaces without having to
14 LIBNOTMUCH_VERSION_MAJOR = 1
16 # The minor version of the library interface. This should be incremented at
17 # the time of release for any additions to the library interface,
18 # (and when it is incremented, the release version of the library should
20 LIBNOTMUCH_VERSION_MINOR = 3
22 # The release version the library interface. This should be incremented at
23 # the time of release if there have been no changes to the interface, (but
24 # simply compatible changes to the implementation).
25 LIBNOTMUCH_VERSION_RELEASE = 0
27 ifeq ($(PLATFORM),MACOSX)
28 LIBRARY_SUFFIX = dylib
29 # On OS X, library version numbers go before suffix.
30 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
31 SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
32 LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
33 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)
36 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
37 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
38 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
39 LIBRARY_LINK_FLAG = -shared -Wl,-soname=$(SONAME)
40 ifeq ($(LIBDIR_IN_LDCONFIG),1)
42 LIBRARY_INSTALL_POST_COMMAND=ldconfig
48 extra_cflags += -I$(dir) -fPIC
51 $(notmuch_compat_srcs) \
54 $(dir)/message-file.c \
60 libnotmuch_cxx_srcs = \
68 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
70 $(dir)/libnotmuch.a: $(libnotmuch_modules)
71 $(call quiet,AR) rcs $@ $^
73 $(dir)/$(LIBNAME): $(libnotmuch_modules)
74 $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
76 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
79 $(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
82 install: install-$(dir)
84 # The (often-reused) $dir works fine within targets/pre-requisites,
85 # but cannot be used reliably within commands, so copy its value to a
86 # variable that is not reused.
89 mkdir -p $(DESTDIR)$(libdir)/
90 install -m0644 $(lib)/$(LIBNAME) $(DESTDIR)$(libdir)/
91 ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME)
92 ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME)
93 mkdir -p $(DESTDIR)$(includedir)
94 install -m0644 $(lib)/notmuch.h $(DESTDIR)$(includedir)/
95 $(LIBRARY_INSTALL_POST_COMMAND)
97 SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
98 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a