2 DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
3 CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
5 OPTFLAGS= -O2 -fno-omit-frame-pointer -g $(EXTFLAGS)
6 CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS) -rdynamic
7 LIBS = -lpthread -lm -ldl
9 SCRIPTS = fio_generate_plots
11 SOURCE = gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
12 eta.c verify.c memory.c io_u.c parse.c mutex.c options.c rbtree.c \
13 smalloc.c filehash.c helpers.c profile.c debug.c lib/rand.c \
14 lib/flist_sort.c lib/num2str.c $(wildcard crc/*.c) engines/cpu.c \
15 engines/mmap.c engines/posixaio.c engines/sync.c engines/null.c \
18 OBJS = $(SOURCE:.c=.o)
20 ifneq ($(findstring $(MAKEFLAGS),s),s)
22 QUIET_CC = @echo ' ' CC $@;
23 QUIET_DEP = @echo ' ' DEP $@;
29 bindir = $(prefix)/bin
30 mandir = $(prefix)/man
33 $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $<
36 $(QUIET_CC)$(CC) $(CFLAGS) -o $@ $(LIBS) $(OBJS)
39 $(QUIET_DEP)$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SOURCE) 1> .depend
43 all: depend $(PROGS) $(SCRIPTS)
46 -rm -f .depend cscope.out $(OBJS) $(PROGS) core.* core
51 install: $(PROGS) $(SCRIPTS)
52 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
53 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
54 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
55 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
56 $(INSTALL) -m 644 fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
58 ifneq ($(wildcard .depend),)