| 1 | CC = gcc |
| 2 | CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 |
| 3 | PROGS = fio |
| 4 | SCRIPTS = fio_generate_plots |
| 5 | OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \ |
| 6 | filesetup.o eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \ |
| 7 | rbtree.o |
| 8 | |
| 9 | OBJS += engines/cpu.o |
| 10 | OBJS += engines/mmap.o |
| 11 | OBJS += engines/posixaio.o |
| 12 | OBJS += engines/sync.o |
| 13 | OBJS += engines/null.o |
| 14 | OBJS += engines/net.o |
| 15 | |
| 16 | all: depend $(PROGS) $(SCRIPTS) |
| 17 | |
| 18 | fio: $(OBJS) |
| 19 | $(CC) $(CFLAGS) -o $@ $(OBJS) -lc -lpthread -lm -laio -lrt -ldl |
| 20 | |
| 21 | clean: |
| 22 | -rm -f *.o .depend cscope.out $(PROGS) |
| 23 | |
| 24 | depend: |
| 25 | @$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c 1> .depend |
| 26 | |
| 27 | cscope: |
| 28 | @cscope -b |
| 29 | |
| 30 | INSTALL = install |
| 31 | prefix = /usr/local |
| 32 | bindir = $(prefix)/bin |
| 33 | |
| 34 | install: $(PROGS) $(SCRIPTS) |
| 35 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 36 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |