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