Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 1 | CC = gcc |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 2 | DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG |
| 3 | OPTFLAGS= -O2 -g $(EXTFLAGS) |
| 4 | CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -rdynamic |
Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 5 | PROGS = fio |
| 6 | SCRIPTS = fio_generate_plots |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +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 | 8e8af3c | 2010-03-19 16:43:22 +0100 | [diff] [blame] | 9 | rbtree.o smalloc.o filehash.o helpers.o profile.o debug.o |
Jens Axboe | c11883f | 2006-11-23 15:11:53 +0100 | [diff] [blame] | 10 | |
Jens Axboe | 1fbbf72 | 2010-03-25 23:03:18 +0100 | [diff] [blame] | 11 | OBJS += lib/rand.o |
Jens Axboe | d29cd59 | 2010-05-04 13:06:47 +0200 | [diff] [blame] | 12 | OBJS += lib/flist_sort.o |
Jens Axboe | 1fbbf72 | 2010-03-25 23:03:18 +0100 | [diff] [blame] | 13 | |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +0200 | [diff] [blame] | 14 | OBJS += crc/crc7.o |
| 15 | OBJS += crc/crc16.o |
| 16 | OBJS += crc/crc32.o |
Jens Axboe | a6cee43 | 2008-12-22 11:29:50 +0100 | [diff] [blame] | 17 | OBJS += crc/crc32c.o |
| 18 | OBJS += crc/crc32c-intel.o |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +0200 | [diff] [blame] | 19 | OBJS += crc/crc64.o |
Jens Axboe | 7c353ce | 2009-08-09 22:40:33 +0200 | [diff] [blame] | 20 | OBJS += crc/sha1.o |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +0200 | [diff] [blame] | 21 | OBJS += crc/sha256.o |
| 22 | OBJS += crc/sha512.o |
| 23 | OBJS += crc/md5.o |
| 24 | |
Jens Axboe | f8fe35e | 2007-02-06 13:29:55 +0100 | [diff] [blame] | 25 | OBJS += engines/cpu.o |
| 26 | OBJS += engines/mmap.o |
| 27 | OBJS += engines/posixaio.o |
| 28 | OBJS += engines/sync.o |
| 29 | OBJS += engines/null.o |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 30 | OBJS += engines/net.o |
Jens Axboe | 5c4e1db | 2006-06-07 14:17:08 +0200 | [diff] [blame] | 31 | |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 32 | SOURCE = eta.c filehash.c filesetup.c fio.c gettime.c init.c ioengines.c \ |
| 33 | io_u.c log.c memory.c mutex.c options.c parse.c rbtree.c smalloc.c \ |
| 34 | stat.c parse.c crc/*.c engines/cpu.c engines/mmap.c \ |
| 35 | engines/posixaio.c engines/sync.c engines/null.c engines/net.c \ |
Joshua Aune | e72fa4d | 2010-02-11 00:59:18 -0700 | [diff] [blame] | 36 | *.h arch/*.h compiler/*.h crc/*.h lib/*.h \ |
| 37 | os/indirect.h os/kcompat.h os/os-freebsd.h os/os.h os/syslet.h |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 38 | |
| 39 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
| 40 | ifndef V |
| 41 | QUIET_CC = @echo ' ' CC $@; |
| 42 | QUIET_DEP = @echo ' ' DEP $@; |
| 43 | endif |
| 44 | endif |
| 45 | |
Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 46 | INSTALL = install |
| 47 | prefix = /usr/local |
| 48 | bindir = $(prefix)/bin |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 49 | mandir = $(prefix)/man |
| 50 | |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 51 | %.o: %.c |
| 52 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 53 | fio: $(OBJS) |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 54 | $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm |
| 55 | |
| 56 | depend: |
| 57 | $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) $(SOURCE) 1> .depend |
| 58 | |
| 59 | $(PROGS): depend |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 60 | |
| 61 | all: depend $(PROGS) $(SCRIPTS) |
| 62 | |
| 63 | clean: |
Jens Axboe | 6492b1e | 2008-06-02 15:57:45 +0200 | [diff] [blame] | 64 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 65 | |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 66 | cscope: |
| 67 | @cscope -b |
Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 68 | |
| 69 | install: $(PROGS) $(SCRIPTS) |
| 70 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 71 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 72 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 73 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | ccd4f41 | 2009-05-20 11:36:39 +0200 | [diff] [blame] | 74 | $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 75 | |
| 76 | ifneq ($(wildcard .depend),) |
| 77 | include .depend |
| 78 | endif |