Jens Axboe | 1e97cce | 2006-12-05 11:44:16 +0100 | [diff] [blame] | 1 | #CC = /opt/intel/cce/9.1.045/bin/icc |
Jens Axboe | 12cbb46 | 2007-12-10 20:24:44 +0100 | [diff] [blame] | 2 | CC = gcc |
Jens Axboe | 79e48f7 | 2008-02-01 20:37:09 +0100 | [diff] [blame] | 3 | DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG |
Davide Libenzi | 4cf6b5d | 2007-03-22 07:42:57 +0100 | [diff] [blame] | 4 | OPTFLAGS= -O2 -g $(EXTFLAGS) |
Joel Becker | 9728ce3 | 2007-03-01 08:24:39 +0100 | [diff] [blame] | 5 | 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] | 6 | PROGS = fio |
| 7 | SCRIPTS = fio_generate_plots |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 8 | OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \ |
Jens Axboe | 0c5b408 | 2008-03-01 18:38:12 +0100 | [diff] [blame] | 9 | eta.o verify.o memory.o io_u.o parse.o mutex.o sem.o options.o \ |
| 10 | rbtree.o diskutil.o fifo.o blktrace.o smalloc.o |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 11 | |
| 12 | OBJS += crc/crc7.o |
| 13 | OBJS += crc/crc16.o |
| 14 | OBJS += crc/crc32.o |
| 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 $@; |
| 35 | QUIET_AR = @echo ' ' AR $@; |
| 36 | QUIET_LINK = @echo ' ' LINK $@; |
| 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 | |
| 50 | all: $(PROGS) $(SCRIPTS) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 51 | |
| 52 | clean: |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 53 | -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] | 54 | |
| 55 | depend: |
Jens Axboe | eef6eea | 2007-07-30 12:27:58 +0200 | [diff] [blame] | 56 | @$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.[ch] 1> .depend |
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 | c69aa91 | 2007-05-22 15:51:50 +0200 | [diff] [blame] | 61 | $(PROGS): depend |
Jens Axboe | a37bded | 2007-02-07 14:03:07 +0100 | [diff] [blame] | 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 | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 68 | |
| 69 | ifneq ($(wildcard .depend),) |
| 70 | include .depend |
| 71 | endif |