]> git.notmuchmail.org Git - notmuch/blobdiff - Makefile
Move bulk of rules from Makefile to Makefile.local.
[notmuch] / Makefile
index 7c15d6c1f0a5b7c88136bcdb7f6e1dc84cc2b44d..f3697861e75d540f20954a46589284a3db10e278 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,14 @@
-PROGS=notmuch
+# 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:
 
-MYCFLAGS=-Wall -O0 -g `pkg-config --cflags glib-2.0`
-MYCXXFLAGS=$(MYCFLAGS) `xapian-config --cxxflags`
+# List all subdirectories here. Each contains its own Makefile.local
+subdirs = compat emacs lib
 
-MYLDFLAGS=`pkg-config --libs glib-2.0` `xapian-config --libs`
+# We make all targets depend on the Makefiles themselves.
+global_deps = Makefile Makefile.local \
+       $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
 
-all: $(PROGS)
-
-%.o: %.cc
-       $(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $^ -o $@
-
-%.o: %.c
-       $(CC) -c $(CFLAGS) $(MYCFLAGS) $^ -o $@
-
-notmuch: notmuch.o database.o date.o message.o xutil.o
-       $(CC) $(MYLDFLAGS) $^ -o $@
-
-clean:
-       rm -f $(PROGS) *.o
+# Finally, include all of the Makefile.local fragments where all the
+# real work is done.
+include Makefile.local $(subdirs:%=%/Makefile.local)