Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 1 | CC = gcc |
Jens Axboe | 79e48f7 | 2008-02-01 20:37:09 +0100 | [diff] [blame] | 2 | DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG |
Davide Libenzi | 4cf6b5d | 2007-03-22 07:42:57 +0100 | [diff] [blame] | 3 | OPTFLAGS= -O2 -g $(EXTFLAGS) |
Jens Axboe | 46e9e96 | 2008-11-20 09:13:23 +0100 | [diff] [blame] | 4 | CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -fno-omit-frame-pointer -rdynamic |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 5 | PROGS = fio |
| 6 | SCRIPTS = fio_generate_plots |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 7 | OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \ |
Jens Axboe | ff2e223 | 2008-06-13 08:38:35 +0200 | [diff] [blame] | 8 | eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \ |
Jens Axboe | a696fa2 | 2009-12-04 10:05:02 +0100 | [diff] [blame] | 9 | rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o helpers.o \ |
| 10 | cgroup.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 11 | |
| 12 | OBJS += crc/crc7.o |
| 13 | OBJS += crc/crc16.o |
| 14 | OBJS += crc/crc32.o |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 15 | OBJS += crc/crc32c.o |
Jens Axboe | 3845591 | 2008-08-04 15:35:26 +0200 | [diff] [blame] | 16 | OBJS += crc/crc32c-intel.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 17 | OBJS += crc/crc64.o |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 18 | OBJS += crc/sha1.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 19 | OBJS += crc/sha256.o |
| 20 | OBJS += crc/sha512.o |
| 21 | OBJS += crc/md5.o |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 22 | |
Jens Axboe | f8fe35e | 2007-02-06 13:29:55 +0100 | [diff] [blame] | 23 | OBJS += engines/cpu.o |
| 24 | OBJS += engines/libaio.o |
| 25 | OBJS += engines/mmap.o |
| 26 | OBJS += engines/posixaio.o |
| 27 | OBJS += engines/sg.o |
| 28 | OBJS += engines/splice.o |
| 29 | OBJS += engines/sync.o |
| 30 | OBJS += engines/null.o |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 31 | OBJS += engines/net.o |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 32 | OBJS += engines/syslet-rw.o |
Davide Libenzi | 609342f | 2007-03-21 08:46:18 +0100 | [diff] [blame] | 33 | OBJS += engines/guasi.o |
Jens Axboe | 5f35095 | 2006-11-07 15:20:59 +0100 | [diff] [blame] | 34 | |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 35 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
| 36 | ifndef V |
| 37 | QUIET_CC = @echo ' ' CC $@; |
Jens Axboe | 0b2d6a7 | 2008-03-03 12:20:26 +0100 | [diff] [blame] | 38 | QUIET_DEP = @echo ' ' DEP $@; |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 39 | endif |
| 40 | endif |
| 41 | |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 42 | INSTALL = install |
| 43 | prefix = /usr/local |
| 44 | bindir = $(prefix)/bin |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 45 | mandir = $(prefix)/man |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 46 | |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 47 | %.o: %.c |
| 48 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
Jens Axboe | 2f9ade3 | 2006-10-20 11:25:52 +0200 | [diff] [blame] | 49 | fio: $(OBJS) |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 50 | $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt |
| 51 | |
Jens Axboe | 0b2d6a7 | 2008-03-03 12:20:26 +0100 | [diff] [blame] | 52 | depend: |
Jens Axboe | 091708d | 2008-06-11 13:18:30 +0200 | [diff] [blame] | 53 | $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.c 1> .depend |
Jens Axboe | 0b2d6a7 | 2008-03-03 12:20:26 +0100 | [diff] [blame] | 54 | |
Jens Axboe | 06fecb4 | 2008-03-03 12:22:19 +0100 | [diff] [blame] | 55 | $(PROGS): depend |
| 56 | |
| 57 | all: depend $(PROGS) $(SCRIPTS) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 58 | |
| 59 | clean: |
Jens Axboe | 6492b1e | 2008-06-02 15:57:45 +0200 | [diff] [blame] | 60 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 61 | |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 62 | cscope: |
| 63 | @cscope -b |
| 64 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 65 | install: $(PROGS) $(SCRIPTS) |
| 66 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 67 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 68 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 69 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | ccd4f41 | 2009-05-20 11:36:39 +0200 | [diff] [blame] | 70 | $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 71 | |
Jens Axboe | 06fecb4 | 2008-03-03 12:22:19 +0100 | [diff] [blame] | 72 | ifneq ($(wildcard .depend),) |
| 73 | include .depend |
| 74 | endif |