X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=Makefile;h=f3697861e75d540f20954a46589284a3db10e278;hp=1737a32e61dee659c9568e657e7c33577f06166b;hb=bb5211684654b7cf54f842990a733a64fe01d612;hpb=526b7144f7d692e04ce950dfa7d0ee1bdf792cdc diff --git a/Makefile b/Makefile index 1737a32e..f3697861 100644 --- a/Makefile +++ b/Makefile @@ -1,35 +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 talloc` -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 talloc` `xapian-config --libs` +# We make all targets depend on the Makefiles themselves. +global_deps = Makefile Makefile.local \ + $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) -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) $(MYCFLAGS) $^ > $@ --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)