blob: 1b77b25386bd86671a8e5f2f3bb543a6256458e1 [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 \
Jens Axboe0c5b4082008-03-01 18:38:12 +01009 eta.o verify.o memory.o io_u.o parse.o mutex.o sem.o options.o \
Jens Axboe380065a2008-03-01 18:56:24 +010010 rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o
Jens Axboeeef6eea2007-07-30 12:27:58 +020011
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 $@;
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:
50 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.[ch] 1> .depend
51
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 Axboeeef6eea2007-07-30 12:27:58 +020057 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o crc/*.o 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