| 1 | CC = gcc |
| 2 | CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INC_DEBUG |
| 3 | PROGS = fio |
| 4 | SCRIPTS = fio_generate_plots |
| 5 | OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \ |
| 6 | eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \ |
| 7 | rbtree.o fifo.o smalloc.o filehash.o lib/strsep.o helpers.o solaris.o \ |
| 8 | profile.o debug.o |
| 9 | |
| 10 | OBJS += lib/rand.o |
| 11 | OBJS += lib/flist_sort.o |
| 12 | OBJS += lib/num2str.o |
| 13 | |
| 14 | OBJS += crc/crc7.o |
| 15 | OBJS += crc/crc16.o |
| 16 | OBJS += crc/crc32.o |
| 17 | OBJS += crc/crc32c.o |
| 18 | OBJS += crc/crc32c-intel.o |
| 19 | OBJS += crc/crc64.o |
| 20 | OBJS += crc/sha1.o |
| 21 | OBJS += crc/sha256.o |
| 22 | OBJS += crc/sha512.o |
| 23 | OBJS += crc/md5.o |
| 24 | |
| 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 |
| 30 | OBJS += engines/net.o |
| 31 | OBJS += engines/solarisaio.o |
| 32 | |
| 33 | INSTALL = install |
| 34 | prefix = /usr/local |
| 35 | bindir = $(prefix)/bin |
| 36 | mandir = $(prefix)/man |
| 37 | |
| 38 | %.o: %.c |
| 39 | $(CC) -o $*.o -c $(CFLAGS) $< |
| 40 | fio: $(OBJS) |
| 41 | $(CC) $(CFLAGS) -o $@ $(OBJS) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt -lnsl -lsocket |
| 42 | |
| 43 | all: $(PROGS) $(SCRIPTS) |
| 44 | |
| 45 | clean: |
| 46 | -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core |
| 47 | |
| 48 | cscope: |
| 49 | @cscope -b |
| 50 | |
| 51 | install: $(PROGS) $(SCRIPTS) |
| 52 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 53 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
| 54 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 55 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
| 56 | $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 |