Makefile: Add automatic dependency tracking to the Makefile.

With this, I really don't miss anything from automake.
This commit is contained in:
Carl Worth 2009-10-20 15:08:03 -07:00
parent 28fa0bc2d6
commit 00af443b8e

View file

@ -8,13 +8,17 @@ MYLDFLAGS=`pkg-config --libs glib-2.0` `xapian-config --libs`
all: $(PROGS)
%.o: %.cc
$(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $^ -o $@
$(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
%.o: %.c
$(CC) -c $(CFLAGS) $(MYCFLAGS) $^ -o $@
$(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
notmuch: notmuch.o database.o date.o message.o xutil.o
$(CC) $(MYLDFLAGS) $^ -o $@
Makefile.dep: *.c *.cc
$(CC) -M $(CPPFLAGS) $(MYCFLAGS) $^ > $@
-include Makefile.dep
clean:
rm -f $(PROGS) *.o
rm -f $(PROGS) *.o Makefile.dep