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