blob: 090cf615851ba30ca6cc556c324c331e3a19c658 [file] [log] [blame]
Jens Axboe1e97cce2006-12-05 11:44:16 +01001#CC = /opt/intel/cce/9.1.045/bin/icc
Jens Axboe12cbb462007-12-10 20:24:44 +01002CC = gcc
Jens Axboe79e48f72008-02-01 20:37:09 +01003DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
Davide Libenzi4cf6b5d2007-03-22 07:42:57 +01004OPTFLAGS= -O2 -g $(EXTFLAGS)
Joel Becker9728ce32007-03-01 08:24:39 +01005CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -rdynamic
Jens Axboeebac4652005-12-08 15:25:21 +01006PROGS = fio
7SCRIPTS = fio_generate_plots
Jens Axboeeef6eea2007-07-30 12:27:58 +02008OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \
9 eta.o verify.o memory.o io_u.o parse.o mutex.o options.o rbtree.o \
10 diskutil.o fifo.o blktrace.o
11
12OBJS += crc/crc7.o
13OBJS += crc/crc16.o
14OBJS += crc/crc32.o
15OBJS += 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 $@;
35 QUIET_AR = @echo ' ' AR $@;
36 QUIET_LINK = @echo ' ' LINK $@;
37endif
38endif
39
Jens Axboec1d57252006-10-09 19:56:04 +020040INSTALL = install
41prefix = /usr/local
42bindir = $(prefix)/bin
Aaron Carrolld60e92d2007-09-17 10:32:59 +020043mandir = $(prefix)/man
Jens Axboec1d57252006-10-09 19:56:04 +020044
Jens Axboe4c3ecec2008-03-01 16:20:13 +010045%.o: %.c
46 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
Jens Axboe2f9ade32006-10-20 11:25:52 +020047fio: $(OBJS)
Jens Axboe4c3ecec2008-03-01 16:20:13 +010048 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
49
50all: $(PROGS) $(SCRIPTS)
Jens Axboeebac4652005-12-08 15:25:21 +010051
52clean:
Jens Axboeeef6eea2007-07-30 12:27:58 +020053 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o crc/*.o core.* core
Jens Axboeebac4652005-12-08 15:25:21 +010054
55depend:
Jens Axboeeef6eea2007-07-30 12:27:58 +020056 @$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.[ch] 1> .depend
Jens Axboeebac4652005-12-08 15:25:21 +010057
Jens Axboe592ef982006-06-06 20:58:57 +020058cscope:
59 @cscope -b
60
Jens Axboec69aa912007-05-22 15:51:50 +020061$(PROGS): depend
Jens Axboea37bded2007-02-07 14:03:07 +010062
Jens Axboeebac4652005-12-08 15:25:21 +010063install: $(PROGS) $(SCRIPTS)
64 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
65 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +020066 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
67 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Jens Axboeebac4652005-12-08 15:25:21 +010068
69ifneq ($(wildcard .depend),)
70include .depend
71endif