blob: 97a3ae50f9206c13479d34721c4b8764553621a5 [file] [log] [blame]
Jens Axboe2c0ecd22006-06-08 13:25:41 +02001CC = gcc
Bruce Cran9b836562011-01-08 19:49:54 +01002DEBUGFLAGS = -DFIO_INC_DEBUG
3CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
4 -D__EXTENSIONS__ $(DEBUGFLAGS)
Bruce Cranc2019d32011-01-10 19:34:20 +01005OPTFLAGS= -O2 -fno-omit-frame-pointer -g $(EXTFLAGS)
Bruce Cran9b836562011-01-08 19:49:54 +01006CFLAGS = -std=gnu99 -Wall $(OPTFLAGS)
7LIBS = -lpthread -lm -ldl -laio -lrt -lnsl -lsocket
Jens Axboe2c0ecd22006-06-08 13:25:41 +02008PROGS = fio
9SCRIPTS = fio_generate_plots
Jens Axboec11883f2006-11-23 15:11:53 +010010
Bruce Cran9b836562011-01-08 19:49:54 +010011SOURCE = 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
Jens Axboe1fbbf722010-03-25 23:03:18 +010017
Bruce Cran9b836562011-01-08 19:49:54 +010018OBJS = $(SOURCE:.c=.o)
Jens Axboea432da12007-07-30 12:29:37 +020019
Bruce Cran9b836562011-01-08 19:49:54 +010020ifneq ($(findstring $(MAKEFLAGS),s),s)
21ifndef V
22 QUIET_CC = @echo ' ' CC $@;
23 QUIET_DEP = @echo ' ' DEP $@;
24endif
25endif
Jens Axboe2c0ecd22006-06-08 13:25:41 +020026
Jens Axboe2c0ecd22006-06-08 13:25:41 +020027INSTALL = install
28prefix = /usr/local
29bindir = $(prefix)/bin
Jens Axboe5921e802008-05-30 15:02:38 +020030mandir = $(prefix)/man
31
Bruce Cran9b836562011-01-08 19:49:54 +010032.c.o:
33 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $<
34
Jens Axboe5921e802008-05-30 15:02:38 +020035fio: $(OBJS)
Bruce Cran9b836562011-01-08 19:49:54 +010036 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(LIBS) $(OBJS)
37
38depend:
39 $(QUIET_DEP)$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SOURCE) 1> .depend
Jens Axboe5921e802008-05-30 15:02:38 +020040
Bruce Cran9b836562011-01-08 19:49:54 +010041$(PROGS): depend
42
43all: depend $(PROGS) $(SCRIPTS)
Jens Axboe5921e802008-05-30 15:02:38 +020044
45clean:
Jens Axboe6492b1e2008-06-02 15:57:45 +020046 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
Jens Axboe5921e802008-05-30 15:02:38 +020047
48cscope:
49 @cscope -b
Jens Axboe2c0ecd22006-06-08 13:25:41 +020050
51install: $(PROGS) $(SCRIPTS)
52 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
53 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Sebastian Kayserd3624ff2010-11-24 13:27:03 +010054 $(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
Bruce Cran9b836562011-01-08 19:49:54 +010057
58ifneq ($(wildcard .depend),)
59include .depend
60endif