1CC = gcc 2CFLAGS = -Wall -O2 -g -W -Wunused-result 3ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 4 5PROGS = iowatcher 6INSTALL = install 7prefix = /usr/local 8bindir = $(prefix)/bin 9 10export prefix INSTALL 11 12ALL = $(PROGS) 13 14$(PROGS): | depend 15 16all: $(ALL) 17 18%.o: %.c 19 $(CC) -o $*.o -c $(ALL_CFLAGS) $< 20 21iowatcher: blkparse.o plot.o main.o tracers.o mpstat.o fio.o 22 $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) -lm -lrt 23 24depend: 25 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend 26 27clean: 28 -rm -f *.o $(PROGS) .depend 29 30install: all 31 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) 32 $(INSTALL) -m 755 $(ALL) $(DESTDIR)$(bindir) 33 34ifneq ($(wildcard .depend),) 35include .depend 36endif 37 38