blob: 52e515b04f01f87189e41223a02e2d702f959882 [file] [log] [blame]
Jens Axboe67bf9822013-01-10 11:23:19 +01001ifneq ($(wildcard config-host.mak),)
2all:
3include config-host.mak
4config-host-mak: configure
5 @echo $@ is out-of-date, running configure
6 @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
7else
8config-host.mak:
Jens Axboed443abc2013-05-29 21:49:21 +02009ifneq ($(MAKECMDGOALS),clean)
Jens Axboe67bf9822013-01-10 11:23:19 +010010 @echo "Running configure for you..."
11 @./configure
Jens Axboed443abc2013-05-29 21:49:21 +020012endif
Jens Axboe67bf9822013-01-10 11:23:19 +010013all:
14include config-host.mak
15endif
16
Jens Axboeaf4862b2013-03-29 08:55:32 -060017DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
Daniel Gollub91955522014-05-01 14:07:02 +020018CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS)
Jens Axboeaf4862b2013-03-29 08:55:32 -060019OPTFLAGS= -O3 -g -ffast-math
Jens Axboe1be2ed92014-11-18 20:14:23 -070020CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS)
Jens Axboeaf4862b2013-03-29 08:55:32 -060021LIBS += -lm $(EXTLIBS)
22PROGS = fio
Erwan Velu265a2022013-08-07 15:32:02 +020023SCRIPTS = tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio
Jens Axboeaf4862b2013-03-29 08:55:32 -060024
Jens Axboe91f94d52013-01-24 10:25:42 -070025ifdef CONFIG_GFIO
26 PROGS += gfio
27endif
28
Jens Axboeea783f82013-04-05 12:54:03 +020029SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
Bruce Crand015e392011-01-28 08:39:09 +010030 eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
Jens Axboe05775432012-03-21 14:07:11 +010031 lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
Jens Axboec7c6cb42011-10-13 14:12:40 +020032 lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \
Jens Axboed48a9792011-07-09 08:54:26 +020033 engines/mmap.c engines/sync.c engines/null.c engines/net.c \
Jens Axboe2dc1cbb2012-03-08 14:52:25 +010034 memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \
Jens Axboe9a0db1e2012-12-03 14:38:08 +010035 cconv.c lib/prio_tree.c json.c lib/zipf.c lib/axmap.c \
Jens Axboe836fcc02013-01-24 09:08:45 -070036 lib/lfsr.c gettime-thread.c helpers.c lib/flist_sort.c \
Jens Axboed4afedf2013-05-22 22:21:29 +020037 lib/hweight.c lib/getrusage.c idletime.c td_error.c \
Jens Axboe38a812d2014-07-03 09:10:39 -060038 profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
Jens Axboeb0e1bb92014-09-27 09:30:56 -060039 lib/tp.c lib/bloom.c
Jens Axboe67bf9822013-01-10 11:23:19 +010040
Manish Mandlikd60aa362014-08-13 13:36:52 -060041ifdef CONFIG_LIBHDFS
42 HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
Fabrice Bacchella468a18c2014-12-10 17:39:48 +010043 HDFSLIB= -Wl,-rpath $(JAVA_HOME)/jre/lib/amd64/server -L$(JAVA_HOME)/jre/lib/amd64/server -ljvm $(FIO_LIBHDFS_LIB)/libhdfs.a
Manish Mandlikd60aa362014-08-13 13:36:52 -060044 CFLAGS += $(HDFSFLAGS)
45 SOURCE += engines/libhdfs.c
46endif
47
Bruce Cranc81f9342013-01-13 17:09:22 +000048ifdef CONFIG_64BIT_LLP64
49 CFLAGS += -DBITS_PER_LONG=32
50endif
Jens Axboe67bf9822013-01-10 11:23:19 +010051ifdef CONFIG_64BIT
52 CFLAGS += -DBITS_PER_LONG=64
53endif
54ifdef CONFIG_32BIT
55 CFLAGS += -DBITS_PER_LONG=32
56endif
Jens Axboe67bf9822013-01-10 11:23:19 +010057ifdef CONFIG_LIBAIO
Jens Axboe67bf9822013-01-10 11:23:19 +010058 SOURCE += engines/libaio.c
59endif
60ifdef CONFIG_RDMA
Jens Axboe67bf9822013-01-10 11:23:19 +010061 SOURCE += engines/rdma.c
62endif
63ifdef CONFIG_POSIXAIO
Jens Axboe67bf9822013-01-10 11:23:19 +010064 SOURCE += engines/posixaio.c
65endif
66ifdef CONFIG_LINUX_FALLOCATE
67 SOURCE += engines/falloc.c
68endif
69ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
70 SOURCE += engines/e4defrag.c
71endif
72ifdef CONFIG_LINUX_SPLICE
Jens Axboe67bf9822013-01-10 11:23:19 +010073 SOURCE += engines/splice.c
74endif
75ifdef CONFIG_GUASI
Jens Axboe67bf9822013-01-10 11:23:19 +010076 SOURCE += engines/guasi.c
77endif
78ifdef CONFIG_FUSION_AW
Jens Axboe67bf9822013-01-10 11:23:19 +010079 SOURCE += engines/fusion-aw.c
80endif
81ifdef CONFIG_SOLARISAIO
Jens Axboe67bf9822013-01-10 11:23:19 +010082 SOURCE += engines/solarisaio.c
83endif
Jens Axboe4700b232013-01-24 15:33:33 -070084ifdef CONFIG_WINDOWSAIO
Jens Axboe4700b232013-01-24 15:33:33 -070085 SOURCE += engines/windowsaio.c
86endif
Daniel Gollubfc5c0342014-02-17 14:35:28 +010087ifdef CONFIG_RBD
88 SOURCE += engines/rbd.c
89endif
Jens Axboe67bf9822013-01-10 11:23:19 +010090ifndef CONFIG_STRSEP
Jens Axboe67bf9822013-01-10 11:23:19 +010091 SOURCE += lib/strsep.c
92endif
Jens Axboe9ad8da82013-04-05 14:44:03 +020093ifndef CONFIG_STRCASESTR
94 SOURCE += lib/strcasestr.c
95endif
Jens Axboe67bf9822013-01-10 11:23:19 +010096ifndef CONFIG_GETOPT_LONG_ONLY
Jens Axboe67bf9822013-01-10 11:23:19 +010097 SOURCE += lib/getopt_long.c
98endif
Jens Axboe67bf9822013-01-10 11:23:19 +010099ifndef CONFIG_INET_ATON
Jens Axboe67bf9822013-01-10 11:23:19 +0100100 SOURCE += lib/inet_aton.c
101endif
chenh0e55d6b2014-03-27 15:19:43 -0400102ifdef CONFIG_GFAPI
103 SOURCE += engines/glusterfs.c
chenhcb92c7f2014-04-02 13:01:01 -0400104 SOURCE += engines/glusterfs_sync.c
105 SOURCE += engines/glusterfs_async.c
chenh54fe20f2014-04-08 13:02:26 -0400106 ifdef CONFIG_GF_FADVISE
107 CFLAGS += "-DGFAPI_USE_FADVISE"
108 endif
chenh0e55d6b2014-03-27 15:19:43 -0400109endif
Bruce Crand015e392011-01-28 08:39:09 +0100110
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100111ifeq ($(CONFIG_TARGET_OS), Linux)
Jens Axboe67bf9822013-01-10 11:23:19 +0100112 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
Jens Axboe42a80e32014-09-16 17:06:52 +0200113 engines/binject.c lib/linux-dev-lookup.c
Jens Axboe67bf9822013-01-10 11:23:19 +0100114 LIBS += -lpthread -ldl
Jens Axboe213a01b2011-10-07 13:24:16 +0200115 LDFLAGS += -rdynamic
Bruce Crand015e392011-01-28 08:39:09 +0100116endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100117ifeq ($(CONFIG_TARGET_OS), Android)
Jens Axboe42a80e32014-09-16 17:06:52 +0200118 SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c \
119 lib/linux-dev-lookup.c
Aaron Carrollec5c6b12012-11-21 10:39:00 +0100120 LIBS += -ldl
121 LDFLAGS += -rdynamic
Aaron Carrollec5c6b12012-11-21 10:39:00 +0100122endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100123ifeq ($(CONFIG_TARGET_OS), SunOS)
Jens Axboe7366ad02013-02-28 20:34:31 +0100124 LIBS += -lpthread -ldl
Bruce Crand015e392011-01-28 08:39:09 +0100125 CPPFLAGS += -D__EXTENSIONS__
126endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100127ifeq ($(CONFIG_TARGET_OS), FreeBSD)
Bruce Crand015e392011-01-28 08:39:09 +0100128 LIBS += -lpthread -lrt
Jens Axboe213a01b2011-10-07 13:24:16 +0200129 LDFLAGS += -rdynamic
Bruce Crand015e392011-01-28 08:39:09 +0100130endif
John3cd4c662013-12-29 19:20:35 -0700131ifeq ($(CONFIG_TARGET_OS), OpenBSD)
132 LIBS += -lpthread
133 LDFLAGS += -rdynamic
134endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100135ifeq ($(CONFIG_TARGET_OS), NetBSD)
Bruce Crand015e392011-01-28 08:39:09 +0100136 LIBS += -lpthread -lrt
Jens Axboe213a01b2011-10-07 13:24:16 +0200137 LDFLAGS += -rdynamic
Bruce Crand015e392011-01-28 08:39:09 +0100138endif
Jens Axboeec58c742014-11-04 19:53:04 -0700139ifeq ($(CONFIG_TARGET_OS), DragonFly)
140 LIBS += -lpthread -lrt
141 LDFLAGS += -rdynamic
142endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100143ifeq ($(CONFIG_TARGET_OS), AIX)
Bruce Crand015e392011-01-28 08:39:09 +0100144 LIBS += -lpthread -ldl -lrt
Bruce Crand015e392011-01-28 08:39:09 +0100145 CPPFLAGS += -D_LARGE_FILES -D__ppc__
Michael Perzl48b35be2011-07-13 20:28:07 +0200146 LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
Bruce Crand015e392011-01-28 08:39:09 +0100147endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100148ifeq ($(CONFIG_TARGET_OS), HP-UX)
Jens Axboeb5ffb752011-07-09 13:28:19 +0200149 LIBS += -lpthread -ldl -lrt
Jens Axboe67bf9822013-01-10 11:23:19 +0100150 CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
Jens Axboec00a2282011-07-08 20:56:06 +0200151endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100152ifeq ($(CONFIG_TARGET_OS), Darwin)
Bruce Crand015e392011-01-28 08:39:09 +0100153 LIBS += -lpthread -ldl
154endif
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100155ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
Bruce Cran93bcfd22012-02-20 20:18:19 +0100156 SOURCE := $(filter-out engines/mmap.c,$(SOURCE))
Jens Axboe4700b232013-01-24 15:33:33 -0700157 SOURCE += os/windows/posix.c
Bruce Cran93bcfd22012-02-20 20:18:19 +0100158 LIBS += -lpthread -lpsapi -lws2_32
Bruce Cran9aa5fe32014-01-28 12:56:53 -0700159 CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static
Bruce Crand015e392011-01-28 08:39:09 +0100160endif
161
Bruce Cran9b836562011-01-08 19:49:54 +0100162OBJS = $(SOURCE:.c=.o)
Jens Axboe90b7a962013-02-04 12:51:09 +0100163
Stephen M. Cameron8232e282012-02-24 08:17:31 +0100164FIO_OBJS = $(OBJS) fio.o
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600165
Jens Axboe1252d8f2012-03-21 11:13:31 +0100166GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \
Stephen M. Cameronbf3f7022012-03-27 08:14:48 +0200167 gclient.o gcompat.o cairo_text_helpers.o printing.o
Jens Axboe79d16312010-03-04 12:43:20 +0100168
Jens Axboecc481fd2014-10-07 20:43:04 -0600169ifdef CONFIG_ARITHMETIC
170FIO_OBJS += lex.yy.o y.tab.o
171GFIO_OBJS += lex.yy.o y.tab.o
172endif
173
Jens Axboef67d6ee2013-02-01 15:51:23 +0100174-include $(OBJS:.o=.d)
Jens Axboe4c3ecec2008-03-01 16:20:13 +0100175
Jens Axboe61f78f32011-10-05 10:25:54 +0200176T_SMALLOC_OBJS = t/stest.o
Jens Axboe7a741972014-09-26 09:58:29 -0600177T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o t/debug.o
Jens Axboe61f78f32011-10-05 10:25:54 +0200178T_SMALLOC_PROGS = t/stest
179
180T_IEEE_OBJS = t/ieee754.o
Jens Axboe84f43c62012-03-31 16:02:08 -0700181T_IEEE_OBJS += lib/ieee754.o
Jens Axboe61f78f32011-10-05 10:25:54 +0200182T_IEEE_PROGS = t/ieee754
183
Jens Axboe6ff38852012-11-06 16:09:14 +0100184T_ZIPF_OBS = t/genzipf.o
Jens Axboe24baa4c2012-11-12 20:54:12 -0700185T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/zipf.o t/genzipf.o
Jens Axboe500b4f42014-10-11 10:19:42 -0600186T_ZIPF_PROGS = t/fio-genzipf
Jens Axboe6ff38852012-11-06 16:09:14 +0100187
Jens Axboead1f90a2012-11-28 21:29:14 +0100188T_AXMAP_OBJS = t/axmap.o
Jens Axboe28787e42015-01-03 13:40:24 -0700189T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
Jens Axboead1f90a2012-11-28 21:29:14 +0100190T_AXMAP_PROGS = t/axmap
191
Alex Pyrgiotis7a887ff2013-03-08 14:37:04 +0200192T_LFSR_TEST_OBJS = t/lfsr-test.o
Jens Axboe7a741972014-09-26 09:58:29 -0600193T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o t/log.o t/debug.o
Alex Pyrgiotis7a887ff2013-03-08 14:37:04 +0200194T_LFSR_TEST_PROGS = t/lfsr-test
195
Jens Axboe42a80e32014-09-16 17:06:52 +0200196ifeq ($(CONFIG_TARGET_OS), Linux)
197T_BTRACE_FIO_OBJS = t/btrace2fio.o
198T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o lib/linux-dev-lookup.o
Jens Axboe500b4f42014-10-11 10:19:42 -0600199T_BTRACE_FIO_PROGS = t/fio-btrace2fio
Jens Axboe42a80e32014-09-16 17:06:52 +0200200endif
201
Jens Axboe5aa702c2014-09-23 14:10:35 -0600202T_DEDUPE_OBJS = t/dedupe.o
203T_DEDUPE_OBJS += lib/rbtree.o t/log.o mutex.o smalloc.o gettime.o crc/md5.o \
Jens Axboe91d97212014-09-27 21:28:47 -0600204 memalign.o lib/bloom.o t/debug.o crc/xxhash.o crc/murmur3.o \
205 crc/crc32c.o crc/crc32c-intel.o crc/fnv.o
Jens Axboe500b4f42014-10-11 10:19:42 -0600206T_DEDUPE_PROGS = t/fio-dedupe
Jens Axboe5aa702c2014-09-23 14:10:35 -0600207
Jens Axboe61f78f32011-10-05 10:25:54 +0200208T_OBJS = $(T_SMALLOC_OBJS)
209T_OBJS += $(T_IEEE_OBJS)
Jens Axboe6ff38852012-11-06 16:09:14 +0100210T_OBJS += $(T_ZIPF_OBJS)
Jens Axboead1f90a2012-11-28 21:29:14 +0100211T_OBJS += $(T_AXMAP_OBJS)
Alex Pyrgiotis7a887ff2013-03-08 14:37:04 +0200212T_OBJS += $(T_LFSR_TEST_OBJS)
Jens Axboe42a80e32014-09-16 17:06:52 +0200213T_OBJS += $(T_BTRACE_FIO_OBJS)
Jens Axboee1ecce52014-09-23 15:53:32 -0600214T_OBJS += $(T_DEDUPE_OBJS)
Jens Axboe6ff38852012-11-06 16:09:14 +0100215
Jens Axboe500b4f42014-10-11 10:19:42 -0600216T_TEST_PROGS = $(T_SMALLOC_PROGS)
217T_TEST_PROGS += $(T_IEEE_PROGS)
Jens Axboe6ff38852012-11-06 16:09:14 +0100218T_PROGS += $(T_ZIPF_PROGS)
Jens Axboe500b4f42014-10-11 10:19:42 -0600219T_TEST_PROGS += $(T_AXMAP_PROGS)
220T_TEST_PROGS += $(T_LFSR_TEST_PROGS)
Jens Axboe42a80e32014-09-16 17:06:52 +0200221T_PROGS += $(T_BTRACE_FIO_PROGS)
Jens Axboee1ecce52014-09-23 15:53:32 -0600222T_PROGS += $(T_DEDUPE_PROGS)
223
224PROGS += $(T_PROGS)
Jens Axboe34272072011-08-16 10:01:03 +0200225
Jens Axboe4c3ecec2008-03-01 16:20:13 +0100226ifneq ($(findstring $(MAKEFLAGS),s),s)
227ifndef V
228 QUIET_CC = @echo ' ' CC $@;
Jens Axboeaa2eda72014-09-29 21:39:53 -0600229 QUIET_LINK = @echo ' ' LINK $@;
230 QUIET_DEP = @echo ' ' DEP $@;
231 QUIET_YACC = @echo ' ' YACC $@;
232 QUIET_LEX = @echo ' ' LEX $@;
Jens Axboe4c3ecec2008-03-01 16:20:13 +0100233endif
234endif
235
Jens Axboea8168a22013-04-05 22:13:42 +0200236ifeq ($(CONFIG_TARGET_OS), SunOS)
237 INSTALL = ginstall
238else
239 INSTALL = install
240endif
Jens Axboec1d57252006-10-09 19:56:04 +0200241prefix = /usr/local
242bindir = $(prefix)/bin
Jens Axboebcdf7c52012-02-08 14:19:27 +0100243
Aaron Carroll53cd4ee2013-03-14 16:57:38 +1100244ifeq ($(CONFIG_TARGET_OS), Darwin)
Jens Axboebcdf7c52012-02-08 14:19:27 +0100245mandir = /usr/share/man
Erwan Velueab4af42013-07-30 11:45:18 +0200246sharedir = /usr/share/fio
Jens Axboebcdf7c52012-02-08 14:19:27 +0100247else
Aaron Carrolld60e92d2007-09-17 10:32:59 +0200248mandir = $(prefix)/man
Erwan Velueab4af42013-07-30 11:45:18 +0200249sharedir = $(prefix)/share/fio
Jens Axboebcdf7c52012-02-08 14:19:27 +0100250endif
Jens Axboec1d57252006-10-09 19:56:04 +0200251
Jens Axboe500b4f42014-10-11 10:19:42 -0600252all: $(PROGS) $(T_TEST_PROGS) $(SCRIPTS) FORCE
Michael Zappef84622e2011-06-01 20:15:18 +0200253
Jens Axboe3d433822012-03-21 22:25:22 +0100254.PHONY: all install clean
255.PHONY: FORCE cscope
256
257FIO-VERSION-FILE: FORCE
Bruce Cran84306c12012-04-16 19:33:03 +0200258 @$(SHELL) ./FIO-VERSION-GEN
Jens Axboe3d433822012-03-21 22:25:22 +0100259-include FIO-VERSION-FILE
260
David M. Lee7496ea32013-01-31 18:37:41 +0100261override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
Jens Axboe3d433822012-03-21 22:25:22 +0100262
George Dowding41bfff82014-06-18 09:36:53 -0700263%.o : %.c
Jens Axboe4feafb12013-01-24 23:07:55 -0700264 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
Jens Axboef67d6ee2013-02-01 15:51:23 +0100265 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $*.c > $*.d
266 @mv -f $*.d $*.d.tmp
267 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
268 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
269 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
270 @rm -f $*.d.tmp
Diego Elio Pettenòe52947d2011-03-21 20:13:53 +0100271
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600272ifdef CONFIG_ARITHMETIC
Jens Axboeaa2eda72014-09-29 21:39:53 -0600273lex.yy.c: exp/expression-parser.l
Jens Axboee2e70322014-10-14 21:12:22 -0600274 $(QUIET_LEX)$(LEX) exp/expression-parser.l
Jens Axboeaa2eda72014-09-29 21:39:53 -0600275
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600276lex.yy.o: lex.yy.c y.tab.h
277 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
278
279y.tab.o: y.tab.c y.tab.h
280 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
281
282y.tab.c: exp/expression-parser.y
Bruce Cran6bde6be2014-10-15 14:16:35 -0600283 $(QUIET_YACC)$(YACC) -l -d -b y exp/expression-parser.y
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600284
Jens Axboe8cf2b452014-09-29 20:24:23 -0600285y.tab.h: y.tab.c
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600286
Stephen M. Cameron50979ab2014-10-06 17:58:32 -0500287lexer.h: lex.yy.c
288
Jens Axboee27dadc2014-09-29 14:58:21 -0600289exp/test-expression-parser.o: exp/test-expression-parser.c
290 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
291exp/test-expression-parser: exp/test-expression-parser.o
292 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS)
293
Stephen M. Cameron88b635b2014-09-29 12:10:49 -0600294parse.o: lex.yy.o y.tab.o
295endif
296
Jens Axboecb340b12013-02-05 11:03:12 +0100297init.o: FIO-VERSION-FILE init.c
Jens Axboe4feafb12013-01-24 23:07:55 -0700298 $(QUIET_CC)$(CC) -o init.o $(CFLAGS) $(CPPFLAGS) -c init.c
Jens Axboe32d4cc62012-04-13 14:06:08 +0200299
Jens Axboef762cef2012-03-26 13:51:11 +0200300gcompat.o: gcompat.c gcompat.h
301 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gcompat.c
302
Jens Axboe9af4a242012-03-16 10:13:49 +0100303goptions.o: goptions.c goptions.h
304 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c goptions.c
305
Jens Axboe53e0e852012-03-15 19:38:01 +0100306ghelpers.o: ghelpers.c ghelpers.h
307 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c ghelpers.c
308
Jens Axboe41666582012-03-21 10:25:29 +0100309gerror.o: gerror.c gerror.h
310 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gerror.c
311
Jens Axboe1252d8f2012-03-21 11:13:31 +0100312gclient.o: gclient.c gclient.h
313 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gclient.c
314
Jens Axboe53e0e852012-03-15 19:38:01 +0100315gfio.o: gfio.c ghelpers.c
Jens Axboe70d07ce2012-02-24 13:11:35 +0100316 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gfio.c
317
Jens Axboe53e0e852012-03-15 19:38:01 +0100318graph.o: graph.c graph.h
Stephen M. Cameronaf58ef32012-03-07 07:56:16 +0100319 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c graph.c
320
Stephen M. Cameronee2f55b2012-03-27 08:14:09 +0200321cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
322 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c cairo_text_helpers.c
323
Stephen M. Cameronbf3f7022012-03-27 08:14:48 +0200324printing.o: printing.c printing.h
325 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c printing.c
326
Jens Axboe61f78f32011-10-05 10:25:54 +0200327t/stest: $(T_SMALLOC_OBJS)
Grant Grundlera3c86fc2013-09-04 14:12:09 -0600328 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS)
Jens Axboe61f78f32011-10-05 10:25:54 +0200329
330t/ieee754: $(T_IEEE_OBJS)
Grant Grundlera3c86fc2013-09-04 14:12:09 -0600331 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS)
Jens Axboefbc27922011-08-16 09:56:27 +0200332
Jens Axboe33765372012-04-11 22:25:26 +0200333fio: $(FIO_OBJS)
Jens Axboe0b8d3cb2014-09-29 21:25:54 -0600334 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB)
Jens Axboe4c3ecec2008-03-01 16:20:13 +0100335
Jens Axboe70d07ce2012-02-24 13:11:35 +0100336gfio: $(GFIO_OBJS)
Fabrice Bacchella468a18c2014-12-10 17:39:48 +0100337 $(QUIET_LINK)$(CC) $(filter-out -static, $(LDFLAGS)) -o gfio $(GFIO_OBJS) $(LIBS) $(GFIO_LIBS) $(GTK_LDFLAGS) $(HDFSLIB)
Jens Axboe70d07ce2012-02-24 13:11:35 +0100338
Jens Axboe500b4f42014-10-11 10:19:42 -0600339t/fio-genzipf: $(T_ZIPF_OBJS)
Grant Grundlera3c86fc2013-09-04 14:12:09 -0600340 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS)
Jens Axboe6ff38852012-11-06 16:09:14 +0100341
Jens Axboead1f90a2012-11-28 21:29:14 +0100342t/axmap: $(T_AXMAP_OBJS)
Grant Grundlera3c86fc2013-09-04 14:12:09 -0600343 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS)
Jens Axboead1f90a2012-11-28 21:29:14 +0100344
Alex Pyrgiotis7a887ff2013-03-08 14:37:04 +0200345t/lfsr-test: $(T_LFSR_TEST_OBJS)
Grant Grundlera3c86fc2013-09-04 14:12:09 -0600346 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
Alex Pyrgiotis7a887ff2013-03-08 14:37:04 +0200347
Jens Axboe42a80e32014-09-16 17:06:52 +0200348ifeq ($(CONFIG_TARGET_OS), Linux)
Jens Axboe500b4f42014-10-11 10:19:42 -0600349t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS)
Jens Axboe42a80e32014-09-16 17:06:52 +0200350 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
351endif
352
Jens Axboe500b4f42014-10-11 10:19:42 -0600353t/fio-dedupe: $(T_DEDUPE_OBJS)
Jens Axboe5aa702c2014-09-23 14:10:35 -0600354 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS)
355
Jens Axboe3d433822012-03-21 22:25:22 +0100356clean: FORCE
Jens Axboe500b4f42014-10-11 10:19:42 -0600357 @rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) $(T_TEST_PROGS) core.* core gfio FIO-VERSION-FILE *.d lib/*.d crc/*.d engines/*.d profiles/*.d t/*.d config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h
Jens Axboe45f944b2013-04-27 15:51:25 -0600358
359distclean: clean FORCE
Jens Axboe7788b762014-04-04 08:28:17 -0600360 @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf
Jens Axboeebac4652005-12-08 15:25:21 +0100361
Jens Axboe592ef982006-06-06 20:58:57 +0200362cscope:
Jens Axboe366badd2010-07-19 16:18:35 -0600363 @cscope -b -R
Jens Axboe592ef982006-06-06 20:58:57 +0200364
Erwan Velu1378cc62013-08-07 16:02:25 +0200365tools/plot/fio2gnuplot.1:
366 @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1
367
Jens Axboe7788b762014-04-04 08:28:17 -0600368doc: tools/plot/fio2gnuplot.1
369 @man -t ./fio.1 | ps2pdf - fio.pdf
370 @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf
371 @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
372
Erwan Velu1378cc62013-08-07 16:02:25 +0200373install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE
Jens Axboe513ba3f2011-04-29 08:24:10 +0200374 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
Jens Axboeebac4652005-12-08 15:25:21 +0100375 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Aaron Carrolld60e92d2007-09-17 10:32:59 +0200376 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
377 $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1
Erwan Velu0460eb92013-07-30 11:54:45 +0200378 $(INSTALL) -m 644 tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
Erwan Velu1378cc62013-08-07 16:02:25 +0200379 $(INSTALL) -m 644 tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1
Erwan Velueab4af42013-07-30 11:45:18 +0200380 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
381 $(INSTALL) -m 644 tools/plot/*gpm $(DESTDIR)$(sharedir)/