]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile.local
configure: Fix installation of library to work with alternate --prefix
[notmuch] / Makefile.local
index 6d29790b8c443b4aa71c848116ac49bce7f2cf90..e1393953115e579ad8b683242d6f089cdf0ff74a 100644 (file)
@@ -20,19 +20,24 @@ notmuch_client_srcs =               \
        json.c
 
 notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
-notmuch: $(notmuch_client_modules) lib/notmuch.a
-       $(call quiet,CXX,$(LDFLAGS)) $^ $(FINAL_LDFLAGS) -o $@
+notmuch: $(notmuch_client_modules) lib/libnotmuch.so
+       $(call quiet,CC,$(LDFLAGS)) -Llib -lnotmuch $(filter-out lib/libnotmuch.so,$^) $(FINAL_LDFLAGS) -o $@
 
 notmuch.1.gz: notmuch.1
        $(call quiet,gzip) --stdout $^ > $@
 
 install: all notmuch.1.gz
-       for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 ; \
+       for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(libdir)/ \
+               $(DESTDIR)$(prefix)/include/ $(DESTDIR)$(prefix)/share/man/man1 ; \
        do \
                install -d $$d ; \
        done ;
        install notmuch $(DESTDIR)$(prefix)/bin/
+       install lib/$(SONAME) $(DESTDIR)$(libdir)/
+       install lib/notmuch.h $(DESTDIR)$(prefix)/include/
+       ln -sf $(SONAME) $(DESTDIR)$(libdir)/libnotmuch.so
        install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
+ifeq ($(MAKECMDGOALS), install)
        @echo ""
        @echo "Notmuch is now installed."
        @echo ""
@@ -42,6 +47,8 @@ install: all notmuch.1.gz
        @echo " make install-emacs"
        @echo " make install-bash"
        @echo " make install-zsh"
+       @echo ""
+endif
 
 install-desktop:
        install -d $(DESTDIR)$(desktop_dir)