blob: ce63cfc896d5e4dab3e027d8058879fb16d06a2a [file] [log] [blame]
Jens Axboe12cbb462007-12-10 20:24:44 +01001CC = gcc
Jens Axboe79e48f72008-02-01 20:37:09 +01002DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
Davide Libenzi4cf6b5d2007-03-22 07:42:57 +01003OPTFLAGS= -O2 -g $(EXTFLAGS)
Jens Axboe46e9e962008-11-20 09:13:23 +01004CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -fno-omit-frame-pointer -rdynamic
Jens Axboeebac4652005-12-08 15:25:21 +01005PROGS = fio
6SCRIPTS = fio_generate_plots
Jens Axboeeef6eea2007-07-30 12:27:58 +02007OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \
Jens Axboeff2e2232008-06-13 08:38:35 +02008 eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \
Jens Axboea696fa22009-12-04 10:05:02 +01009 rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o helpers.o \
10 cgroup.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020011
12OBJS += crc/crc7.o
13OBJS += crc/crc16.o
14OBJS += crc/crc32.o
Jens Axboebac39e02008-06-11 20:46:19 +020015OBJS += crc/crc32c.o
Jens Axboe38455912008-08-04 15:35:26 +020016OBJS += crc/crc32c-intel.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020017OBJS += crc/crc64.o
Jens Axboe7c353ce2009-08-09 22:40:33 +020018OBJS += crc/sha1.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020019OBJS += crc/sha256.o
20OBJS += crc/sha512.o
21OBJS += crc/md5.o
Jens Axboeebac4652005-12-08 15:25:21 +010022
Jens Axboef8fe35e2007-02-06 13:29:55 +010023OBJS += engines/cpu.o
24OBJS += engines/libaio.o
25OBJS += engines/mmap.o
26OBJS += engines/posixaio.o
27OBJS += engines/sg.o
28OBJS += engines/splice.o
29OBJS += engines/sync.o
30OBJS += engines/null.o
Jens Axboeed92ac02007-02-06 14:43:52 +010031OBJS += engines/net.o
Jens Axboea4f4fdd2007-02-14 01:16:39 +010032OBJS += engines/syslet-rw.o
Davide Libenzi609342f2007-03-21 08:46:18 +010033OBJS += engines/guasi.o
Jens Axboe5f350952006-11-07 15:20:59 +010034
Jens Axboe4c3ecec2008-03-01 16:20:13 +010035ifneq ($(findstring $(MAKEFLAGS),s),s)
36ifndef V
37 QUIET_CC = @echo ' ' CC $@;
Jens Axboe0b2d6a72008-03-03 12:20:26 +010038 QUIET_DEP = @echo ' ' DEP $@;
Jens Axboe4c3ecec2008-03-01 16:20:13 +010039endif
40endif
41
Jens Axboec1d57252006-10-09 19:56:04 +020042INSTALL = install
43prefix = /usr/local
44bindir = $(prefix)/bin
Aaron Carrolld60e92d2007-09-17 10:32:59 +020045mandir = $(prefix)/man
Jens Axboec1d57252006-10-09 19:56:04 +020046
Jens Axboe4c3ecec2008-03-01 16:20:13 +010047%.o: %.c
48 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
Jens Axboe2f9ade32006-10-20 11:25:52 +020049fio: $(OBJS)
Jens Axboe4c3ecec2008-03-01 16:20:13 +010050 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
51
Jens Axboe0b2d6a72008-03-03 12:20:26 +010052depend:
Jens Axboe091708d2008-06-11 13:18:30 +020053 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.c 1> .depend
Jens Axboe0b2d6a72008-03-03 12:20:26 +010054
Jens Axboe06fecb42008-03-03 12:22:19 +010055$(PROGS): depend
56
57all: depend $(PROGS) $(SCRIPTS)
Jens Axboeebac4652005-12-08 15:25:21 +010058
59clean:
Jens Axboe6492b1e2008-06-02 15:57:45 +020060 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
Jens Axboeebac4652005-12-08 15:25:21 +010061
Jens Axboe592ef982006-06-06 20:58:57 +020062cscope:
63 @cscope -b
64
Jens Axboeebac4652005-12-08 15:25:21 +010065install: $(PROGS) $(SCRIPTS)
66 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
67 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +020068 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
69 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Jens Axboeccd4f412009-05-20 11:36:39 +020070 $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
Jens Axboeebac4652005-12-08 15:25:21 +010071
Jens Axboe06fecb42008-03-03 12:22:19 +010072ifneq ($(wildcard .depend),)
73include .depend
74endif