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