]> git.notmuchmail.org Git - notmuch/blob - lib/Makefile.local
Move installation of library from top-level to lib/Makefile.local
[notmuch] / lib / Makefile.local
1 SONAME = libnotmuch.so.1
2
3 dir := lib
4 extra_cflags += -I$(dir) -fPIC
5
6 libnotmuch_c_srcs =             \
7         $(dir)/libsha1.c        \
8         $(dir)/message-file.c   \
9         $(dir)/messages.c       \
10         $(dir)/sha1.c           \
11         $(dir)/tags.c           \
12         $(dir)/xutil.c
13
14 libnotmuch_cxx_srcs =           \
15         $(dir)/database.cc      \
16         $(dir)/directory.cc     \
17         $(dir)/index.cc         \
18         $(dir)/message.cc       \
19         $(dir)/query.cc         \
20         $(dir)/thread.cc
21
22 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
23
24 $(dir)/$(SONAME) : $(libnotmuch_modules)
25         $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
26
27 $(dir)/libnotmuch.so: $(dir)/$(SONAME)
28         ln -fs $(SONAME) $@
29
30 install: install-$(dir)
31
32 install-$(dir):
33         install -d $(DESTDIR)$(libdir)/
34         install $(dir)/$(SONAME) $(DESTDIR)$(libdir)/
35         install $(dir)/notmuch.h $(DESTDIR)$(prefix)/include/
36         ln -sf $(SONAME) $(DESTDIR)$(libdir)/libnotmuch.so
37
38 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
39 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/libnotmuch.so *.so