]> git.notmuchmail.org Git - notmuch/blob - lib/Makefile.local
emacs: Move notmuch-show functionality to notmuch-show.el
[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 LIBNOTMUCH_VERSION_MAJOR = 1
8
9 # The minor version of the library interface. This should be incremented at
10 # the time of release for any additions to the library interface.
11 LIBNOTMUCH_VERSION_MINOR = 0
12
13 # The release version the library interface. This should be incremented at
14 # the time of release if there have been no changes to the interface, (but
15 # simply compatible changes to the implementation).
16 LIBNOTMUCH_VERSION_RELEASE = 0
17
18 LINKER_NAME = libnotmuch.so
19 SONAME = $(LINKER_NAME).$(LIBNOTMUCH_VERSION_MAJOR)
20 LIBNAME = $(SONAME).$(LIBNOTMUCH_VERSION_MINOR).$(LIBNOTMUCH_VERSION_RELEASE)
21
22 dir := lib
23 extra_cflags += -I$(dir) -fPIC
24
25 libnotmuch_c_srcs =             \
26         $(dir)/libsha1.c        \
27         $(dir)/message-file.c   \
28         $(dir)/messages.c       \
29         $(dir)/sha1.c           \
30         $(dir)/tags.c           \
31         $(dir)/xutil.c
32
33 libnotmuch_cxx_srcs =           \
34         $(dir)/database.cc      \
35         $(dir)/directory.cc     \
36         $(dir)/index.cc         \
37         $(dir)/message.cc       \
38         $(dir)/query.cc         \
39         $(dir)/thread.cc
40
41 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
42
43 $(dir)/libnotmuch.a: $(libnotmuch_modules)
44         $(call quiet,AR) rcs $@ $^
45
46 $(dir)/$(LIBNAME): $(libnotmuch_modules)
47         $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
48
49 $(dir)/$(SONAME): $(dir)/$(LIBNAME)
50         $(call quiet_symlink, $(LIBNAME) $@)
51
52 $(dir)/$(LINKER_NAME): $(dir)/$(SONAME)
53         $(call quiet_symlink, $(LIBNAME) $@)
54
55 install: install-$(dir)
56
57 install-$(dir):
58         $(call quiet_mkdir, $(DESTDIR)$(libdir)/)
59         $(call quiet_install_data, $(dir)/$(LIBNAME) $(DESTDIR)$(libdir)/)
60         $(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(SONAME))
61         $(call quiet_symlink, $(LIBNAME) $(DESTDIR)$(libdir)/$(LINKER_NAME))
62         $(call quiet_mkdir, $(DESTDIR)$(prefix)/include/)
63         $(call quiet_install_data, $(dir)/notmuch.h $(DESTDIR)$(prefix)/include/)
64
65 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
66 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/$(LINKER_NAME) $(dir)$(LIBNAME) libnotmuch.a