blob: 978f8b27149111e90f9feed978f87dae1ec96d2f [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 \
Jens Axboebf84eac2010-03-19 16:41:52 +010010 cgroup.o profile.o debug.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020011
Jens Axboe1fbbf722010-03-25 23:03:18 +010012OBJS += lib/rand.o
Jens Axboed29cd592010-05-04 13:06:47 +020013OBJS += lib/flist_sort.o
Jens Axboe1fbbf722010-03-25 23:03:18 +010014
Jens Axboeeef6eea2007-07-30 12:27:58 +020015OBJS += crc/crc7.o
16OBJS += crc/crc16.o
17OBJS += crc/crc32.o
Jens Axboebac39e02008-06-11 20:46:19 +020018OBJS += crc/crc32c.o
Jens Axboe38455912008-08-04 15:35:26 +020019OBJS += crc/crc32c-intel.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020020OBJS += crc/crc64.o
Jens Axboe7c353ce2009-08-09 22:40:33 +020021OBJS += crc/sha1.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020022OBJS += crc/sha256.o
23OBJS += crc/sha512.o
24OBJS += crc/md5.o
Jens Axboeebac4652005-12-08 15:25:21 +010025
Jens Axboef8fe35e2007-02-06 13:29:55 +010026OBJS += engines/cpu.o
27OBJS += engines/libaio.o
28OBJS += engines/mmap.o
29OBJS += engines/posixaio.o
30OBJS += engines/sg.o
31OBJS += engines/splice.o
32OBJS += engines/sync.o
33OBJS += engines/null.o
Jens Axboeed92ac02007-02-06 14:43:52 +010034OBJS += engines/net.o
Jens Axboea4f4fdd2007-02-14 01:16:39 +010035OBJS += engines/syslet-rw.o
Davide Libenzi609342f2007-03-21 08:46:18 +010036OBJS += engines/guasi.o
Jens Axboe5f350952006-11-07 15:20:59 +010037
Jens Axboe79d16312010-03-04 12:43:20 +010038OBJS += profiles/tiobench.o
39
Jens Axboe4c3ecec2008-03-01 16:20:13 +010040ifneq ($(findstring $(MAKEFLAGS),s),s)
41ifndef V
42 QUIET_CC = @echo ' ' CC $@;
Jens Axboe0b2d6a72008-03-03 12:20:26 +010043 QUIET_DEP = @echo ' ' DEP $@;
Jens Axboe4c3ecec2008-03-01 16:20:13 +010044endif
45endif
46
Jens Axboec1d57252006-10-09 19:56:04 +020047INSTALL = install
48prefix = /usr/local
49bindir = $(prefix)/bin
Aaron Carrolld60e92d2007-09-17 10:32:59 +020050mandir = $(prefix)/man
Jens Axboec1d57252006-10-09 19:56:04 +020051
Jens Axboe4c3ecec2008-03-01 16:20:13 +010052%.o: %.c
53 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
Jens Axboe2f9ade32006-10-20 11:25:52 +020054fio: $(OBJS)
Jens Axboe4c3ecec2008-03-01 16:20:13 +010055 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
56
Jens Axboe0b2d6a72008-03-03 12:20:26 +010057depend:
Jens Axboe091708d2008-06-11 13:18:30 +020058 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.c 1> .depend
Jens Axboe0b2d6a72008-03-03 12:20:26 +010059
Jens Axboe06fecb42008-03-03 12:22:19 +010060$(PROGS): depend
61
62all: depend $(PROGS) $(SCRIPTS)
Jens Axboeebac4652005-12-08 15:25:21 +010063
64clean:
Jens Axboe6492b1e2008-06-02 15:57:45 +020065 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
Jens Axboeebac4652005-12-08 15:25:21 +010066
Jens Axboe592ef982006-06-06 20:58:57 +020067cscope:
68 @cscope -b
69
Jens Axboeebac4652005-12-08 15:25:21 +010070install: $(PROGS) $(SCRIPTS)
71 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
72 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +020073 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
74 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Jens Axboeccd4f412009-05-20 11:36:39 +020075 $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
Jens Axboeebac4652005-12-08 15:25:21 +010076
Jens Axboe06fecb42008-03-03 12:22:19 +010077ifneq ($(wildcard .depend),)
78include .depend
79endif