9 config-host.mak: configure
10 @if [ ! -e "$@" ]; then \
11 echo "Running configure ..."; \
14 echo "$@ is out-of-date, running configure"; \
15 sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh; \
18 ifneq ($(MAKECMDGOALS),clean)
19 include config-host.mak
22 DEBUGFLAGS = -DFIO_INC_DEBUG
23 CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS)
24 OPTFLAGS= -g -ffast-math
25 FIO_CFLAGS= -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR)
26 LIBS += -lm $(EXTLIBS)
28 SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/hist/fiologparser_hist.py tools/hist/fio-histo-log-pctiles.py tools/fio_jsonplus_clat2csv)
30 ifndef CONFIG_FIO_NO_OPT
33 ifdef CONFIG_BUILD_NATIVE
34 FIO_CFLAGS += -march=native
38 LINK_PDBFILE ?= -Wl,-pdb,$(dir $@)/$(basename $(@F)).pdb
39 FIO_CFLAGS += -gcodeview
40 LDFLAGS += -fuse-ld=lld $(LINK_PDBFILE)
43 # If clang, do not use builtin stpcpy as it breaks the build
45 FIO_CFLAGS += -fno-builtin-stpcpy
52 SOURCE := $(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
53 $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/lib/*.c))) \
54 gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
55 eta.c verify.c memory.c io_u.c parse.c fio_sem.c rwlock.c \
57 smalloc.c filehash.c profile.c debug.c engines/cpu.c \
58 engines/mmap.c engines/sync.c engines/null.c engines/net.c \
59 engines/ftruncate.c engines/fileoperations.c \
61 server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \
62 gettime-thread.c helpers.c json.c idletime.c td_error.c \
63 profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
64 workqueue.c rate-submit.c optgroup.c helper_thread.c \
65 steadystate.c zone-dist.c zbd.c dedupe.c
68 HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
69 HDFSLIB= -Wl,-rpath $(JAVA_HOME)/lib/$(FIO_HDFS_CPU)/server -L$(JAVA_HOME)/lib/$(FIO_HDFS_CPU)/server $(FIO_LIBHDFS_LIB)/libhdfs.a -ljvm
70 FIO_CFLAGS += $(HDFSFLAGS)
71 SOURCE += engines/libhdfs.c
75 libiscsi_SRCS = engines/libiscsi.c
76 libiscsi_LIBS = $(LIBISCSI_LIBS)
77 libiscsi_CFLAGS = $(LIBISCSI_CFLAGS)
82 nbd_SRCS = engines/nbd.c
83 nbd_LIBS = $(LIBNBD_LIBS)
84 nbd_CFLAGS = $(LIBNBD_CFLAGS)
89 CFLAGS += $(LIBNFS_CFLAGS)
90 LIBS += $(LIBNFS_LIBS)
91 SOURCE += engines/nfs.c
95 CPPFLAGS += -DBITS_PER_LONG=64
96 else ifdef CONFIG_32BIT
97 CPPFLAGS += -DBITS_PER_LONG=32
100 libaio_SRCS = engines/libaio.c
101 cmdprio_SRCS = engines/cmdprio.c
107 rdma_SRCS = engines/rdma.c
108 rdma_LIBS = -libverbs -lrdmacm
111 ifdef CONFIG_LIBRPMA_APM
112 librpma_apm_SRCS = engines/librpma_apm.c
113 librpma_fio_SRCS = engines/librpma_fio.c
114 ifdef CONFIG_LIBPMEM2_INSTALLED
115 librpma_apm_LIBS = -lrpma -lpmem2
117 librpma_apm_LIBS = -lrpma -lpmem
119 ENGINES += librpma_apm
121 ifdef CONFIG_LIBRPMA_GPSPM
122 librpma_gpspm_SRCS = engines/librpma_gpspm.c engines/librpma_gpspm_flush.pb-c.c
123 librpma_fio_SRCS = engines/librpma_fio.c
124 ifdef CONFIG_LIBPMEM2_INSTALLED
125 librpma_gpspm_LIBS = -lrpma -lpmem2 -lprotobuf-c
127 librpma_gpspm_LIBS = -lrpma -lpmem -lprotobuf-c
129 ENGINES += librpma_gpspm
131 ifdef librpma_fio_SRCS
132 SOURCE += $(librpma_fio_SRCS)
134 ifdef CONFIG_POSIXAIO
135 SOURCE += engines/posixaio.c
137 ifdef CONFIG_LINUX_FALLOCATE
138 SOURCE += engines/falloc.c
140 ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
141 SOURCE += engines/e4defrag.c
143 ifdef CONFIG_LIBCUFILE
144 SOURCE += engines/libcufile.c
146 ifdef CONFIG_LINUX_SPLICE
147 SOURCE += engines/splice.c
149 ifdef CONFIG_SOLARISAIO
150 SOURCE += engines/solarisaio.c
152 ifdef CONFIG_WINDOWSAIO
153 SOURCE += engines/windowsaio.c
156 rados_SRCS = engines/rados.c
161 rbd_SRCS = engines/rbd.c
162 rbd_LIBS = -lrbd -lrados
166 http_SRCS = engines/http.c
167 http_LIBS = -lcurl -lssl -lcrypto
171 dfs_SRCS = engines/dfs.c
172 dfs_LIBS = -luuid -ldaos -ldfs
175 SOURCE += oslib/asprintf.c
177 SOURCE += oslib/strsep.c
179 ifndef CONFIG_STRCASESTR
180 SOURCE += oslib/strcasestr.c
182 ifndef CONFIG_STRLCAT
183 SOURCE += oslib/strlcat.c
185 ifndef CONFIG_HAVE_STRNDUP
186 SOURCE += oslib/strndup.c
188 ifndef CONFIG_GETOPT_LONG_ONLY
189 SOURCE += oslib/getopt_long.c
191 ifndef CONFIG_INET_ATON
192 SOURCE += oslib/inet_aton.c
194 ifndef CONFIG_HAVE_STATX
195 SOURCE += oslib/statx.c
198 SOURCE += engines/glusterfs.c
199 SOURCE += engines/glusterfs_sync.c
200 SOURCE += engines/glusterfs_async.c
201 LIBS += -lgfapi -lglusterfs
202 ifdef CONFIG_GF_FADVISE
203 FIO_CFLAGS += "-DGFAPI_USE_FADVISE"
207 SOURCE += engines/mtd.c
208 SOURCE += oslib/libmtd.c
209 SOURCE += oslib/libmtd_legacy.c
212 pmemblk_SRCS = engines/pmemblk.c
213 pmemblk_LIBS = -lpmemblk
216 ifdef CONFIG_LINUX_DEVDAX
217 dev-dax_SRCS = engines/dev-dax.c
218 dev-dax_LIBS = -lpmem
222 libpmem_SRCS = engines/libpmem.c
223 libpmem_LIBS = -lpmem
227 SOURCE += engines/ime.c
230 libzbc_SRCS = engines/libzbc.c
234 ifdef CONFIG_LIBXNVME
235 xnvme_SRCS = engines/xnvme.c
236 xnvme_LIBS = $(LIBXNVME_LIBS)
237 xnvme_CFLAGS = $(LIBXNVME_CFLAGS)
240 ifdef CONFIG_LIBBLKIO
241 libblkio_SRCS = engines/libblkio.c
242 libblkio_LIBS = $(LIBBLKIO_LIBS)
243 libblkio_CFLAGS = $(LIBBLKIO_CFLAGS)
246 ifeq ($(CONFIG_TARGET_OS), Linux)
247 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
248 oslib/linux-dev-lookup.c engines/io_uring.c engines/nvme.c
249 cmdprio_SRCS = engines/cmdprio.c
250 ifdef CONFIG_HAS_BLKZONED
251 SOURCE += oslib/linux-blkzoned.c
253 LIBS += -lpthread -ldl
256 ifeq ($(CONFIG_TARGET_OS), Android)
257 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
258 oslib/linux-dev-lookup.c engines/io_uring.c engines/nvme.c \
260 cmdprio_SRCS = engines/cmdprio.c
261 ifdef CONFIG_HAS_BLKZONED
262 SOURCE += oslib/linux-blkzoned.c
267 ifeq ($(CONFIG_TARGET_OS), SunOS)
268 LIBS += -lpthread -ldl
269 CPPFLAGS += -D__EXTENSIONS__
271 ifeq ($(CONFIG_TARGET_OS), FreeBSD)
273 LIBS += -lpthread -lrt
276 ifeq ($(CONFIG_TARGET_OS), OpenBSD)
280 ifeq ($(CONFIG_TARGET_OS), NetBSD)
281 LIBS += -lpthread -lrt
284 ifeq ($(CONFIG_TARGET_OS), DragonFly)
286 LIBS += -lpthread -lrt
289 ifeq ($(CONFIG_TARGET_OS), AIX)
290 LIBS += -lpthread -ldl -lrt
291 CPPFLAGS += -D_LARGE_FILES -D__ppc__
292 LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
294 ifeq ($(CONFIG_TARGET_OS), HP-UX)
295 LIBS += -lpthread -ldl -lrt
296 FIO_CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
298 ifeq ($(CONFIG_TARGET_OS), Darwin)
299 LIBS += -lpthread -ldl
301 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
302 SOURCE += os/windows/cpu-affinity.c os/windows/posix.c os/windows/dlls.c
303 WINDOWS_OBJS = os/windows/cpu-affinity.o os/windows/posix.o os/windows/dlls.o lib/hweight.o
304 LIBS += -lpthread -lpsapi -lws2_32 -lssp
305 FIO_CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
309 SOURCE += $(cmdprio_SRCS)
312 ifdef CONFIG_DYNAMIC_ENGINES
313 DYNAMIC_ENGS := $(ENGINES)
314 define engine_template =
315 $(1)_OBJS := $$($(1)_SRCS:.c=.o)
316 $$($(1)_OBJS): CFLAGS := -fPIC $$($(1)_CFLAGS) $(CFLAGS)
317 engines/fio-$(1).so: $$($(1)_OBJS)
318 $$(QUIET_LINK)$(CC) $(LDFLAGS) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS)
319 ENGS_OBJS += engines/fio-$(1).so
321 else # !CONFIG_DYNAMIC_ENGINES
322 define engine_template =
323 SOURCE += $$($(1)_SRCS)
324 LIBS += $$($(1)_LIBS)
325 override CFLAGS += $$($(1)_CFLAGS)
329 FIO-VERSION-FILE: FORCE
330 @$(SHELL) $(SRCDIR)/FIO-VERSION-GEN
331 -include FIO-VERSION-FILE
333 override CFLAGS := -DFIO_VERSION='"$(FIO_VERSION)"' $(FIO_CFLAGS) $(CFLAGS)
335 $(foreach eng,$(ENGINES),$(eval $(call engine_template,$(eng))))
337 OBJS := $(SOURCE:.c=.o)
339 FIO_OBJS = $(OBJS) fio.o
341 GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \
342 gclient.o gcompat.o cairo_text_helpers.o printing.o
344 ifdef CONFIG_ARITHMETIC
345 FIO_OBJS += lex.yy.o y.tab.o
346 GFIO_OBJS += lex.yy.o y.tab.o
349 -include $(OBJS:.o=.d)
351 T_SMALLOC_OBJS = t/stest.o
352 T_SMALLOC_OBJS += gettime.o fio_sem.o pshared.o smalloc.o t/log.o t/debug.o \
354 T_SMALLOC_PROGS = t/stest
356 T_IEEE_OBJS = t/ieee754.o
357 T_IEEE_OBJS += lib/ieee754.o
358 T_IEEE_PROGS = t/ieee754
360 T_ZIPF_OBS = t/genzipf.o
361 T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
362 lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
364 T_ZIPF_PROGS = t/fio-genzipf
366 T_AXMAP_OBJS = t/axmap.o
367 T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
368 T_AXMAP_PROGS = t/axmap
370 T_LFSR_TEST_OBJS = t/lfsr-test.o
371 T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o fio_sem.o pshared.o \
372 t/log.o t/debug.o t/arch.o
373 T_LFSR_TEST_PROGS = t/lfsr-test
375 T_GEN_RAND_OBJS = t/gen-rand.o
376 T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
377 oslib/strcasestr.o oslib/strndup.o
378 T_GEN_RAND_PROGS = t/gen-rand
380 ifeq ($(CONFIG_TARGET_OS), Linux)
381 T_BTRACE_FIO_OBJS = t/btrace2fio.o
382 T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o oslib/linux-dev-lookup.o
383 T_BTRACE_FIO_PROGS = t/fio-btrace2fio
386 T_DEDUPE_OBJS = t/dedupe.o
387 T_DEDUPE_OBJS += lib/rbtree.o t/log.o fio_sem.o pshared.o smalloc.o gettime.o \
388 crc/md5.o lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o \
389 t/arch.o crc/murmur3.o crc/crc32c.o crc/crc32c-intel.o \
390 crc/crc32c-arm64.o crc/fnv.o
391 T_DEDUPE_PROGS = t/fio-dedupe
393 T_VS_OBJS = t/verify-state.o t/log.o crc/crc32c.o crc/crc32c-intel.o crc/crc32c-arm64.o t/debug.o
394 T_VS_PROGS = t/fio-verify-state
396 T_PIPE_ASYNC_OBJS = t/read-to-pipe-async.o
397 T_PIPE_ASYNC_PROGS = t/read-to-pipe-async
399 T_IOU_RING_OBJS = t/io_uring.o lib/rand.o lib/pattern.o lib/strntol.o
400 T_IOU_RING_PROGS = t/io_uring
402 T_MEMLOCK_OBJS = t/memlock.o
403 T_MEMLOCK_PROGS = t/memlock
405 T_TT_OBJS = t/time-test.o
406 T_TT_PROGS = t/time-test
408 ifneq (,$(findstring -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION,$(CFLAGS)))
409 T_FUZZ_OBJS = t/fuzz/fuzz_parseini.o
410 T_FUZZ_OBJS += $(OBJS)
411 ifdef CONFIG_ARITHMETIC
412 T_FUZZ_OBJS += lex.yy.o y.tab.o
414 # For proper fio code teardown CFLAGS needs to include -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
415 # in case there is no fuzz driver defined by environment variable LIB_FUZZING_ENGINE, use a simple one
416 # For instance, with compiler clang, address sanitizer and libFuzzer as a fuzzing engine, you should define
417 # export CFLAGS="-fsanitize=address,fuzzer-no-link -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
418 # export LIB_FUZZING_ENGINE="-fsanitize=address"
420 # before running configure && make
421 # You can adapt this with different compilers, sanitizers, and fuzzing engines
422 ifndef LIB_FUZZING_ENGINE
423 T_FUZZ_OBJS += t/fuzz/onefile.o
425 T_FUZZ_PROGS = t/fuzz/fuzz_parseini
426 else # CFLAGS includes -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
431 T_OBJS = $(T_SMALLOC_OBJS)
432 T_OBJS += $(T_IEEE_OBJS)
433 T_OBJS += $(T_ZIPF_OBJS)
434 T_OBJS += $(T_AXMAP_OBJS)
435 T_OBJS += $(T_LFSR_TEST_OBJS)
436 T_OBJS += $(T_GEN_RAND_OBJS)
437 T_OBJS += $(T_BTRACE_FIO_OBJS)
438 T_OBJS += $(T_DEDUPE_OBJS)
439 T_OBJS += $(T_VS_OBJS)
440 T_OBJS += $(T_PIPE_ASYNC_OBJS)
441 T_OBJS += $(T_MEMLOCK_OBJS)
442 T_OBJS += $(T_TT_OBJS)
443 T_OBJS += $(T_IOU_RING_OBJS)
444 T_OBJS += $(T_FUZZ_OBJS)
446 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
447 T_DEDUPE_OBJS += $(WINDOWS_OBJS)
448 T_SMALLOC_OBJS += $(WINDOWS_OBJS)
449 T_LFSR_TEST_OBJS += $(WINDOWS_OBJS)
452 T_TEST_PROGS = $(T_SMALLOC_PROGS)
453 T_TEST_PROGS += $(T_IEEE_PROGS)
454 T_PROGS += $(T_ZIPF_PROGS)
455 T_TEST_PROGS += $(T_AXMAP_PROGS)
456 T_TEST_PROGS += $(T_LFSR_TEST_PROGS)
457 T_TEST_PROGS += $(T_GEN_RAND_PROGS)
458 T_PROGS += $(T_BTRACE_FIO_PROGS)
460 T_PROGS += $(T_DEDUPE_PROGS)
462 T_PROGS += $(T_VS_PROGS)
463 T_TEST_PROGS += $(T_MEMLOCK_PROGS)
465 T_TEST_PROGS += $(T_PIPE_ASYNC_PROGS)
467 ifneq (,$(findstring Linux,$(CONFIG_TARGET_OS)))
468 T_TEST_PROGS += $(T_IOU_RING_PROGS)
470 T_TEST_PROGS += $(T_FUZZ_PROGS)
474 ifdef CONFIG_HAVE_CUNIT
475 UT_OBJS = unittests/unittest.o
476 UT_OBJS += unittests/lib/memalign.o
477 UT_OBJS += unittests/lib/num2str.o
478 UT_OBJS += unittests/lib/strntol.o
479 UT_OBJS += unittests/oslib/strlcat.o
480 UT_OBJS += unittests/oslib/strndup.o
481 UT_OBJS += unittests/oslib/strcasestr.o
482 UT_OBJS += unittests/oslib/strsep.o
483 UT_TARGET_OBJS = lib/memalign.o
484 UT_TARGET_OBJS += lib/num2str.o
485 UT_TARGET_OBJS += lib/strntol.o
486 UT_TARGET_OBJS += oslib/strlcat.o
487 UT_TARGET_OBJS += oslib/strndup.o
488 UT_TARGET_OBJS += oslib/strcasestr.o
489 UT_TARGET_OBJS += oslib/strsep.o
490 UT_PROGS = unittests/unittest
497 ifneq ($(findstring $(MAKEFLAGS),s),s)
499 QUIET_CC = @echo ' ' CC $@;
500 QUIET_LINK = @echo ' ' LINK $@;
501 QUIET_DEP = @echo ' ' DEP $@;
502 QUIET_YACC = @echo ' ' YACC $@;
503 QUIET_LEX = @echo ' ' LEX $@;
507 ifeq ($(CONFIG_TARGET_OS), SunOS)
512 prefix = $(INSTALL_PREFIX)
513 bindir = $(prefix)/bin
514 libdir = $(prefix)/lib/fio
516 ifeq ($(CONFIG_TARGET_OS), Darwin)
517 mandir = /usr/share/man
518 sharedir = /usr/share/fio
520 mandir = $(prefix)/man
521 sharedir = $(prefix)/share/fio
524 all: $(PROGS) $(T_TEST_PROGS) $(UT_PROGS) $(SCRIPTS) $(ENGS_OBJS) FORCE
526 .PHONY: all install clean test
531 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
532 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
534 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
535 @if type -p fmt >/dev/null 2>&1; then \
536 sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
537 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d; \
539 sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | \
540 tr -cs "[:graph:]" "\n" | \
541 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d; \
545 ifdef CONFIG_ARITHMETIC
546 lex.yy.c: exp/expression-parser.l
547 ifdef CONFIG_LEX_USE_O
548 $(QUIET_LEX)$(LEX) -o $@ $<
550 $(QUIET_LEX)$(LEX) $<
553 ifneq (,$(findstring -Wimplicit-fallthrough,$(CFLAGS)))
554 LEX_YY_CFLAGS := -Wno-implicit-fallthrough
557 ifdef CONFIG_HAVE_NO_STRINGOP
558 YTAB_YY_CFLAGS := -Wno-stringop-truncation
561 lex.yy.o: lex.yy.c y.tab.h
562 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(LEX_YY_CFLAGS) -c $<
564 y.tab.o: y.tab.c y.tab.h
565 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(YTAB_YY_CFLAGS) -c $<
567 y.tab.c: exp/expression-parser.y
568 $(QUIET_YACC)$(YACC) -o $@ -l -d -b y $<
574 exp/test-expression-parser.o: exp/test-expression-parser.c
575 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
576 exp/test-expression-parser: exp/test-expression-parser.o
577 $(QUIET_LINK)$(CC) $(LDFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS)
579 parse.o: lex.yy.o y.tab.o
582 init.o: init.c FIO-VERSION-FILE
584 gcompat.o: gcompat.c gcompat.h
585 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
587 goptions.o: goptions.c goptions.h
588 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
590 ghelpers.o: ghelpers.c ghelpers.h
591 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
593 gerror.o: gerror.c gerror.h
594 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
596 gclient.o: gclient.c gclient.h
597 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
599 gfio.o: gfio.c ghelpers.c
600 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
602 graph.o: graph.c graph.h
603 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
605 cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
606 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
608 printing.o: printing.c printing.h
609 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
611 t/io_uring.o: os/linux/io_uring.h
612 t/io_uring: $(T_IOU_RING_OBJS)
613 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_IOU_RING_OBJS) $(LIBS)
615 t/read-to-pipe-async: $(T_PIPE_ASYNC_OBJS)
616 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_PIPE_ASYNC_OBJS) $(LIBS)
618 t/memlock: $(T_MEMLOCK_OBJS)
619 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_MEMLOCK_OBJS) $(LIBS)
621 t/stest: $(T_SMALLOC_OBJS)
622 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS)
624 t/ieee754: $(T_IEEE_OBJS)
625 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS)
628 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB)
630 t/fuzz/fuzz_parseini: $(T_FUZZ_OBJS)
631 ifndef LIB_FUZZING_ENGINE
632 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_FUZZ_OBJS) $(LIBS) $(HDFSLIB)
634 $(QUIET_LINK)$(CXX) $(LDFLAGS) -o $@ $(T_FUZZ_OBJS) $(LIB_FUZZING_ENGINE) $(LIBS) $(HDFSLIB)
638 $(QUIET_LINK)$(CC) $(filter-out -static, $(LDFLAGS)) -o gfio $(GFIO_OBJS) $(LIBS) $(GFIO_LIBS) $(GTK_LDFLAGS) $(HDFSLIB)
640 t/fio-genzipf: $(T_ZIPF_OBJS)
641 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS)
643 t/axmap: $(T_AXMAP_OBJS)
644 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS)
646 t/lfsr-test: $(T_LFSR_TEST_OBJS)
647 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
649 t/gen-rand: $(T_GEN_RAND_OBJS)
650 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_GEN_RAND_OBJS) $(LIBS)
652 ifeq ($(CONFIG_TARGET_OS), Linux)
653 t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS)
654 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
658 t/fio-dedupe: $(T_DEDUPE_OBJS)
659 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS)
662 t/fio-verify-state: $(T_VS_OBJS)
663 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_VS_OBJS) $(LIBS)
665 t/time-test: $(T_TT_OBJS)
666 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_TT_OBJS) $(LIBS)
668 ifdef CONFIG_HAVE_CUNIT
669 unittests/unittest: $(UT_OBJS) $(UT_TARGET_OBJS)
670 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit $(LIBS)
674 @rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(UT_OBJS) $(PROGS) $(T_PROGS) $(T_TEST_PROGS) core.* core gfio unittests/unittest FIO-VERSION-FILE *.[do] lib/*.d oslib/*.[do] crc/*.d engines/*.[do] engines/*.so profiles/*.[do] t/*.[do] t/*/*.[do] unittests/*.[do] unittests/*/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h
675 @rm -f t/fio-btrace2fio t/io_uring t/read-to-pipe-async
678 distclean: clean FORCE
679 @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf fiologparser_hist.pdf
684 tools/plot/fio2gnuplot.1:
685 @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1
687 doc: tools/plot/fio2gnuplot.1
688 @man -t ./fio.1 | ps2pdf - fio.pdf
689 @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf
690 @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
691 @man -t tools/hist/fiologparser_hist.py.1 | ps2pdf - fiologparser_hist.pdf
694 ./fio --minimal --thread --exitall_on_error --runtime=1s --name=nulltest --ioengine=null --rw=randrw --iodepth=2 --norandommap --random_generator=tausworthe64 --size=16T --name=verifyfstest --filename=fiotestfile.tmp --unlink=1 --rw=write --verify=crc32c --verify_state_save=0 --size=16K
697 sudo modprobe null_blk && \
698 if [ ! -e /usr/include/libzbc/zbc.h ]; then \
699 git clone https://github.com/westerndigitalcorporation/libzbc && \
702 ./configure --prefix=/usr && \
706 sudo t/zbd/run-tests-against-nullb -s 1 && \
707 if [ -e /sys/module/null_blk/parameters/zoned ]; then \
708 sudo t/zbd/run-tests-against-nullb -s 2; \
709 sudo t/zbd/run-tests-against-nullb -s 4; \
712 install: $(PROGS) $(SCRIPTS) $(ENGS_OBJS) tools/plot/fio2gnuplot.1 FORCE
713 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
714 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
715 ifdef CONFIG_DYNAMIC_ENGINES
716 $(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
717 $(INSTALL) -m 755 $(SRCDIR)/engines/*.so $(DESTDIR)$(libdir)
719 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
720 $(INSTALL) -m 644 $(SRCDIR)/fio.1 $(DESTDIR)$(mandir)/man1
721 $(INSTALL) -m 644 $(SRCDIR)/tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
722 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1
723 $(INSTALL) -m 644 $(SRCDIR)/tools/hist/fiologparser_hist.py.1 $(DESTDIR)$(mandir)/man1
724 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
725 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/*gpm $(DESTDIR)$(sharedir)/
727 .PHONY: test fulltest