[PATCH] Allow io engine to do the file setup
[fio.git] / Makefile
... / ...
CommitLineData
1CC = gcc
2CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
3PROGS = fio
4SCRIPTS = fio_generate_plots
5
6INSTALL = install
7prefix = /usr/local
8bindir = $(prefix)/bin
9libdir = $(prefix)/lib/fio
10
11FIO_INST_DIR = $(subst ','\'',$(prefix))
12
13CFLAGS += '-D_INST_PREFIX="$(FIO_INST_DIR)"'
14
15all: depend $(PROGS) $(SCRIPTS)
16 $(MAKE) -C engines
17
18fio: fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o
19 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt -ldl
20
21clean:
22 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o
23
24depend:
25 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
26
27cscope:
28 @cscope -b
29
30install: $(PROGS) $(SCRIPTS)
31 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
32 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
33 $(INSTALL) -m755 -d $(DESTDIR) $(libdir)
34 $(INSTALL) engines/*.o $(libdir)
35
36ifneq ($(wildcard .depend),)
37include .depend
38endif