Commit | Line | Data |
---|---|---|
2c0ecd28 | 1 | CC = gcc |
9b836561 BC |
2 | DEBUGFLAGS = -DFIO_INC_DEBUG |
3 | CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ | |
4 | -D__EXTENSIONS__ $(DEBUGFLAGS) | |
c2019d39 | 5 | OPTFLAGS= -O2 -fno-omit-frame-pointer -g $(EXTFLAGS) |
9b836561 BC |
6 | CFLAGS = -std=gnu99 -Wall $(OPTFLAGS) |
7 | LIBS = -lpthread -lm -ldl -laio -lrt -lnsl -lsocket | |
2c0ecd28 JA |
8 | PROGS = fio |
9 | SCRIPTS = fio_generate_plots | |
9b836561 BC |
10 | |
11 | SOURCE = gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \ | |
12 | eta.c verify.c memory.c io_u.c parse.c mutex.c options.c rbtree.c \ | |
13 | fifo.c smalloc.c filehash.c lib/strsep.c helpers.c solaris.c \ | |
14 | profile.c debug.c lib/rand.c lib/flist_sort.c lib/num2str.c \ | |
15 | $(wildcard crc/*.c) engines/cpu.c engines/mmap.c engines/posixaio.c \ | |
16 | engines/sync.c engines/null.c engines/net.c engines/solarisaio.c | |
17 | ||
18 | OBJS = $(SOURCE:.c=.o) | |
19 | ||
20 | ifneq ($(findstring $(MAKEFLAGS),s),s) | |
21 | ifndef V | |
22 | QUIET_CC = @echo ' ' CC $@; | |
23 | QUIET_DEP = @echo ' ' DEP $@; | |
24 | endif | |
25 | endif | |
2c0ecd28 | 26 | |
5921e80c JA |
27 | INSTALL = install |
28 | prefix = /usr/local | |
29 | bindir = $(prefix)/bin | |
30 | mandir = $(prefix)/man | |
31 | ||
9b836561 BC |
32 | .c.o: |
33 | $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $< | |
34 | ||
c11883f7 | 35 | fio: $(OBJS) |
9b836561 BC |
36 | $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(LIBS) $(OBJS) |
37 | ||
38 | depend: | |
39 | $(QUIET_DEP)$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SOURCE) 1> .depend | |
2c0ecd28 | 40 | |
9b836561 BC |
41 | $(PROGS): depend |
42 | ||
43 | all: depend $(PROGS) $(SCRIPTS) | |
2c0ecd28 | 44 | |
5921e80c | 45 | clean: |
6492b1e5 | 46 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
2c0ecd28 JA |
47 | |
48 | cscope: | |
49 | @cscope -b | |
50 | ||
2c0ecd28 JA |
51 | install: $(PROGS) $(SCRIPTS) |
52 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) | |
53 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) | |
d3624ff9 SK |
54 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
55 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 | |
56 | $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 | |
9b836561 BC |
57 | |
58 | ifneq ($(wildcard .depend),) | |
59 | include .depend | |
60 | endif |