| 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 |
| 7 | |
| 8 | OBJS += engines/cpu.o |
| 9 | OBJS += engines/mmap.o |
| 10 | OBJS += engines/posixaio.o |
| 11 | OBJS += engines/sync.o |
| 12 | OBJS += engines/null.o |
| 13 | OBJS += engines/net.o |
| 14 | |
| 15 | all: depend $(PROGS) $(SCRIPTS) |
| 16 | |
| 17 | fio: $(OBJS) |
| 18 | $(CC) $(CFLAGS) -o $@ $(OBJS) -lpthread -lm -ldl -lrt |
| 19 | |
| 20 | clean: |
| 21 | -rm -f *.o .depend cscope.out $(PROGS) |
| 22 | |
| 23 | depend: |
| 24 | @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend |
| 25 | |
| 26 | cscope: |
| 27 | @cscope -b |
| 28 | |
| 29 | INSTALL = install |
| 30 | prefix = /usr/local |
| 31 | bindir = $(prefix)/bin |
| 32 | |
| 33 | install: $(PROGS) $(SCRIPTS) |
| 34 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 35 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |