]> git.notmuchmail.org Git - notmuch/blobdiff - lib/Makefile.local
Move installation of library from top-level to lib/Makefile.local
[notmuch] / lib / Makefile.local
index f8489468eea069691eb372955f8445860a3bb78e..b24a35710490e08a7db6d2ab325023a39c74a825 100644 (file)
@@ -1,3 +1,5 @@
+SONAME = libnotmuch.so.1
+
 dir := lib
 extra_cflags += -I$(dir) -fPIC
 
@@ -18,9 +20,20 @@ libnotmuch_cxx_srcs =                \
        $(dir)/thread.cc
 
 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
-$(dir)/libnotmuch.so : $(libnotmuch_modules)
+
+$(dir)/$(SONAME) : $(libnotmuch_modules)
        $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -shared -Wl,-soname=$(SONAME) -o $@
-       ln -sf $(SONAME) $@
+
+$(dir)/libnotmuch.so: $(dir)/$(SONAME)
+       ln -fs $(SONAME) $@
+
+install: install-$(dir)
+
+install-$(dir):
+       install -d $(DESTDIR)$(libdir)/
+       install $(dir)/$(SONAME) $(DESTDIR)$(libdir)/
+       install $(dir)/notmuch.h $(DESTDIR)$(prefix)/include/
+       ln -sf $(SONAME) $(DESTDIR)$(libdir)/libnotmuch.so
 
 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
-CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/libnotmuch.so *.so
+CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/$(SONAME) $(dir)/libnotmuch.so *.so