blob: 11bb17e7387b3b1bf54d36fc455596370d4a4a4e [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)
Joel Becker9728ce32007-03-01 08:24:39 +01004CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -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 Axboe4d4e80f2008-03-04 10:18:56 +01008 eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \
Jens Axboe380065a2008-03-01 18:56:24 +01009 rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020010
11OBJS += crc/crc7.o
12OBJS += crc/crc16.o
13OBJS += crc/crc32.o
Jens Axboebac39e02008-06-11 20:46:19 +020014OBJS += crc/crc32c.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020015OBJS += crc/crc64.o
16OBJS += crc/sha256.o
17OBJS += crc/sha512.o
18OBJS += crc/md5.o
Jens Axboeebac4652005-12-08 15:25:21 +010019
Jens Axboef8fe35e2007-02-06 13:29:55 +010020OBJS += engines/cpu.o
21OBJS += engines/libaio.o
22OBJS += engines/mmap.o
23OBJS += engines/posixaio.o
24OBJS += engines/sg.o
25OBJS += engines/splice.o
26OBJS += engines/sync.o
27OBJS += engines/null.o
Jens Axboeed92ac02007-02-06 14:43:52 +010028OBJS += engines/net.o
Jens Axboea4f4fdd2007-02-14 01:16:39 +010029OBJS += engines/syslet-rw.o
Davide Libenzi609342f2007-03-21 08:46:18 +010030OBJS += engines/guasi.o
Jens Axboe5f350952006-11-07 15:20:59 +010031
Jens Axboe4c3ecec2008-03-01 16:20:13 +010032ifneq ($(findstring $(MAKEFLAGS),s),s)
33ifndef V
34 QUIET_CC = @echo ' ' CC $@;
Jens Axboe0b2d6a72008-03-03 12:20:26 +010035 QUIET_DEP = @echo ' ' DEP $@;
Jens Axboe4c3ecec2008-03-01 16:20:13 +010036endif
37endif
38
Jens Axboec1d57252006-10-09 19:56:04 +020039INSTALL = install
40prefix = /usr/local
41bindir = $(prefix)/bin
Aaron Carrolld60e92d2007-09-17 10:32:59 +020042mandir = $(prefix)/man
Jens Axboec1d57252006-10-09 19:56:04 +020043
Jens Axboe4c3ecec2008-03-01 16:20:13 +010044%.o: %.c
45 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
Jens Axboe2f9ade32006-10-20 11:25:52 +020046fio: $(OBJS)
Jens Axboe4c3ecec2008-03-01 16:20:13 +010047 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
48
Jens Axboe0b2d6a72008-03-03 12:20:26 +010049depend:
Jens Axboe091708d2008-06-11 13:18:30 +020050 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.c 1> .depend
Jens Axboe0b2d6a72008-03-03 12:20:26 +010051
Jens Axboe06fecb42008-03-03 12:22:19 +010052$(PROGS): depend
53
54all: depend $(PROGS) $(SCRIPTS)
Jens Axboeebac4652005-12-08 15:25:21 +010055
56clean:
Jens Axboe6492b1e2008-06-02 15:57:45 +020057 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
Jens Axboeebac4652005-12-08 15:25:21 +010058
Jens Axboe592ef982006-06-06 20:58:57 +020059cscope:
60 @cscope -b
61
Jens Axboeebac4652005-12-08 15:25:21 +010062install: $(PROGS) $(SCRIPTS)
63 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
64 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +020065 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
66 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Jens Axboeebac4652005-12-08 15:25:21 +010067
Jens Axboe06fecb42008-03-03 12:22:19 +010068ifneq ($(wildcard .depend),)
69include .depend
70endif