[PATCH] Enable _FORTIFY_SOURCE and stack protector checking
[fio.git] / Makefile
... / ...
CommitLineData
1#CC = /opt/intel/cce/9.1.045/bin/icc
2CC = gcc -W
3DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector
4OPTFLAGS= -O2 -g
5CFLAGS = -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(DEBUGFLAGS)
6PROGS = fio
7SCRIPTS = fio_generate_plots
8OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \
9 filesetup.o eta.o verify.o memory.o io_u.o parse.o
10
11OBJS += engines/cpu.o
12OBJS += engines/libaio.o
13OBJS += engines/mmap.o
14OBJS += engines/posixaio.o
15OBJS += engines/sg.o
16OBJS += engines/splice.o
17OBJS += engines/sync.o
18OBJS += engines/null.o
19OBJS += engines/net.o
20
21INSTALL = install
22prefix = /usr/local
23bindir = $(prefix)/bin
24libdir = $(prefix)/lib/fio
25
26all: depend $(PROGS) $(SCRIPTS)
27
28fio: $(OBJS)
29 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -lm -ldl -laio -lrt
30
31clean:
32 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o
33
34depend:
35 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
36
37cscope:
38 @cscope -b
39
40install: $(PROGS) $(SCRIPTS)
41 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
42 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
43
44ifneq ($(wildcard .depend),)
45include .depend
46endif