[PATCH] Fix random_map
[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
2f9ade3c 5OBJS = fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \
cb2c86fd 6 filesetup.o eta.o verify.o memory.o io_u.o parse.o
ebac4655 7
c1d5725e
JA
8INSTALL = install
9prefix = /usr/local
10bindir = $(prefix)/bin
11libdir = $(prefix)/lib/fio
12
13FIO_INST_DIR = $(subst ','\'',$(prefix))
14
15CFLAGS += '-D_INST_PREFIX="$(FIO_INST_DIR)"'
16
ebac4655 17all: depend $(PROGS) $(SCRIPTS)
2866c82d 18 $(MAKE) -C engines
ebac4655 19
2f9ade3c 20fio: $(OBJS)
2953f575 21 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -lm -ldl
ebac4655
JA
22
23clean:
2866c82d 24 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o
ebac4655
JA
25
26depend:
27 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
28
592ef98a
JA
29cscope:
30 @cscope -b
31
ebac4655
JA
32install: $(PROGS) $(SCRIPTS)
33 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
34 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
2866c82d
JA
35 $(INSTALL) -m755 -d $(DESTDIR) $(libdir)
36 $(INSTALL) engines/*.o $(libdir)
ebac4655
JA
37
38ifneq ($(wildcard .depend),)
39include .depend
40endif