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 LIBNOTMUCH_VERSION_MINOR = 1
20 # The release version the library interface. This should be incremented at
21 # the time of release if there have been no changes to the interface, (but
22 # simply compatible changes to the implementation).
23 LIBNOTMUCH_VERSION_RELEASE = 0
25 ifeq ($(PLATFORM),MACOSX)
26 LIBRARY_SUFFIX = dylib
27 # On OS X, library version numbers go before suffix.
28 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
29 SONAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBRARY_SUFFIX)
30 LIBNAME = libnotmuch.$(LIBNOTMUCH_VERSION_MAJOR).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE).$(LIBRARY_SUFFIX)
31 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)
34 LINKER_NAME = libnotmuch.$(LIBRARY_SUFFIX)
35 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
36 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
37 LIBRARY_LINK_FLAG = -shared -Wl,-soname=$(SONAME)
38 ifeq ($(LIBDIR_IN_LDCONFIG),1)
39 LIBRARY_INSTALL_POST_COMMAND=ldconfig
44 extra_cflags += -I$(dir) -fPIC
47 $(notmuch_compat_srcs) \
49 $(dir)/message-file.c \
55 libnotmuch_cxx_srcs = \
63 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
65 $(dir)/libnotmuch.a: $(libnotmuch_modules)
66 $(call quiet,AR) rcs $@ $^
68 $(dir)/$(LIBNAME): $(libnotmuch_modules)
69 $(call quiet,CXX $(CXXFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) $(LIBRARY_LINK_FLAG) -o $@
71 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
74 $(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
77 install: install-$(dir)
79 # The (often-reused) $dir works fine within targets/pre-requisites,
80 # but cannot be used reliably within commands, so copy its value to a
81 # variable that is not reused.
84 mkdir -p $(DESTDIR)$(libdir)/
85 install -m0644 $(lib)/$(LIBNAME) $(DESTDIR)$(libdir)/
86 ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME)
87 ln -sf $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME)
88 mkdir -p $(DESTDIR)$(includedir)
89 install -m0644 $(lib)/notmuch.h $(DESTDIR)$(includedir)/
90 $(LIBRARY_INSTALL_POST_COMMAND)
92 SRCS := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
93 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a