]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile.local
Avoid needlessly linking final notmuch binary against libXapian.
[notmuch] / Makefile.local
index 16b0103b8599f7fdedd2ca8a42fdcdd60b4e0251..b38370cc278aa256aafd67000c2cd2f0cf369bb5 100644 (file)
@@ -41,7 +41,8 @@ extra_cxxflags :=
 # Smash together user's values with our extra values
 FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CFLAGS) $(WARN_CFLAGS) $(CONFIGURE_CFLAGS) $(extra_cflags)
 FINAL_CXXFLAGS = $(CXXFLAGS) $(WARN_CXXFLAGS) $(CONFIGURE_CXXFLAGS) $(extra_cflags) $(extra_cxxflags)
-FINAL_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
+FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Llib -lnotmuch
+FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(CONFIGURE_LDFLAGS)
 
 .PHONY: all
 all: notmuch notmuch-shared notmuch.1.gz
@@ -138,6 +139,11 @@ DEPS := $(DEPS:%.cc=.deps/%.d)
 clean:
        rm -f $(CLEAN); rm -rf .deps
 
+# We don't (yet) have any distributed files not in the upstream repository.
+# So distclean is currently identical to clean.
+.PHONY: distclean
+distclean: clean
+
 notmuch_client_srcs =          \
        $(notmuch_compat_srcs)  \
        debugger.c              \
@@ -162,18 +168,18 @@ notmuch_client_srcs =             \
 notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
 
 notmuch: $(notmuch_client_modules) lib/libnotmuch.a
-       $(call quiet,CC $(CFLAGS)) $^ $(FINAL_LDFLAGS) -o $@
+       $(call quiet,CC $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@
 
 notmuch-shared: $(notmuch_client_modules) lib/libnotmuch.so
-       $(call quiet,CC $(CFLAGS)) -Llib -lnotmuch $(notmuch_client_modules) $(FINAL_LDFLAGS) -o $@
+       $(call quiet,CC $(CFLAGS)) $(notmuch_client_modules) $(FINAL_NOTMUCH_LDFLAGS) -o $@
 
 notmuch.1.gz: notmuch.1
        gzip --stdout $^ > $@
 
 .PHONY: install
 install: all notmuch.1.gz
-       mkdir -p $(DESTDIR)$(prefix)/share/man/man1
-       install -m0644 notmuch.1.gz $(DESTDIR)$(prefix)/share/man/man1/
+       mkdir -p $(DESTDIR)$(mandir)/man1
+       install -m0644 notmuch.1.gz $(DESTDIR)$(mandir)/man1/
        mkdir -p $(DESTDIR)$(prefix)/bin/
        install notmuch-shared $(DESTDIR)$(prefix)/bin/notmuch
 ifeq ($(MAKECMDGOALS), install)