Make log writing append
[fio.git] / Makefile
... / ...
CommitLineData
1CC = gcc
2DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
3OPTFLAGS= -O2 -g $(EXTFLAGS)
4CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS) -rdynamic
5PROGS = fio
6SCRIPTS = fio_generate_plots
7OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \
8 eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \
9 rbtree.o diskutil.o fifo.o blktrace.o smalloc.o filehash.o
10
11OBJS += crc/crc7.o
12OBJS += crc/crc16.o
13OBJS += crc/crc32.o
14OBJS += crc/crc32c.o
15OBJS += crc/crc32c-intel.o
16OBJS += crc/crc64.o
17OBJS += crc/sha256.o
18OBJS += crc/sha512.o
19OBJS += crc/md5.o
20
21OBJS += engines/cpu.o
22OBJS += engines/libaio.o
23OBJS += engines/mmap.o
24OBJS += engines/posixaio.o
25OBJS += engines/sg.o
26OBJS += engines/splice.o
27OBJS += engines/sync.o
28OBJS += engines/null.o
29OBJS += engines/net.o
30OBJS += engines/syslet-rw.o
31OBJS += engines/guasi.o
32
33ifneq ($(findstring $(MAKEFLAGS),s),s)
34ifndef V
35 QUIET_CC = @echo ' ' CC $@;
36 QUIET_DEP = @echo ' ' DEP $@;
37endif
38endif
39
40INSTALL = install
41prefix = /usr/local
42bindir = $(prefix)/bin
43mandir = $(prefix)/man
44
45%.o: %.c
46 $(QUIET_CC)$(CC) -o $*.o -c $(CFLAGS) $<
47fio: $(OBJS)
48 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(EXTLIBS) -lpthread -lm -ldl -laio -lrt
49
50depend:
51 $(QUIET_DEP)$(CC) -MM $(ALL_CFLAGS) *.c engines/*.c crc/*.c 1> .depend
52
53$(PROGS): depend
54
55all: depend $(PROGS) $(SCRIPTS)
56
57clean:
58 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
59
60cscope:
61 @cscope -b
62
63install: $(PROGS) $(SCRIPTS)
64 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
65 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
66 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
67 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
68
69ifneq ($(wildcard .depend),)
70include .depend
71endif