]> git.notmuchmail.org Git - notmuch/blob - lib/Makefile.local
RELEASING: Add this file describing the steps to make a release.
[notmuch] / lib / Makefile.local
1 # -*- makefile -*-
2
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).
7 #
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
13 # increment this.
14 LIBNOTMUCH_VERSION_MAJOR = 1
15
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 = 0
19
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
24
25 LINKER_NAME = libnotmuch.so
26 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
27 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
28
29 dir := lib
30 extra_cflags += -I$(dir) -fPIC
31
32 libnotmuch_c_srcs =             \
33         $(dir)/libsha1.c        \
34         $(dir)/message-file.c   \
35         $(dir)/messages.c       \
36         $(dir)/sha1.c           \
37         $(dir)/tags.c           \
38         $(dir)/xutil.c
39
40 libnotmuch_cxx_srcs =           \
41         $(dir)/database.cc      \
42         $(dir)/directory.cc     \
43         $(dir)/index.cc         \
44         $(dir)/message.cc       \
45         $(dir)/query.cc         \
46         $(dir)/thread.cc
47
48 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
49
50 $(dir)/libnotmuch.a: $(libnotmuch_modules)
51         $(call quiet,AR) rcs $@ $^
52
53 $(dir)/$(LIBNAME): $(libnotmuch_modules)
54         $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
55
56 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
57         $(call quiet_symlink, $(LIBNAME) $@)
58
59 $(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
60         $(call quiet_symlink, $(LIBNAME) $@)
61
62 install: install-$(dir)
63
64 install-$(dir):
65         $(call quiet_mkdir, $(DESTDIR)$(libdir)/)
66         $(call quiet_install_data, $(dir)/$(LIBNAME) $(DESTDIR)$(libdir)/)
67         $(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME))
68         $(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME))
69         $(call quiet_mkdir, $(DESTDIR)$(prefix)/include/)
70         $(call quiet_install_data, $(dir)/notmuch.h $(DESTDIR)$(prefix)/include/)
71
72 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
73 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a