]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
INSTALL: Mention that xapian-config might be named xapian-config-1.1
[notmuch] / Makefile
index 023b2ec85fed32059dae867386a189573b5e0e66..3fedcf12e87c4cb26005d09953c36f90f2ed12e2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,15 @@ CFLAGS=-O2
 extra_cflags := $(shell pkg-config --cflags glib-2.0 gmime-2.4 talloc)
 extra_cxxflags := $(shell xapian-config --cxxflags)
 
+emacs_lispdir := $(shell pkg-config emacs --variable sitepkglispdir)
+# Hard-code if this system doesn't have an emacs.pc file
+ifeq ($(emacs_lispdir),)
+       emacs_lispdir = $(prefix)/share/emacs/site-lisp
+endif
+
+all_deps = Makefile Makefile.local Makefile.config \
+                  lib/Makefile lib/Makefile.local
+
 # Now smash together user's values with our extra values
 override CFLAGS += $(WARN_FLAGS) $(extra_cflags)
 override CXXFLAGS += $(WARN_FLAGS) $(extra_cflags) $(extra_cxxflags)
@@ -22,19 +31,22 @@ include lib/Makefile.local
 # And get user settings from the output of configure
 include Makefile.config
 
-%.o: %.cc
-       $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
+%.o: %.cc $(all_deps)
+       $(CXX) -c $(CXXFLAGS) $< -o $@
 
-%.o: %.c
+%.o: %.c $(all_deps)
        $(CC) -c $(CFLAGS) $< -o $@
 
-.deps/%.d: %.c
+%.elc: %.el
+       emacs -batch -f batch-byte-compile $<
+
+.deps/%.d: %.c $(all_deps)
        @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
        $(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
        sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
        rm -f $@.$$$$
 
-.deps/%.d: %.cc
+.deps/%.d: %.cc $(all_deps)
        @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
        $(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
        sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \