X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile;h=076efc79b9532c3e1b80a8ef5b9687456a2fe895;hp=fee4ffffc0ee6a579290832a24e168b91fa81fd7;hb=e2dd4ac00b9979de34bd517fa57de56260d38755;hpb=1a579dfe6b13d959900d8ccb9a86526234ce5669 diff --git a/Makefile b/Makefile index fee4ffff..076efc79 100644 --- a/Makefile +++ b/Makefile @@ -1,53 +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: -WARN_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -Wswitch-enum +# List all subdirectories here. Each contains its own Makefile.local +subdirs = compat completion emacs lib -CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 gmime-2.4 talloc` -CXXDEPENDS_FLAGS=$(CDEPENDS_FLAGS) `xapian-config --cxxflags` +# We make all targets depend on the Makefiles themselves. +global_deps = Makefile Makefile.local \ + $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) -MYCFLAGS=$(WARN_FLAGS) -O0 -g $(CDEPENDS_FLAGS) -MYCXXFLAGS=$(WARN_FLAGS) -O0 -g $(CXXDEPENDS_FLAGS) - -MYLDFLAGS=`pkg-config --libs glib-2.0 gmime-2.4 talloc` `xapian-config --libs` - -LIBRARY= \ - database.o \ - date.o \ - index.o \ - libsha1.o \ - message.o \ - message-file.o \ - query.o \ - sha1.o \ - tags.o \ - thread.o \ - xutil.o - -MAIN= \ - notmuch.o - -all: $(PROGS) - -%.o: %.cc - $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@ - -%.o: %.c - $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@ - -notmuch: $(MAIN) $(LIBRARY) - $(CC) $(MYLDFLAGS) $^ -o $@ - -Makefile.dep: *.c *.cc - $(CXX) -M $(CPPFLAGS) $(CDEPENDS_FLAGS) $(CXXDEPENDS_FLAGS) $^ > $@ --include Makefile.dep - -notmuch.1.gz: - gzip --stdout notmuch.1 > notmuch.1.gz - -install: notmuch.1.gz - install -C -D notmuch $(DESTDIR)/usr/bin/notmuch - install -C -D notmuch.1.gz $(DESTDIR)/usr/share/man/man1 - install -C -D notmuch-completion.bash $(DESTDIR)/etc/bash_completion.d/notmuch - -clean: - rm -f $(PROGS) *.o Makefile.dep +# Finally, include all of the Makefile.local fragments where all the +# real work is done. +include Makefile.local $(subdirs:%=%/Makefile.local)