X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile;h=f9f7af03bcac8ecb874395c3aa94eb708633b183;hp=9e44d90a3a35134cd7beb6d92b775fe0f77fb2e4;hb=49132ebc765f355b97671ef253c13d7af9f037a2;hpb=1ddba66a3f4a7a118bc774d16cde00739144afcf diff --git a/Makefile b/Makefile index 9e44d90a..f9f7af03 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,13 @@ 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/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) @@ -24,22 +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 $@ %.elc: %.el emacs -batch -f batch-byte-compile $< -.deps/%.d: %.c +.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' < $@.$$$$ > $@; \