blob: b7a25f51b454d7a4e7de0846035b0012c3fafea1 [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
14OBJS += crc/crc64.o
15OBJS += crc/sha256.o
16OBJS += crc/sha512.o
17OBJS += crc/md5.o
Jens Axboeebac4652005-12-08 15:25:21 +010018
Jens Axboef8fe35e2007-02-06 13:29:55 +010019OBJS += engines/cpu.o
20OBJS += engines/libaio.o
21OBJS += engines/mmap.o
22OBJS += engines/posixaio.o
23OBJS += engines/sg.o
24OBJS += engines/splice.o
25OBJS += engines/sync.o
26OBJS += engines/null.o
Jens Axboeed92ac02007-02-06 14:43:52 +010027OBJS += engines/net.o
Jens Axboea4f4fdd2007-02-14 01:16:39 +010028OBJS += engines/syslet-rw.o
Davide Libenzi609342f2007-03-21 08:46:18 +010029OBJS += engines/guasi.o
Jens Axboe5f350952006-11-07 15:20:59 +010030
Jens Axboe4c3ecec2008-03-01 16:20:13 +010031ifneq ($(findstring $(MAKEFLAGS),s),s)
32ifndef V
33 QUIET_CC = @echo ' ' CC $@;
Jens Axboe0b2d6a72008-03-03 12:20:26 +010034 QUIET_DEP = @echo ' ' DEP $@;
Jens Axboe4c3ecec2008-03-01 16:20:13 +010035endif
36endif
37
Jens Axboec1d57252006-10-09 19:56:04 +020038INSTALL = install
39prefix = /usr/local
40bindir = $(prefix)/bin
Aaron Carrolld60e92d2007-09-17 10:32:59 +020041mandir = $(prefix)/man
Jens Axboec1d57252006-10-09 19:56:04 +020042
Jens Axboe4c3ecec2008-03-01 16:20:13 +010043%.o: %.c
44 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
Jens Axboe2f9ade32006-10-20 11:25:52 +020045fio: $(OBJS)
Jens Axboe4c3ecec2008-03-01 16:20:13 +010046 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
47
Jens Axboe0b2d6a72008-03-03 12:20:26 +010048depend:
49 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.[ch] 1> .depend
50
Jens Axboe06fecb42008-03-03 12:22:19 +010051$(PROGS): depend
52
53all: depend $(PROGS) $(SCRIPTS)
Jens Axboeebac4652005-12-08 15:25:21 +010054
55clean:
Jens Axboeeef6eea2007-07-30 12:27:58 +020056 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o crc/*.o core.* core
Jens Axboeebac4652005-12-08 15:25:21 +010057
Jens Axboe592ef982006-06-06 20:58:57 +020058cscope:
59 @cscope -b
60
Jens Axboeebac4652005-12-08 15:25:21 +010061install: $(PROGS) $(SCRIPTS)
62 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
63 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +020064 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
65 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Jens Axboeebac4652005-12-08 15:25:21 +010066
Jens Axboe06fecb42008-03-03 12:22:19 +010067ifneq ($(wildcard .depend),)
68include .depend
69endif