]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
Merge branch 'debian' into rebuild
[notmuch] / Makefile
index 91ab9c02cd623f583e03b5b241858f4b0fb40f43..076efc79b9532c3e1b80a8ef5b9687456a2fe895 100644 (file)
--- 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 completion 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)