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
31 FIO_CFLAGS += -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
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)
47 SOURCE := $(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
48 $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/lib/*.c))) \
49 gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
50 eta.c verify.c memory.c io_u.c parse.c fio_sem.c rwlock.c \
52 smalloc.c filehash.c profile.c debug.c engines/cpu.c \
53 engines/mmap.c engines/sync.c engines/null.c engines/net.c \
54 engines/ftruncate.c engines/filecreate.c engines/filestat.c \
55 server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \
56 gettime-thread.c helpers.c json.c idletime.c td_error.c \
57 profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
58 workqueue.c rate-submit.c optgroup.c helper_thread.c \
59 steadystate.c zone-dist.c zbd.c
62 HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
63 HDFSLIB= -Wl,-rpath $(JAVA_HOME)/lib/$(FIO_HDFS_CPU)/server -L$(JAVA_HOME)/lib/$(FIO_HDFS_CPU)/server $(FIO_LIBHDFS_LIB)/libhdfs.a -ljvm
64 FIO_CFLAGS += $(HDFSFLAGS)
65 SOURCE += engines/libhdfs.c
69 libiscsi_SRCS = engines/libiscsi.c
70 libiscsi_LIBS = $(LIBISCSI_LIBS)
71 libiscsi_CFLAGS = $(LIBISCSI_CFLAGS)
76 nbd_SRCS = engines/nbd.c
77 nbd_LIBS = $(LIBNBD_LIBS)
78 nbd_CFLAGS = $(LIBNBD_CFLAGS)
83 CPPFLAGS += -DBITS_PER_LONG=64
84 else ifdef CONFIG_32BIT
85 CPPFLAGS += -DBITS_PER_LONG=32
88 libaio_SRCS = engines/libaio.c
93 rdma_SRCS = engines/rdma.c
94 rdma_LIBS = -libverbs -lrdmacm
97 ifdef CONFIG_LIBRPMA_APM
98 librpma_apm_SRCS = engines/librpma_apm.c
99 librpma_fio_SRCS = engines/librpma_fio.c
100 librpma_apm_LIBS = -lrpma -lpmem
101 ENGINES += librpma_apm
103 ifdef CONFIG_LIBRPMA_GPSPM
104 librpma_gpspm_SRCS = engines/librpma_gpspm.c engines/librpma_gpspm_flush.pb-c.c
105 librpma_fio_SRCS = engines/librpma_fio.c
106 librpma_gpspm_LIBS = -lrpma -lpmem -lprotobuf-c
107 ENGINES += librpma_gpspm
109 ifdef librpma_fio_SRCS
110 SOURCE += $(librpma_fio_SRCS)
112 ifdef CONFIG_POSIXAIO
113 SOURCE += engines/posixaio.c
115 ifdef CONFIG_LINUX_FALLOCATE
116 SOURCE += engines/falloc.c
118 ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
119 SOURCE += engines/e4defrag.c
121 ifdef CONFIG_LIBCUFILE
122 SOURCE += engines/libcufile.c
124 ifdef CONFIG_LINUX_SPLICE
125 SOURCE += engines/splice.c
127 ifdef CONFIG_SOLARISAIO
128 SOURCE += engines/solarisaio.c
130 ifdef CONFIG_WINDOWSAIO
131 SOURCE += engines/windowsaio.c
134 rados_SRCS = engines/rados.c
139 rbd_SRCS = engines/rbd.c
140 rbd_LIBS = -lrbd -lrados
144 http_SRCS = engines/http.c
145 http_LIBS = -lcurl -lssl -lcrypto
149 dfs_SRCS = engines/dfs.c
150 dfs_LIBS = -luuid -ldaos -ldfs
153 SOURCE += oslib/asprintf.c
155 SOURCE += oslib/strsep.c
157 ifndef CONFIG_STRCASESTR
158 SOURCE += oslib/strcasestr.c
160 ifndef CONFIG_STRLCAT
161 SOURCE += oslib/strlcat.c
163 ifndef CONFIG_HAVE_STRNDUP
164 SOURCE += oslib/strndup.c
166 ifndef CONFIG_GETOPT_LONG_ONLY
167 SOURCE += oslib/getopt_long.c
169 ifndef CONFIG_INET_ATON
170 SOURCE += oslib/inet_aton.c
172 ifndef CONFIG_HAVE_STATX
173 SOURCE += oslib/statx.c
176 SOURCE += engines/glusterfs.c
177 SOURCE += engines/glusterfs_sync.c
178 SOURCE += engines/glusterfs_async.c
179 LIBS += -lgfapi -lglusterfs
180 ifdef CONFIG_GF_FADVISE
181 FIO_CFLAGS += "-DGFAPI_USE_FADVISE"
185 SOURCE += engines/mtd.c
186 SOURCE += oslib/libmtd.c
187 SOURCE += oslib/libmtd_legacy.c
190 pmemblk_SRCS = engines/pmemblk.c
191 pmemblk_LIBS = -lpmemblk
194 ifdef CONFIG_LINUX_DEVDAX
195 dev-dax_SRCS = engines/dev-dax.c
196 dev-dax_LIBS = -lpmem
200 libpmem_SRCS = engines/libpmem.c
201 libpmem_LIBS = -lpmem
205 SOURCE += engines/ime.c
208 libzbc_SRCS = engines/libzbc.c
213 ifeq ($(CONFIG_TARGET_OS), Linux)
214 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
215 oslib/linux-dev-lookup.c engines/io_uring.c
216 ifdef CONFIG_HAS_BLKZONED
217 SOURCE += oslib/linux-blkzoned.c
219 LIBS += -lpthread -ldl
222 ifeq ($(CONFIG_TARGET_OS), Android)
223 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
224 oslib/linux-dev-lookup.c
225 ifdef CONFIG_HAS_BLKZONED
226 SOURCE += oslib/linux-blkzoned.c
231 ifeq ($(CONFIG_TARGET_OS), SunOS)
232 LIBS += -lpthread -ldl
233 CPPFLAGS += -D__EXTENSIONS__
235 ifeq ($(CONFIG_TARGET_OS), FreeBSD)
237 LIBS += -lpthread -lrt
240 ifeq ($(CONFIG_TARGET_OS), OpenBSD)
244 ifeq ($(CONFIG_TARGET_OS), NetBSD)
245 LIBS += -lpthread -lrt
248 ifeq ($(CONFIG_TARGET_OS), DragonFly)
250 LIBS += -lpthread -lrt
253 ifeq ($(CONFIG_TARGET_OS), AIX)
254 LIBS += -lpthread -ldl -lrt
255 CPPFLAGS += -D_LARGE_FILES -D__ppc__
256 LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
258 ifeq ($(CONFIG_TARGET_OS), HP-UX)
259 LIBS += -lpthread -ldl -lrt
260 FIO_CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
262 ifeq ($(CONFIG_TARGET_OS), Darwin)
263 LIBS += -lpthread -ldl
265 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
266 SOURCE += os/windows/cpu-affinity.c os/windows/posix.c
267 WINDOWS_OBJS = os/windows/cpu-affinity.o os/windows/posix.o lib/hweight.o
268 LIBS += -lpthread -lpsapi -lws2_32 -lssp
269 FIO_CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
272 ifdef CONFIG_DYNAMIC_ENGINES
273 DYNAMIC_ENGS := $(ENGINES)
274 define engine_template =
275 $(1)_OBJS := $$($(1)_SRCS:.c=.o)
276 $$($(1)_OBJS): CFLAGS := -fPIC $$($(1)_CFLAGS) $(CFLAGS)
277 engines/fio-$(1).so: $$($(1)_OBJS)
278 $$(QUIET_LINK)$(CC) -shared -rdynamic -fPIC -Wl,-soname,fio-$(1).so.1 -o $$@ $$< $$($(1)_LIBS)
279 ENGS_OBJS += engines/fio-$(1).so
281 else # !CONFIG_DYNAMIC_ENGINES
282 define engine_template =
283 SOURCE += $$($(1)_SRCS)
284 LIBS += $$($(1)_LIBS)
285 CFLAGS += $$($(1)_CFLAGS)
289 FIO-VERSION-FILE: FORCE
290 @$(SHELL) $(SRCDIR)/FIO-VERSION-GEN
291 -include FIO-VERSION-FILE
293 override CFLAGS := -DFIO_VERSION='"$(FIO_VERSION)"' $(FIO_CFLAGS) $(CFLAGS)
295 $(foreach eng,$(ENGINES),$(eval $(call engine_template,$(eng))))
297 OBJS := $(SOURCE:.c=.o)
299 FIO_OBJS = $(OBJS) fio.o
301 GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \
302 gclient.o gcompat.o cairo_text_helpers.o printing.o
304 ifdef CONFIG_ARITHMETIC
305 FIO_OBJS += lex.yy.o y.tab.o
306 GFIO_OBJS += lex.yy.o y.tab.o
309 -include $(OBJS:.o=.d)
311 T_SMALLOC_OBJS = t/stest.o
312 T_SMALLOC_OBJS += gettime.o fio_sem.o pshared.o smalloc.o t/log.o t/debug.o \
314 T_SMALLOC_PROGS = t/stest
316 T_IEEE_OBJS = t/ieee754.o
317 T_IEEE_OBJS += lib/ieee754.o
318 T_IEEE_PROGS = t/ieee754
320 T_ZIPF_OBS = t/genzipf.o
321 T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
322 lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
324 T_ZIPF_PROGS = t/fio-genzipf
326 T_AXMAP_OBJS = t/axmap.o
327 T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
328 T_AXMAP_PROGS = t/axmap
330 T_LFSR_TEST_OBJS = t/lfsr-test.o
331 T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o fio_sem.o pshared.o \
332 t/log.o t/debug.o t/arch.o
333 T_LFSR_TEST_PROGS = t/lfsr-test
335 T_GEN_RAND_OBJS = t/gen-rand.o
336 T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
337 oslib/strcasestr.o oslib/strndup.o
338 T_GEN_RAND_PROGS = t/gen-rand
340 ifeq ($(CONFIG_TARGET_OS), Linux)
341 T_BTRACE_FIO_OBJS = t/btrace2fio.o
342 T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o oslib/linux-dev-lookup.o
343 T_BTRACE_FIO_PROGS = t/fio-btrace2fio
346 T_DEDUPE_OBJS = t/dedupe.o
347 T_DEDUPE_OBJS += lib/rbtree.o t/log.o fio_sem.o pshared.o smalloc.o gettime.o \
348 crc/md5.o lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o \
349 t/arch.o crc/murmur3.o crc/crc32c.o crc/crc32c-intel.o \
350 crc/crc32c-arm64.o crc/fnv.o
351 T_DEDUPE_PROGS = t/fio-dedupe
353 T_VS_OBJS = t/verify-state.o t/log.o crc/crc32c.o crc/crc32c-intel.o crc/crc32c-arm64.o t/debug.o
354 T_VS_PROGS = t/fio-verify-state
356 T_PIPE_ASYNC_OBJS = t/read-to-pipe-async.o
357 T_PIPE_ASYNC_PROGS = t/read-to-pipe-async
359 T_IOU_RING_OBJS = t/io_uring.o
360 T_IOU_RING_OBJS += t/arch.o
361 T_IOU_RING_PROGS = t/io_uring
363 T_MEMLOCK_OBJS = t/memlock.o
364 T_MEMLOCK_PROGS = t/memlock
366 T_TT_OBJS = t/time-test.o
367 T_TT_PROGS = t/time-test
369 T_FUZZ_OBJS = t/fuzz/fuzz_parseini.o
370 T_FUZZ_OBJS += $(OBJS)
371 ifdef CONFIG_ARITHMETIC
372 T_FUZZ_OBJS += lex.yy.o y.tab.o
374 # in case there is no fuzz driver defined by environment variable LIB_FUZZING_ENGINE, use a simple one
375 # For instance, with compiler clang, address sanitizer and libFuzzer as a fuzzing engine, you should define
376 # export CFLAGS="-fsanitize=address,fuzzer-no-link"
377 # export LIB_FUZZING_ENGINE="-fsanitize=address"
379 # before running configure && make
380 # You can adapt this with different compilers, sanitizers, and fuzzing engines
381 ifndef LIB_FUZZING_ENGINE
382 T_FUZZ_OBJS += t/fuzz/onefile.o
384 T_FUZZ_PROGS = t/fuzz/fuzz_parseini
386 T_OBJS = $(T_SMALLOC_OBJS)
387 T_OBJS += $(T_IEEE_OBJS)
388 T_OBJS += $(T_ZIPF_OBJS)
389 T_OBJS += $(T_AXMAP_OBJS)
390 T_OBJS += $(T_LFSR_TEST_OBJS)
391 T_OBJS += $(T_GEN_RAND_OBJS)
392 T_OBJS += $(T_BTRACE_FIO_OBJS)
393 T_OBJS += $(T_DEDUPE_OBJS)
394 T_OBJS += $(T_VS_OBJS)
395 T_OBJS += $(T_PIPE_ASYNC_OBJS)
396 T_OBJS += $(T_MEMLOCK_OBJS)
397 T_OBJS += $(T_TT_OBJS)
398 T_OBJS += $(T_IOU_RING_OBJS)
399 T_OBJS += $(T_FUZZ_OBJS)
401 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
402 T_DEDUPE_OBJS += $(WINDOWS_OBJS)
403 T_SMALLOC_OBJS += $(WINDOWS_OBJS)
404 T_LFSR_TEST_OBJS += $(WINDOWS_OBJS)
407 T_TEST_PROGS = $(T_SMALLOC_PROGS)
408 T_TEST_PROGS += $(T_IEEE_PROGS)
409 T_PROGS += $(T_ZIPF_PROGS)
410 T_TEST_PROGS += $(T_AXMAP_PROGS)
411 T_TEST_PROGS += $(T_LFSR_TEST_PROGS)
412 T_TEST_PROGS += $(T_GEN_RAND_PROGS)
413 T_PROGS += $(T_BTRACE_FIO_PROGS)
414 T_PROGS += $(T_DEDUPE_PROGS)
415 T_PROGS += $(T_VS_PROGS)
416 T_TEST_PROGS += $(T_MEMLOCK_PROGS)
418 T_TEST_PROGS += $(T_PIPE_ASYNC_PROGS)
420 ifneq (,$(findstring Linux,$(CONFIG_TARGET_OS)))
421 T_TEST_PROGS += $(T_IOU_RING_PROGS)
423 T_TEST_PROGS += $(T_FUZZ_PROGS)
427 ifdef CONFIG_HAVE_CUNIT
428 UT_OBJS = unittests/unittest.o
429 UT_OBJS += unittests/lib/memalign.o
430 UT_OBJS += unittests/lib/num2str.o
431 UT_OBJS += unittests/lib/strntol.o
432 UT_OBJS += unittests/oslib/strlcat.o
433 UT_OBJS += unittests/oslib/strndup.o
434 UT_OBJS += unittests/oslib/strcasestr.o
435 UT_OBJS += unittests/oslib/strsep.o
436 UT_TARGET_OBJS = lib/memalign.o
437 UT_TARGET_OBJS += lib/num2str.o
438 UT_TARGET_OBJS += lib/strntol.o
439 UT_TARGET_OBJS += oslib/strlcat.o
440 UT_TARGET_OBJS += oslib/strndup.o
441 UT_TARGET_OBJS += oslib/strcasestr.o
442 UT_TARGET_OBJS += oslib/strsep.o
443 UT_PROGS = unittests/unittest
450 ifneq ($(findstring $(MAKEFLAGS),s),s)
452 QUIET_CC = @echo ' ' CC $@;
453 QUIET_LINK = @echo ' ' LINK $@;
454 QUIET_DEP = @echo ' ' DEP $@;
455 QUIET_YACC = @echo ' ' YACC $@;
456 QUIET_LEX = @echo ' ' LEX $@;
460 ifeq ($(CONFIG_TARGET_OS), SunOS)
465 prefix = $(INSTALL_PREFIX)
466 bindir = $(prefix)/bin
467 libdir = $(prefix)/lib/fio
469 ifeq ($(CONFIG_TARGET_OS), Darwin)
470 mandir = /usr/share/man
471 sharedir = /usr/share/fio
473 mandir = $(prefix)/man
474 sharedir = $(prefix)/share/fio
477 all: $(PROGS) $(T_TEST_PROGS) $(UT_PROGS) $(SCRIPTS) $(ENGS_OBJS) FORCE
479 .PHONY: all install clean test
484 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
485 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
487 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
488 @if type -p fmt >/dev/null 2>&1; then \
489 sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
490 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d; \
492 sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | \
493 tr -cs "[:graph:]" "\n" | \
494 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d; \
498 ifdef CONFIG_ARITHMETIC
499 lex.yy.c: exp/expression-parser.l
500 ifdef CONFIG_LEX_USE_O
501 $(QUIET_LEX)$(LEX) -o $@ $<
503 $(QUIET_LEX)$(LEX) $<
506 lex.yy.o: lex.yy.c y.tab.h
507 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
509 y.tab.o: y.tab.c y.tab.h
510 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
512 y.tab.c: exp/expression-parser.y
513 $(QUIET_YACC)$(YACC) -o $@ -l -d -b y $<
519 exp/test-expression-parser.o: exp/test-expression-parser.c
520 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
521 exp/test-expression-parser: exp/test-expression-parser.o
522 $(QUIET_LINK)$(CC) $(LDFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS)
524 parse.o: lex.yy.o y.tab.o
527 init.o: init.c FIO-VERSION-FILE
529 gcompat.o: gcompat.c gcompat.h
530 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
532 goptions.o: goptions.c goptions.h
533 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
535 ghelpers.o: ghelpers.c ghelpers.h
536 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
538 gerror.o: gerror.c gerror.h
539 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
541 gclient.o: gclient.c gclient.h
542 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
544 gfio.o: gfio.c ghelpers.c
545 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
547 graph.o: graph.c graph.h
548 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
550 cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
551 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
553 printing.o: printing.c printing.h
554 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
556 t/io_uring.o: os/linux/io_uring.h
557 t/io_uring: $(T_IOU_RING_OBJS)
558 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_IOU_RING_OBJS) $(LIBS)
560 t/read-to-pipe-async: $(T_PIPE_ASYNC_OBJS)
561 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_PIPE_ASYNC_OBJS) $(LIBS)
563 t/memlock: $(T_MEMLOCK_OBJS)
564 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_MEMLOCK_OBJS) $(LIBS)
566 t/stest: $(T_SMALLOC_OBJS)
567 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS)
569 t/ieee754: $(T_IEEE_OBJS)
570 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS)
573 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB)
575 t/fuzz/fuzz_parseini: $(T_FUZZ_OBJS)
576 ifndef LIB_FUZZING_ENGINE
577 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_FUZZ_OBJS) $(LIBS) $(HDFSLIB)
579 $(QUIET_LINK)$(CXX) $(LDFLAGS) -o $@ $(T_FUZZ_OBJS) $(LIB_FUZZING_ENGINE) $(LIBS) $(HDFSLIB)
583 $(QUIET_LINK)$(CC) $(filter-out -static, $(LDFLAGS)) -o gfio $(GFIO_OBJS) $(LIBS) $(GFIO_LIBS) $(GTK_LDFLAGS) $(HDFSLIB)
585 t/fio-genzipf: $(T_ZIPF_OBJS)
586 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS)
588 t/axmap: $(T_AXMAP_OBJS)
589 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS)
591 t/lfsr-test: $(T_LFSR_TEST_OBJS)
592 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
594 t/gen-rand: $(T_GEN_RAND_OBJS)
595 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_GEN_RAND_OBJS) $(LIBS)
597 ifeq ($(CONFIG_TARGET_OS), Linux)
598 t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS)
599 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
602 t/fio-dedupe: $(T_DEDUPE_OBJS)
603 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS)
605 t/fio-verify-state: $(T_VS_OBJS)
606 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_VS_OBJS) $(LIBS)
608 t/time-test: $(T_TT_OBJS)
609 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(T_TT_OBJS) $(LIBS)
611 ifdef CONFIG_HAVE_CUNIT
612 unittests/unittest: $(UT_OBJS) $(UT_TARGET_OBJS)
613 $(QUIET_LINK)$(CC) $(LDFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit $(LIBS)
617 @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] unittests/*.[do] unittests/*/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h
618 @rm -f t/fio-btrace2fio t/io_uring t/read-to-pipe-async
621 distclean: clean FORCE
622 @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf fiologparser_hist.pdf
627 tools/plot/fio2gnuplot.1:
628 @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1
630 doc: tools/plot/fio2gnuplot.1
631 @man -t ./fio.1 | ps2pdf - fio.pdf
632 @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf
633 @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
634 @man -t tools/hist/fiologparser_hist.py.1 | ps2pdf - fiologparser_hist.pdf
637 ./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
640 sudo modprobe null_blk && \
641 if [ ! -e /usr/include/libzbc/zbc.h ]; then \
642 git clone https://github.com/hgst/libzbc && \
645 ./configure --prefix=/usr && \
649 sudo t/zbd/run-tests-against-nullb -s 1 && \
650 if [ -e /sys/module/null_blk/parameters/zoned ]; then \
651 sudo t/zbd/run-tests-against-nullb -s 2; \
652 sudo t/zbd/run-tests-against-nullb -s 4; \
655 install: $(PROGS) $(SCRIPTS) $(ENGS_OBJS) tools/plot/fio2gnuplot.1 FORCE
656 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
657 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
658 ifdef CONFIG_DYNAMIC_ENGINES
659 $(INSTALL) -m 755 -d $(DESTDIR)$(libdir)
660 $(INSTALL) -m 755 $(SRCDIR)/engines/*.so $(DESTDIR)$(libdir)
662 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
663 $(INSTALL) -m 644 $(SRCDIR)/fio.1 $(DESTDIR)$(mandir)/man1
664 $(INSTALL) -m 644 $(SRCDIR)/tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
665 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1
666 $(INSTALL) -m 644 $(SRCDIR)/tools/hist/fiologparser_hist.py.1 $(DESTDIR)$(mandir)/man1
667 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
668 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/*gpm $(DESTDIR)$(sharedir)/
670 .PHONY: test fulltest