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 | 380065a | 2008-03-01 18:56:24 +0100 | [diff] [blame] | 9 | rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 10 | |
| 11 | OBJS += crc/crc7.o |
| 12 | OBJS += crc/crc16.o |
| 13 | OBJS += crc/crc32.o |
Jens Axboe | bac39e0 | 2008-06-11 20:46:19 +0200 | [diff] [blame] | 14 | OBJS += crc/crc32c.o |
Jens Axboe | 3845591 | 2008-08-04 15:35:26 +0200 | [diff] [blame] | 15 | OBJS += crc/crc32c-intel.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 16 | OBJS += crc/crc64.o |
| 17 | OBJS += crc/sha256.o |
| 18 | OBJS += crc/sha512.o |
| 19 | OBJS += crc/md5.o |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 20 | |
Jens Axboe | f8fe35e | 2007-02-06 13:29:55 +0100 | [diff] [blame] | 21 | OBJS += engines/cpu.o |
| 22 | OBJS += engines/libaio.o |
| 23 | OBJS += engines/mmap.o |
| 24 | OBJS += engines/posixaio.o |
| 25 | OBJS += engines/sg.o |
| 26 | OBJS += engines/splice.o |
| 27 | OBJS += engines/sync.o |
| 28 | OBJS += engines/null.o |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 29 | OBJS += engines/net.o |
Jens Axboe | a4f4fdd | 2007-02-14 01:16:39 +0100 | [diff] [blame] | 30 | OBJS += engines/syslet-rw.o |
Davide Libenzi | 609342f | 2007-03-21 08:46:18 +0100 | [diff] [blame] | 31 | OBJS += engines/guasi.o |
Jens Axboe | 5f35095 | 2006-11-07 15:20:59 +0100 | [diff] [blame] | 32 | |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 33 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
| 34 | ifndef V |
| 35 | QUIET_CC = @echo ' ' CC $@; |
Jens Axboe | 0b2d6a7 | 2008-03-03 12:20:26 +0100 | [diff] [blame] | 36 | QUIET_DEP = @echo ' ' DEP $@; |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 37 | endif |
| 38 | endif |
| 39 | |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 40 | INSTALL = install |
| 41 | prefix = /usr/local |
| 42 | bindir = $(prefix)/bin |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 43 | mandir = $(prefix)/man |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 44 | |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 45 | %.o: %.c |
| 46 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
Jens Axboe | 2f9ade3 | 2006-10-20 11:25:52 +0200 | [diff] [blame] | 47 | fio: $(OBJS) |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 48 | $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt |
| 49 | |
Jens Axboe | 0b2d6a7 | 2008-03-03 12:20:26 +0100 | [diff] [blame] | 50 | depend: |
Jens Axboe | 091708d | 2008-06-11 13:18:30 +0200 | [diff] [blame] | 51 | $(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] | 52 | |
Jens Axboe | 06fecb4 | 2008-03-03 12:22:19 +0100 | [diff] [blame] | 53 | $(PROGS): depend |
| 54 | |
| 55 | all: depend $(PROGS) $(SCRIPTS) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 56 | |
| 57 | clean: |
Jens Axboe | 6492b1e | 2008-06-02 15:57:45 +0200 | [diff] [blame] | 58 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 59 | |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 60 | cscope: |
| 61 | @cscope -b |
| 62 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 63 | install: $(PROGS) $(SCRIPTS) |
| 64 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 65 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 66 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 67 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | ccd4f41 | 2009-05-20 11:36:39 +0200 | [diff] [blame] | 68 | $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 69 | |
Jens Axboe | 06fecb4 | 2008-03-03 12:22:19 +0100 | [diff] [blame] | 70 | ifneq ($(wildcard .depend),) |
| 71 | include .depend |
| 72 | endif |