X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile;h=076efc79b9532c3e1b80a8ef5b9687456a2fe895;hp=894874ae6f2d3502a5f7eaaf3424e3511e83ba05;hb=a48f3687785b2c138b2c47848bd05512fc893a0b;hpb=c7482b4dce114b1c09cbac2f4ef6d0defdb23258 diff --git a/Makefile b/Makefile index 894874ae..076efc79 100644 --- a/Makefile +++ b/Makefile @@ -1,41 +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: -CXXWARNINGS_FLAGS=-Wall -Wextra -Wmissing-declarations -Wwrite-strings -CWARNINGS_FLAGS=$(CXXWARNINGS_FLAGS) +# List all subdirectories here. Each contains its own Makefile.local +subdirs = compat completion emacs lib -CDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` -CXXDEPENDS_FLAGS=`pkg-config --cflags glib-2.0 talloc` `xapian-config --cxxflags` +# We make all targets depend on the Makefiles themselves. +global_deps = Makefile Makefile.local \ + $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) -MYCFLAGS=$(CWARNINGS_FLAGS) -O0 -g $(CDEPENDS_FLAGS) -MYCXXFLAGS=$(CXXWARNINGS_FLAGS) -O0 -g $(CXXDEPENDS_FLAGS) - -MYLDFLAGS=`pkg-config --libs glib-2.0 talloc` `xapian-config --libs` - -MODULES= \ - notmuch.o \ - database.o \ - date.o \ - message.o \ - message-file.o \ - query.o \ - sha1.o \ - libsha1.o \ - xutil.o - -all: $(PROGS) - -%.o: %.cc - $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@ - -%.o: %.c - $(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@ - -notmuch: $(MODULES) - $(CC) $(MYLDFLAGS) $^ -o $@ - -Makefile.dep: *.c *.cc - $(CC) -M $(CPPFLAGS) $(CDEPENDS_FLAGS) $^ > $@ --include Makefile.dep - -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)