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 | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 9 | rbtree.o smalloc.o filehash.o |
Jens Axboe | c11883f | 2006-11-23 15:11:53 +0100 | [diff] [blame] | 10 | |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +0200 | [diff] [blame] | 11 | OBJS += crc/crc7.o |
| 12 | OBJS += crc/crc16.o |
| 13 | OBJS += crc/crc32.o |
Jens Axboe | a6cee43 | 2008-12-22 11:29:50 +0100 | [diff] [blame] | 14 | OBJS += crc/crc32c.o |
| 15 | OBJS += crc/crc32c-intel.o |
Jens Axboe | a432da1 | 2007-07-30 12:29:37 +0200 | [diff] [blame] | 16 | OBJS += crc/crc64.o |
| 17 | OBJS += crc/sha256.o |
| 18 | OBJS += crc/sha512.o |
| 19 | OBJS += crc/md5.o |
| 20 | |
Jens Axboe | f8fe35e | 2007-02-06 13:29:55 +0100 | [diff] [blame] | 21 | OBJS += engines/cpu.o |
| 22 | OBJS += engines/mmap.o |
| 23 | OBJS += engines/posixaio.o |
| 24 | OBJS += engines/sync.o |
| 25 | OBJS += engines/null.o |
Jens Axboe | ed92ac0 | 2007-02-06 14:43:52 +0100 | [diff] [blame] | 26 | OBJS += engines/net.o |
Jens Axboe | 5c4e1db | 2006-06-07 14:17:08 +0200 | [diff] [blame] | 27 | |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 28 | SOURCE = eta.c filehash.c filesetup.c fio.c gettime.c init.c ioengines.c \ |
| 29 | io_u.c log.c memory.c mutex.c options.c parse.c rbtree.c smalloc.c \ |
| 30 | stat.c parse.c crc/*.c engines/cpu.c engines/mmap.c \ |
| 31 | engines/posixaio.c engines/sync.c engines/null.c engines/net.c \ |
| 32 | *.h */*.h |
| 33 | |
| 34 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
| 35 | ifndef V |
| 36 | QUIET_CC = @echo ' ' CC $@; |
| 37 | QUIET_DEP = @echo ' ' DEP $@; |
| 38 | endif |
| 39 | endif |
| 40 | |
Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 41 | INSTALL = install |
| 42 | prefix = /usr/local |
| 43 | bindir = $(prefix)/bin |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 44 | mandir = $(prefix)/man |
| 45 | |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 46 | %.o: %.c |
| 47 | $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $< |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 48 | fio: $(OBJS) |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 49 | $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm |
| 50 | |
| 51 | depend: |
| 52 | $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) $(SOURCE) 1> .depend |
| 53 | |
| 54 | $(PROGS): depend |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 55 | |
| 56 | all: depend $(PROGS) $(SCRIPTS) |
| 57 | |
| 58 | clean: |
Jens Axboe | 6492b1e | 2008-06-02 15:57:45 +0200 | [diff] [blame] | 59 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 60 | |
Jens Axboe | b52ae0a | 2008-05-30 22:23:53 +0200 | [diff] [blame] | 61 | cscope: |
| 62 | @cscope -b |
Jens Axboe | 32cd46a | 2006-06-07 13:40:40 +0200 | [diff] [blame] | 63 | |
| 64 | install: $(PROGS) $(SCRIPTS) |
| 65 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 66 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Jens Axboe | 5f42100 | 2008-06-02 16:15:59 +0200 | [diff] [blame] | 67 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 68 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
| 69 | |
| 70 | ifneq ($(wildcard .depend),) |
| 71 | include .depend |
| 72 | endif |