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