blktrace: don't stop tracer if not setup trace successfully
[blktrace.git] / Makefile
index fda76f4ca3a2f28fd471dea202db6e9263e770af..5917814d03440ef2abbb9a144312444cbbda932b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,40 @@
 CC     = gcc
 CFLAGS = -Wall -O2 -g -W
 ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-PROGS  = blkparse blktrace verify_blkparse blkrawverify
+PROGS  = blkparse blktrace verify_blkparse blkrawverify blkiomon
 LIBS   = -lpthread
 SCRIPTS        = btrace
+SUBDIRS = btreplay btt iowatcher
 
-ALL = $(PROGS) $(SCRIPTS) btt/btt btreplay/btrecord btreplay/btreplay
+ALL = $(PROGS) $(SCRIPTS)
+INSTALL_ALL = $(ALL) btt/btt btreplay/btrecord btreplay/btreplay \
+      btt/bno_plot.py iowatcher/iowatcher
 
-all: $(ALL)
+all: $(ALL) $(SUBDIRS)
 
-btt/btt:
-       $(MAKE) -C btt
-
-btreplay/btrecord:
-       $(MAKE) -C btreplay
-
-btreplay/btreplay:
-       $(MAKE) -C btreplay
+# We always descend into subdirs because they contain their own dependency
+# information which we don't track in this top level Makefile.
+$(SUBDIRS):
+       $(MAKE) -C $@
+.PHONY: $(SUBDIRS)
 
 %.o: %.c
        $(CC) -o $*.o -c $(ALL_CFLAGS) $<
 
 blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
-       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^)
 
-blktrace: blktrace.o act_mask.o $(LIBS)
-       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+blktrace: blktrace.o act_mask.o
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
 
 verify_blkparse: verify_blkparse.o
-       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^)
 
 blkrawverify: blkrawverify.o
-       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^)
+
+blkiomon: blkiomon.o rbtree.o
+       $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
 
 $(PROGS): | depend
 
@@ -72,12 +75,13 @@ clean: docsclean
        -rm -f *.o $(PROGS) .depend btrace-1.0.tar.bz2
        $(MAKE) -C btt clean
        $(MAKE) -C btreplay clean
+       $(MAKE) -C iowatcher clean
 
 install: all
        $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
        $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
        $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
-       $(INSTALL) -m 755 $(ALL) $(DESTDIR)$(bindir)
+       $(INSTALL) -m 755 $(INSTALL_ALL) $(DESTDIR)$(bindir)
        $(INSTALL) -m 644 doc/*.1 $(DESTDIR)$(mandir)/man1
        $(INSTALL) -m 644 doc/*.8 $(DESTDIR)$(mandir)/man8