X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile;h=f3697861e75d540f20954a46589284a3db10e278;hp=91ab9c02cd623f583e03b5b241858f4b0fb40f43;hb=784e55d0f990350d0be8e54892f0eb3afe087fc5;hpb=c5dccd851a8b79d8cedbfc8f2d2b8f9be2b7fa5a diff --git a/Makefile b/Makefile index 91ab9c02..f3697861 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,14 @@ -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` - -NOTMUCH_CFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_DEPENDS_FLAGS) -NOTMUCH_CXXFLAGS=$(WARN_FLAGS) -O0 -g $(NOTMUCH_CXX_DEPENDS_FLAGS) - -NOTMUCH_LDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` \ - `xapian-config --libs` - -# 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) +# List all subdirectories here. Each contains its own Makefile.local +subdirs = compat emacs lib +# We make all targets depend on the Makefiles themselves. +global_deps = Makefile Makefile.local \ + $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) +# Finally, include all of the Makefile.local fragments where all the +# real work is done. +include Makefile.local $(subdirs:%=%/Makefile.local)