X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=Makefile;h=faaaec6419b9ae7ec4d96b1b0d28ceac00739446;hb=c10085c77b407d9ea704f8b4f9e0a805f63e72cb;hp=91ab9c02cd623f583e03b5b241858f4b0fb40f43;hpb=c5dccd851a8b79d8cedbfc8f2d2b8f9be2b7fa5a;p=notmuch diff --git a/Makefile b/Makefile index 91ab9c02..faaaec64 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,21 @@ -WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum +# We want the all target to be the implicit target (if no target is +# given explicitly on the command line) so mention it first. +all: -NOTMUCH_DEPENDS_FLAGS=-I./lib `pkg-config --cflags glib-2.0 gmime-2.4 talloc` -NOTMUCH_CXX_DEPENDS_FLAGS=$(NOTMUCH_DEPENDS_FLAGS) `xapian-config --cxxflags` +# List all subdirectories here. Each contains its own Makefile.local +subdirs = compat completion emacs lib -NOTMUCH_CFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_DEPENDS_FLAGS) -NOTMUCH_CXXFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_CXX_DEPENDS_FLAGS) +# We make all targets depend on the Makefiles themselves. +global_deps = Makefile Makefile.local \ + $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) -NOTMUCH_LDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` \ - `xapian-config --libs` +# Sub-directory Makefile.local fragments can append to these variables +# to have directory-specific cflags as necessary. -# Include our local Makfile.local first so that its first target is default -include Makefile.local -include lib/Makefile.local - -%.o: %.cc - $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(NOTMUCH_CXXFLAGS) $< -o $@ - -%.o: %.c - $(CC) -c $(CFLAGS) $(NOTMUCH_CFLAGS) $< -o $@ - -.depends: $(SRCS) - $(CXX) -M $(CPPFLAGS) $(NOTMUCH_DEPENDS_FLAGS) \ - $(NOTMUCH_CXX_DEPENDS_FLAGS) $^ > $@ --include .depends - -CLEAN := $(CLEAN) .depends - -clean: - rm -f $(CLEAN) +extra_cflags := +extra_cxxflags := +# Finally, include all of the Makefile.local fragments where all the +# real work is done. +include $(subdirs:%=%/Makefile.local) Makefile.local