summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile16
-rw-r--r--blkparse.c2
-rw-r--r--blktrace.c2
-rw-r--r--btrace.spec7
4 files changed, 17 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index e265605..4e63591 100644
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,23 @@
CC = gcc
-CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CFLAGS = -Wall -O2 -g
+ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
PROGS = blkparse blktrace verify_blkparse
LIBS = -lpthread
SCRIPTS = btrace
all: depend $(PROGS) $(SCRIPTS)
+%.o: %.c
+ $(CC) -o $*.o -c $(ALL_CFLAGS) $<
+
blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
blktrace: blktrace.o act_mask.o $(LIBS)
- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
verify_blkparse: verify_blkparse.o
- $(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
+ $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
docs:
$(MAKE) -C doc all
@@ -22,7 +26,7 @@ docsclean:
$(MAKE) -C doc clean
depend:
- @$(CC) -MM $(CFLAGS) *.c 1> .depend
+ @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
clean: docsclean
-rm -f *.o $(PROGS) .depend
@@ -31,6 +35,8 @@ INSTALL = install
prefix = /usr/local
bindir = $(prefix)/bin
+export prefix INSTALL
+
install: $(PROGS) $(SCRIPTS)
$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
$(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
diff --git a/blkparse.c b/blkparse.c
index 1b5ab4e..ebe0f5d 100644
--- a/blkparse.c
+++ b/blkparse.c
@@ -35,7 +35,7 @@
#include "rbtree.h"
#include "jhash.h"
-static char blkparse_version[] = "0.90";
+static char blkparse_version[] = "0.99";
struct per_dev_info {
dev_t dev;
diff --git a/blktrace.c b/blktrace.c
index 6d5d953..0d5c844 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -37,7 +37,7 @@
#include "blktrace.h"
-static char blktrace_version[] = "0.90";
+static char blktrace_version[] = "0.99";
#define BUF_SIZE (128 *1024)
#define BUF_NR (4)
diff --git a/btrace.spec b/btrace.spec
index b74d07a..6198702 100644
--- a/btrace.spec
+++ b/btrace.spec
@@ -35,10 +35,11 @@ Authors:
%setup -q
%build
-make all docs
+make CFLAGS="$RPM_OPT_FLAGS" all docs
%install
-make DESTDIR=$RPM_BUILD_ROOT install
+rm -rf $RPM_BUILD_ROOT
+make dest=$RPM_BUILD_ROOT prefix=$RPM_BUILD_ROOT/%{_prefix} install
%clean
rm -rf $RPM_BUILD_ROOT
@@ -46,7 +47,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README doc/blktrace.pdf
-/usr/local/bin/*
+/usr/bin/*
%changelog -n btrace
* Mon Oct 10 2005 - axboe@suse.de