init: use __log_buf() if we know buf != NULL
[fio.git] / Makefile
CommitLineData
c61a3a44
JF
1ifeq ($(SRCDIR),)
2SRCDIR := .
3endif
4
5VPATH := $(SRCDIR)
6
84546b83
BVA
7all: fio
8
9config-host.mak: configure
10 @if [ ! -e "$@" ]; then \
11 echo "Running configure ..."; \
12 ./configure; \
13 else \
14 echo "$@ is out-of-date, running configure"; \
15 sed -n "/.*Configured with/s/[^:]*: //p" "$@" | sh; \
16 fi
17
d443abcf 18ifneq ($(MAKECMDGOALS),clean)
67bf9823
JA
19include config-host.mak
20endif
21
0d60927f 22DEBUGFLAGS = -DFIO_INC_DEBUG
9195552e 23CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS)
61054f0d 24OPTFLAGS= -g -ffast-math
c61a3a44 25CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR)
af4862b3
JA
26LIBS += -lm $(EXTLIBS)
27PROGS = fio
afe8d310 28SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/hist/fiologparser_hist.py tools/fio_jsonplus_clat2csv)
af4862b3 29
61054f0d 30ifndef CONFIG_FIO_NO_OPT
0d60927f 31 CFLAGS += -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
61054f0d 32endif
a817dc3b
JA
33ifdef CONFIG_BUILD_NATIVE
34 CFLAGS += -march=native
35endif
61054f0d 36
91f94d5b
JA
37ifdef CONFIG_GFIO
38 PROGS += gfio
39endif
40
785e49c6
BW
41SOURCE := $(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
42 $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/lib/*.c))) \
e2d53995 43 gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \
971caeb1 44 eta.c verify.c memory.c io_u.c parse.c fio_sem.c rwlock.c \
ae626d4e 45 pshared.c options.c \
e2d53995 46 smalloc.c filehash.c profile.c debug.c engines/cpu.c \
d48a9799 47 engines/mmap.c engines/sync.c engines/null.c engines/net.c \
1216cc5a 48 engines/ftruncate.c engines/filecreate.c \
e2d53995
JA
49 server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \
50 gettime-thread.c helpers.c json.c idletime.c td_error.c \
aee2ab67 51 profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
16e56d25 52 workqueue.c rate-submit.c optgroup.c helper_thread.c \
07776127 53 steadystate.c zone-dist.c
67bf9823 54
1b10477b
MM
55ifdef CONFIG_LIBHDFS
56 HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE)
3fede220 57 HDFSLIB= -Wl,-rpath $(JAVA_HOME)/jre/lib/$(FIO_HDFS_CPU)/server -L$(JAVA_HOME)/jre/lib/$(FIO_HDFS_CPU)/server $(FIO_LIBHDFS_LIB)/libhdfs.a -ljvm
1b10477b
MM
58 CFLAGS += $(HDFSFLAGS)
59 SOURCE += engines/libhdfs.c
60endif
61
67bf9823
JA
62ifdef CONFIG_64BIT
63 CFLAGS += -DBITS_PER_LONG=64
64endif
65ifdef CONFIG_32BIT
66 CFLAGS += -DBITS_PER_LONG=32
67endif
67bf9823 68ifdef CONFIG_LIBAIO
67bf9823
JA
69 SOURCE += engines/libaio.c
70endif
71ifdef CONFIG_RDMA
67bf9823
JA
72 SOURCE += engines/rdma.c
73endif
74ifdef CONFIG_POSIXAIO
67bf9823
JA
75 SOURCE += engines/posixaio.c
76endif
77ifdef CONFIG_LINUX_FALLOCATE
78 SOURCE += engines/falloc.c
79endif
80ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT
81 SOURCE += engines/e4defrag.c
82endif
83ifdef CONFIG_LINUX_SPLICE
67bf9823
JA
84 SOURCE += engines/splice.c
85endif
86ifdef CONFIG_GUASI
67bf9823
JA
87 SOURCE += engines/guasi.c
88endif
89ifdef CONFIG_FUSION_AW
67bf9823
JA
90 SOURCE += engines/fusion-aw.c
91endif
92ifdef CONFIG_SOLARISAIO
67bf9823
JA
93 SOURCE += engines/solarisaio.c
94endif
4700b234 95ifdef CONFIG_WINDOWSAIO
4700b234
JA
96 SOURCE += engines/windowsaio.c
97endif
d5f9b0ea
IF
98ifdef CONFIG_RADOS
99 SOURCE += engines/rados.c
100endif
fc5c0345
DG
101ifdef CONFIG_RBD
102 SOURCE += engines/rbd.c
103endif
c2f6a13d
LMB
104ifdef CONFIG_HTTP
105 SOURCE += engines/http.c
106endif
44e8e956 107SOURCE += oslib/asprintf.c
67bf9823 108ifndef CONFIG_STRSEP
984f30c9 109 SOURCE += oslib/strsep.c
67bf9823 110endif
9ad8da82 111ifndef CONFIG_STRCASESTR
984f30c9 112 SOURCE += oslib/strcasestr.c
9ad8da82 113endif
5ad7be56 114ifndef CONFIG_STRLCAT
984f30c9 115 SOURCE += oslib/strlcat.c
5ad7be56 116endif
b29c71c4
JA
117ifndef CONFIG_HAVE_STRNDUP
118 SOURCE += oslib/strndup.c
119endif
67bf9823 120ifndef CONFIG_GETOPT_LONG_ONLY
984f30c9 121 SOURCE += oslib/getopt_long.c
67bf9823 122endif
67bf9823 123ifndef CONFIG_INET_ATON
984f30c9 124 SOURCE += oslib/inet_aton.c
67bf9823 125endif
6e7d7dfb 126ifdef CONFIG_GFAPI
127 SOURCE += engines/glusterfs.c
cc47f094 128 SOURCE += engines/glusterfs_sync.c
129 SOURCE += engines/glusterfs_async.c
6fa14b99 130 ifdef CONFIG_GF_FADVISE
131 CFLAGS += "-DGFAPI_USE_FADVISE"
132 endif
6e7d7dfb 133endif
65fa28ca
DE
134ifdef CONFIG_MTD
135 SOURCE += engines/mtd.c
984f30c9
JA
136 SOURCE += oslib/libmtd.c
137 SOURCE += oslib/libmtd_legacy.c
65fa28ca 138endif
43f3cec2
BB
139ifdef CONFIG_PMEMBLK
140 SOURCE += engines/pmemblk.c
141endif
cbb15e42
DJ
142ifdef CONFIG_LINUX_DEVDAX
143 SOURCE += engines/dev-dax.c
144endif
ae0db592
TI
145ifdef CONFIG_LIBPMEM
146 SOURCE += engines/libpmem.c
147endif
a40e7a59
GB
148ifdef CONFIG_IME
149 SOURCE += engines/ime.c
150endif
bfbdd35b
BVA
151ifdef CONFIG_LINUX_BLKZONED
152 SOURCE += zbd.c
153endif
d015e398 154
53cd4eee 155ifeq ($(CONFIG_TARGET_OS), Linux)
67bf9823 156 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
757be0e0 157 oslib/linux-dev-lookup.c
67bf9823 158 LIBS += -lpthread -ldl
213a01b0 159 LDFLAGS += -rdynamic
d015e398 160endif
53cd4eee 161ifeq ($(CONFIG_TARGET_OS), Android)
3714a963 162 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
984f30c9 163 oslib/linux-dev-lookup.c
ec5c6b12
AC
164 LIBS += -ldl
165 LDFLAGS += -rdynamic
ec5c6b12 166endif
53cd4eee 167ifeq ($(CONFIG_TARGET_OS), SunOS)
7366ad05 168 LIBS += -lpthread -ldl
d015e398
BC
169 CPPFLAGS += -D__EXTENSIONS__
170endif
53cd4eee 171ifeq ($(CONFIG_TARGET_OS), FreeBSD)
0bf31987 172 SOURCE += trim.c
d015e398 173 LIBS += -lpthread -lrt
213a01b0 174 LDFLAGS += -rdynamic
d015e398 175endif
3cd4c66f
J
176ifeq ($(CONFIG_TARGET_OS), OpenBSD)
177 LIBS += -lpthread
178 LDFLAGS += -rdynamic
179endif
53cd4eee 180ifeq ($(CONFIG_TARGET_OS), NetBSD)
d015e398 181 LIBS += -lpthread -lrt
213a01b0 182 LDFLAGS += -rdynamic
d015e398 183endif
239b2882 184ifeq ($(CONFIG_TARGET_OS), DragonFly)
c9a4e0c8 185 SOURCE += trim.c
239b2882
JA
186 LIBS += -lpthread -lrt
187 LDFLAGS += -rdynamic
188endif
53cd4eee 189ifeq ($(CONFIG_TARGET_OS), AIX)
d015e398 190 LIBS += -lpthread -ldl -lrt
d015e398 191 CPPFLAGS += -D_LARGE_FILES -D__ppc__
48b35be0 192 LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
d015e398 193endif
53cd4eee 194ifeq ($(CONFIG_TARGET_OS), HP-UX)
b5ffb752 195 LIBS += -lpthread -ldl -lrt
67bf9823 196 CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
c00a2289 197endif
53cd4eee 198ifeq ($(CONFIG_TARGET_OS), Darwin)
d015e398
BC
199 LIBS += -lpthread -ldl
200endif
53cd4eee 201ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
4700b234 202 SOURCE += os/windows/posix.c
93bcfd20 203 LIBS += -lpthread -lpsapi -lws2_32
9aa5fe32 204 CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static
d015e398
BC
205endif
206
c61a3a44 207OBJS := $(SOURCE:.c=.o)
90b7a96d 208
8232e285 209FIO_OBJS = $(OBJS) fio.o
b470a02c 210
7efff409
JA
211GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \
212 gclient.o gcompat.o cairo_text_helpers.o printing.o
213
b470a02c
SC
214ifdef CONFIG_ARITHMETIC
215FIO_OBJS += lex.yy.o y.tab.o
7efff409 216GFIO_OBJS += lex.yy.o y.tab.o
b470a02c
SC
217endif
218
f67d6ee2 219-include $(OBJS:.o=.d)
79d16311 220
61f78f3a 221T_SMALLOC_OBJS = t/stest.o
971caeb1 222T_SMALLOC_OBJS += gettime.o fio_sem.o pshared.o smalloc.o t/log.o t/debug.o \
ae626d4e 223 t/arch.o
61f78f3a
JA
224T_SMALLOC_PROGS = t/stest
225
226T_IEEE_OBJS = t/ieee754.o
84f43c6f 227T_IEEE_OBJS += lib/ieee754.o
61f78f3a
JA
228T_IEEE_PROGS = t/ieee754
229
6ff38856 230T_ZIPF_OBS = t/genzipf.o
2cac8fcb 231T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
df27f9ac
JA
232 lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
233 oslib/strndup.o
aa7bc282 234T_ZIPF_PROGS = t/fio-genzipf
6ff38856 235
ad1f90aa 236T_AXMAP_OBJS = t/axmap.o
07e71598 237T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
ad1f90aa
JA
238T_AXMAP_PROGS = t/axmap
239
7a887ffe 240T_LFSR_TEST_OBJS = t/lfsr-test.o
17031c6d
BVA
241T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o fio_sem.o pshared.o \
242 t/log.o t/debug.o t/arch.o
7a887ffe
AP
243T_LFSR_TEST_PROGS = t/lfsr-test
244
323f2086 245T_GEN_RAND_OBJS = t/gen-rand.o
e91ba49a 246T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
df27f9ac 247 oslib/strcasestr.o oslib/strndup.o
323f2086
JA
248T_GEN_RAND_PROGS = t/gen-rand
249
40bafa33
JA
250ifeq ($(CONFIG_TARGET_OS), Linux)
251T_BTRACE_FIO_OBJS = t/btrace2fio.o
984f30c9 252T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o oslib/linux-dev-lookup.o
aa7bc282 253T_BTRACE_FIO_PROGS = t/fio-btrace2fio
40bafa33
JA
254endif
255
bf481692 256T_DEDUPE_OBJS = t/dedupe.o
971caeb1 257T_DEDUPE_OBJS += lib/rbtree.o t/log.o fio_sem.o pshared.o smalloc.o gettime.o \
ae626d4e
BVA
258 crc/md5.o lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o \
259 t/arch.o crc/murmur3.o crc/crc32c.o crc/crc32c-intel.o \
260 crc/crc32c-arm64.o crc/fnv.o
aa7bc282 261T_DEDUPE_PROGS = t/fio-dedupe
bf481692 262
214e2d56 263T_VS_OBJS = t/verify-state.o t/log.o crc/crc32c.o crc/crc32c-intel.o crc/crc32c-arm64.o t/debug.o
98996ef9
JA
264T_VS_PROGS = t/fio-verify-state
265
6d5a9bc2
JA
266T_PIPE_ASYNC_OBJS = t/read-to-pipe-async.o
267T_PIPE_ASYNC_PROGS = t/read-to-pipe-async
268
ae46d0f5
JA
269T_MEMLOCK_OBJS = t/memlock.o
270T_MEMLOCK_PROGS = t/memlock
271
dcbc7841
VF
272T_TT_OBJS = t/time-test.o
273T_TT_PROGS = t/time-test
274
61f78f3a
JA
275T_OBJS = $(T_SMALLOC_OBJS)
276T_OBJS += $(T_IEEE_OBJS)
6ff38856 277T_OBJS += $(T_ZIPF_OBJS)
ad1f90aa 278T_OBJS += $(T_AXMAP_OBJS)
7a887ffe 279T_OBJS += $(T_LFSR_TEST_OBJS)
323f2086 280T_OBJS += $(T_GEN_RAND_OBJS)
40bafa33 281T_OBJS += $(T_BTRACE_FIO_OBJS)
e5bf5a88 282T_OBJS += $(T_DEDUPE_OBJS)
98996ef9 283T_OBJS += $(T_VS_OBJS)
6d5a9bc2 284T_OBJS += $(T_PIPE_ASYNC_OBJS)
ae46d0f5 285T_OBJS += $(T_MEMLOCK_OBJS)
dcbc7841 286T_OBJS += $(T_TT_OBJS)
6ff38856 287
824d6ff4
BC
288ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
289 T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
290 T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o
291 T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o
292endif
293
aa7bc282
JA
294T_TEST_PROGS = $(T_SMALLOC_PROGS)
295T_TEST_PROGS += $(T_IEEE_PROGS)
6ff38856 296T_PROGS += $(T_ZIPF_PROGS)
aa7bc282
JA
297T_TEST_PROGS += $(T_AXMAP_PROGS)
298T_TEST_PROGS += $(T_LFSR_TEST_PROGS)
323f2086 299T_TEST_PROGS += $(T_GEN_RAND_PROGS)
40bafa33 300T_PROGS += $(T_BTRACE_FIO_PROGS)
e5bf5a88 301T_PROGS += $(T_DEDUPE_PROGS)
98996ef9 302T_PROGS += $(T_VS_PROGS)
e5bf5a88
JA
303
304PROGS += $(T_PROGS)
3427207d 305
4c3ecec4
JA
306ifneq ($(findstring $(MAKEFLAGS),s),s)
307ifndef V
308 QUIET_CC = @echo ' ' CC $@;
79816cf7
JA
309 QUIET_LINK = @echo ' ' LINK $@;
310 QUIET_DEP = @echo ' ' DEP $@;
311 QUIET_YACC = @echo ' ' YACC $@;
312 QUIET_LEX = @echo ' ' LEX $@;
4c3ecec4
JA
313endif
314endif
315
a8168a22
JA
316ifeq ($(CONFIG_TARGET_OS), SunOS)
317 INSTALL = ginstall
318else
319 INSTALL = install
320endif
020d54bd 321prefix = $(INSTALL_PREFIX)
c1d5725e 322bindir = $(prefix)/bin
bcdf7c58 323
53cd4eee 324ifeq ($(CONFIG_TARGET_OS), Darwin)
bcdf7c58 325mandir = /usr/share/man
eab4af4e 326sharedir = /usr/share/fio
bcdf7c58 327else
d60e92d1 328mandir = $(prefix)/man
eab4af4e 329sharedir = $(prefix)/share/fio
bcdf7c58 330endif
c1d5725e 331
aa7bc282 332all: $(PROGS) $(T_TEST_PROGS) $(SCRIPTS) FORCE
f84622e9 333
92ddd6b6 334.PHONY: all install clean test
3d43382c
JA
335.PHONY: FORCE cscope
336
337FIO-VERSION-FILE: FORCE
c61a3a44 338 @$(SHELL) $(SRCDIR)/FIO-VERSION-GEN
3d43382c
JA
339-include FIO-VERSION-FILE
340
7496ea3e 341override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
3d43382c 342
9e85c34e 343%.o : %.c
c61a3a44 344 @mkdir -p $(dir $@)
4feafb1e 345 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
c61a3a44 346 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
f67d6ee2
JA
347 @mv -f $*.d $*.d.tmp
348 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
86fb8d80
TK
349ifeq ($(CONFIG_TARGET_OS), NetBSD)
350 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
351 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
352else
e291cff1 353 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
f67d6ee2 354 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
86fb8d80 355endif
f67d6ee2 356 @rm -f $*.d.tmp
e52947d1 357
b470a02c 358ifdef CONFIG_ARITHMETIC
79816cf7 359lex.yy.c: exp/expression-parser.l
63bda378 360ifdef CONFIG_LEX_USE_O
c61a3a44 361 $(QUIET_LEX)$(LEX) -o $@ $<
63bda378
JA
362else
363 $(QUIET_LEX)$(LEX) $<
364endif
79816cf7 365
b470a02c
SC
366lex.yy.o: lex.yy.c y.tab.h
367 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
368
369y.tab.o: y.tab.c y.tab.h
370 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
371
372y.tab.c: exp/expression-parser.y
c61a3a44 373 $(QUIET_YACC)$(YACC) -o $@ -l -d -b y $<
b470a02c 374
dc68fd2c 375y.tab.h: y.tab.c
b470a02c 376
c9fa1c8d
SC
377lexer.h: lex.yy.c
378
c879ba67
JA
379exp/test-expression-parser.o: exp/test-expression-parser.c
380 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
381exp/test-expression-parser: exp/test-expression-parser.o
382 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS)
383
b470a02c
SC
384parse.o: lex.yy.o y.tab.o
385endif
386
c61a3a44 387init.o: init.c FIO-VERSION-FILE
6a6b11f4 388 @mkdir -p $(dir $@)
c61a3a44 389 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
6a6b11f4
JA
390 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
391 @mv -f $*.d $*.d.tmp
392 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
86fb8d80
TK
393ifeq ($(CONFIG_TARGET_OS), NetBSD)
394 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
395 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
396else
e291cff1 397 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
6a6b11f4 398 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
86fb8d80 399endif
6a6b11f4 400 @rm -f $*.d.tmp
32d4cc61 401
f762cef9 402gcompat.o: gcompat.c gcompat.h
c61a3a44 403 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
f762cef9 404
9af4a244 405goptions.o: goptions.c goptions.h
c61a3a44 406 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
9af4a244 407
53e0e85d 408ghelpers.o: ghelpers.c ghelpers.h
c61a3a44 409 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
53e0e85d 410
41666588 411gerror.o: gerror.c gerror.h
c61a3a44 412 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
41666588 413
1252d8f2 414gclient.o: gclient.c gclient.h
c61a3a44 415 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
1252d8f2 416
53e0e85d 417gfio.o: gfio.c ghelpers.c
c61a3a44 418 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
70d07ce1 419
53e0e85d 420graph.o: graph.c graph.h
c61a3a44 421 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
af58ef32 422
ee2f55b2 423cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
c61a3a44 424 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
ee2f55b2 425
bf3f7027 426printing.o: printing.c printing.h
c61a3a44 427 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
bf3f7027 428
6d5a9bc2
JA
429t/read-to-pipe-async: $(T_PIPE_ASYNC_OBJS)
430 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_PIPE_ASYNC_OBJS) $(LIBS)
431
ae46d0f5
JA
432t/memlock: $(T_MEMLOCK_OBJS)
433 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_MEMLOCK_OBJS) $(LIBS)
434
61f78f3a 435t/stest: $(T_SMALLOC_OBJS)
a3c86fc4 436 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS)
61f78f3a
JA
437
438t/ieee754: $(T_IEEE_OBJS)
a3c86fc4 439 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS)
fbc2792b 440
33765372 441fio: $(FIO_OBJS)
b492fa32 442 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB)
4c3ecec4 443
70d07ce1 444gfio: $(GFIO_OBJS)
1527dc50 445 $(QUIET_LINK)$(CC) $(filter-out -static, $(LDFLAGS)) -o gfio $(GFIO_OBJS) $(LIBS) $(GFIO_LIBS) $(GTK_LDFLAGS) $(HDFSLIB)
70d07ce1 446
aa7bc282 447t/fio-genzipf: $(T_ZIPF_OBJS)
a3c86fc4 448 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS)
6ff38856 449
ad1f90aa 450t/axmap: $(T_AXMAP_OBJS)
a3c86fc4 451 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS)
ad1f90aa 452
7a887ffe 453t/lfsr-test: $(T_LFSR_TEST_OBJS)
a3c86fc4 454 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
7a887ffe 455
323f2086
JA
456t/gen-rand: $(T_GEN_RAND_OBJS)
457 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_GEN_RAND_OBJS) $(LIBS)
458
40bafa33 459ifeq ($(CONFIG_TARGET_OS), Linux)
aa7bc282 460t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS)
40bafa33
JA
461 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
462endif
463
aa7bc282 464t/fio-dedupe: $(T_DEDUPE_OBJS)
bf481692
JA
465 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS)
466
98996ef9
JA
467t/fio-verify-state: $(T_VS_OBJS)
468 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_VS_OBJS) $(LIBS)
469
dcbc7841
VF
470t/time-test: $(T_TT_OBJS)
471 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_TT_OBJS) $(LIBS)
472
3d43382c 473clean: FORCE
506df34d 474 @rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) $(T_TEST_PROGS) core.* core gfio FIO-VERSION-FILE *.[do] lib/*.d oslib/*.[do] crc/*.d engines/*.[do] profiles/*.[do] t/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h
0b422574 475 @rm -rf doc/output
45f944b9
JA
476
477distclean: clean FORCE
d1f6fcad 478 @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf fiologparser_hist.pdf
ebac4655 479
592ef98a 480cscope:
366badd3 481 @cscope -b -R
592ef98a 482
1378cc68
EV
483tools/plot/fio2gnuplot.1:
484 @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1
485
7788b76f
JA
486doc: tools/plot/fio2gnuplot.1
487 @man -t ./fio.1 | ps2pdf - fio.pdf
488 @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf
489 @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
d1f6fcad 490 @man -t tools/hist/fiologparser_hist.py.1 | ps2pdf - fiologparser_hist.pdf
7788b76f 491
92ddd6b6 492test: fio
dbf2214c 493 ./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
3894b8e1 494
1378cc68 495install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE
513ba3f7 496 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
ebac4655 497 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
d60e92d1 498 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
c61a3a44
JF
499 $(INSTALL) -m 644 $(SRCDIR)/fio.1 $(DESTDIR)$(mandir)/man1
500 $(INSTALL) -m 644 $(SRCDIR)/tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
501 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1
d1f6fcad 502 $(INSTALL) -m 644 $(SRCDIR)/tools/hist/fiologparser_hist.py.1 $(DESTDIR)$(mandir)/man1
eab4af4e 503 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
c61a3a44 504 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/*gpm $(DESTDIR)$(sharedir)/