Merge branch 'master' of ssh://axboe@router.home.kernel.dk/data/git/blktrace
[blktrace.git] / Makefile
index 1cd5a70d985f1a1092b61fdf626d8fff6b703567..623b84be766af04bf7c58ed8ab3d194e74dd2c64 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,20 +1,31 @@
 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
 
-all: $(PROGS) $(SCRIPTS)
+ALL = $(PROGS) $(SCRIPTS) btt/btt btreplay/btrecord btreplay/btreplay \
+      btt/bno_plot.py
+
+all: $(ALL)
+
+btt/btt:
        $(MAKE) -C btt
 
+btreplay/btrecord:
+       $(MAKE) -C btreplay
+
+btreplay/btreplay:
+       $(MAKE) -C btreplay
+
 %.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,$^)
 
-blktrace: blktrace.o act_mask.o $(LIBS)
+blktrace: blktrace.o act_mask.o
        $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
 
 verify_blkparse: verify_blkparse.o
@@ -23,15 +34,20 @@ verify_blkparse: verify_blkparse.o
 blkrawverify: blkrawverify.o
        $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
 
+blkiomon: blkiomon.o rbtree.o
+       $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
+
 $(PROGS): | depend
 
 docs:
        $(MAKE) -C doc all
        $(MAKE) -C btt docs
+       $(MAKE) -C btreplay docs
 
 docsclean:
        $(MAKE) -C doc clean
        $(MAKE) -C btt clean
+       $(MAKE) -C btreplay clean
 
 depend:
        @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
@@ -59,13 +75,15 @@ rpm: dist
 clean: docsclean
        -rm -f *.o $(PROGS) .depend btrace-1.0.tar.bz2
        $(MAKE) -C btt clean
-
-install: $(PROGS) $(SCRIPTS)
-       $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
-       $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
-       $(INSTALL) btt/btt $(DESTDIR)$(bindir)
-       $(INSTALL) doc/*.1 $(DESTDIR)$(mandir)/man1
-       $(INSTALL) doc/*.8 $(DESTDIR)$(mandir)/man8
+       $(MAKE) -C btreplay 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 644 doc/*.1 $(DESTDIR)$(mandir)/man1
+       $(INSTALL) -m 644 doc/*.8 $(DESTDIR)$(mandir)/man8
 
 ifneq ($(wildcard .depend),)
 include .depend