[PATCH] Only the posixaio engine needs to link against -lrt
[fio.git] / Makefile
CommitLineData
ebac4655 1CC = gcc
0ab8db89 2CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
ebac4655
JA
3PROGS = fio
4SCRIPTS = fio_generate_plots
5
c1d5725e
JA
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
ebac4655 15all: depend $(PROGS) $(SCRIPTS)
2866c82d 16 $(MAKE) -C engines
ebac4655 17
e29d1b70 18fio: fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o filesetup.o eta.o verify.o
2953f575 19 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -lm -ldl
ebac4655
JA
20
21clean:
2866c82d 22 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o
ebac4655
JA
23
24depend:
25 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
26
592ef98a
JA
27cscope:
28 @cscope -b
29
ebac4655
JA
30install: $(PROGS) $(SCRIPTS)
31 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
32 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
2866c82d
JA
33 $(INSTALL) -m755 -d $(DESTDIR) $(libdir)
34 $(INSTALL) engines/*.o $(libdir)
ebac4655
JA
35
36ifneq ($(wildcard .depend),)
37include .depend
38endif