Fix Windows CPU count
[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
67bf9823 89ifdef CONFIG_SOLARISAIO
67bf9823
JA
90 SOURCE += engines/solarisaio.c
91endif
4700b234 92ifdef CONFIG_WINDOWSAIO
4700b234
JA
93 SOURCE += engines/windowsaio.c
94endif
d5f9b0ea
IF
95ifdef CONFIG_RADOS
96 SOURCE += engines/rados.c
97endif
fc5c0345
DG
98ifdef CONFIG_RBD
99 SOURCE += engines/rbd.c
100endif
c2f6a13d
LMB
101ifdef CONFIG_HTTP
102 SOURCE += engines/http.c
103endif
44e8e956 104SOURCE += oslib/asprintf.c
67bf9823 105ifndef CONFIG_STRSEP
984f30c9 106 SOURCE += oslib/strsep.c
67bf9823 107endif
9ad8da82 108ifndef CONFIG_STRCASESTR
984f30c9 109 SOURCE += oslib/strcasestr.c
9ad8da82 110endif
5ad7be56 111ifndef CONFIG_STRLCAT
984f30c9 112 SOURCE += oslib/strlcat.c
5ad7be56 113endif
b29c71c4
JA
114ifndef CONFIG_HAVE_STRNDUP
115 SOURCE += oslib/strndup.c
116endif
67bf9823 117ifndef CONFIG_GETOPT_LONG_ONLY
984f30c9 118 SOURCE += oslib/getopt_long.c
67bf9823 119endif
67bf9823 120ifndef CONFIG_INET_ATON
984f30c9 121 SOURCE += oslib/inet_aton.c
67bf9823 122endif
6e7d7dfb 123ifdef CONFIG_GFAPI
124 SOURCE += engines/glusterfs.c
cc47f094 125 SOURCE += engines/glusterfs_sync.c
126 SOURCE += engines/glusterfs_async.c
6fa14b99 127 ifdef CONFIG_GF_FADVISE
128 CFLAGS += "-DGFAPI_USE_FADVISE"
129 endif
6e7d7dfb 130endif
65fa28ca
DE
131ifdef CONFIG_MTD
132 SOURCE += engines/mtd.c
984f30c9
JA
133 SOURCE += oslib/libmtd.c
134 SOURCE += oslib/libmtd_legacy.c
65fa28ca 135endif
43f3cec2
BB
136ifdef CONFIG_PMEMBLK
137 SOURCE += engines/pmemblk.c
138endif
cbb15e42
DJ
139ifdef CONFIG_LINUX_DEVDAX
140 SOURCE += engines/dev-dax.c
141endif
ae0db592
TI
142ifdef CONFIG_LIBPMEM
143 SOURCE += engines/libpmem.c
144endif
a40e7a59
GB
145ifdef CONFIG_IME
146 SOURCE += engines/ime.c
147endif
bfbdd35b
BVA
148ifdef CONFIG_LINUX_BLKZONED
149 SOURCE += zbd.c
150endif
d015e398 151
53cd4eee 152ifeq ($(CONFIG_TARGET_OS), Linux)
67bf9823 153 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \
757be0e0 154 oslib/linux-dev-lookup.c
67bf9823 155 LIBS += -lpthread -ldl
213a01b0 156 LDFLAGS += -rdynamic
d015e398 157endif
53cd4eee 158ifeq ($(CONFIG_TARGET_OS), Android)
3714a963 159 SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
984f30c9 160 oslib/linux-dev-lookup.c
ec5c6b12
AC
161 LIBS += -ldl
162 LDFLAGS += -rdynamic
ec5c6b12 163endif
53cd4eee 164ifeq ($(CONFIG_TARGET_OS), SunOS)
7366ad05 165 LIBS += -lpthread -ldl
d015e398
BC
166 CPPFLAGS += -D__EXTENSIONS__
167endif
53cd4eee 168ifeq ($(CONFIG_TARGET_OS), FreeBSD)
0bf31987 169 SOURCE += trim.c
d015e398 170 LIBS += -lpthread -lrt
213a01b0 171 LDFLAGS += -rdynamic
d015e398 172endif
3cd4c66f
J
173ifeq ($(CONFIG_TARGET_OS), OpenBSD)
174 LIBS += -lpthread
175 LDFLAGS += -rdynamic
176endif
53cd4eee 177ifeq ($(CONFIG_TARGET_OS), NetBSD)
d015e398 178 LIBS += -lpthread -lrt
213a01b0 179 LDFLAGS += -rdynamic
d015e398 180endif
239b2882 181ifeq ($(CONFIG_TARGET_OS), DragonFly)
c9a4e0c8 182 SOURCE += trim.c
239b2882
JA
183 LIBS += -lpthread -lrt
184 LDFLAGS += -rdynamic
185endif
53cd4eee 186ifeq ($(CONFIG_TARGET_OS), AIX)
d015e398 187 LIBS += -lpthread -ldl -lrt
d015e398 188 CPPFLAGS += -D_LARGE_FILES -D__ppc__
48b35be0 189 LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000
d015e398 190endif
53cd4eee 191ifeq ($(CONFIG_TARGET_OS), HP-UX)
b5ffb752 192 LIBS += -lpthread -ldl -lrt
67bf9823 193 CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED
c00a2289 194endif
53cd4eee 195ifeq ($(CONFIG_TARGET_OS), Darwin)
d015e398
BC
196 LIBS += -lpthread -ldl
197endif
53cd4eee 198ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
4700b234 199 SOURCE += os/windows/posix.c
93bcfd20 200 LIBS += -lpthread -lpsapi -lws2_32
12ed4fc8 201 CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
d015e398
BC
202endif
203
c61a3a44 204OBJS := $(SOURCE:.c=.o)
90b7a96d 205
8232e285 206FIO_OBJS = $(OBJS) fio.o
b470a02c 207
7efff409
JA
208GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \
209 gclient.o gcompat.o cairo_text_helpers.o printing.o
210
b470a02c
SC
211ifdef CONFIG_ARITHMETIC
212FIO_OBJS += lex.yy.o y.tab.o
7efff409 213GFIO_OBJS += lex.yy.o y.tab.o
b470a02c
SC
214endif
215
f67d6ee2 216-include $(OBJS:.o=.d)
79d16311 217
61f78f3a 218T_SMALLOC_OBJS = t/stest.o
971caeb1 219T_SMALLOC_OBJS += gettime.o fio_sem.o pshared.o smalloc.o t/log.o t/debug.o \
ae626d4e 220 t/arch.o
61f78f3a
JA
221T_SMALLOC_PROGS = t/stest
222
223T_IEEE_OBJS = t/ieee754.o
84f43c6f 224T_IEEE_OBJS += lib/ieee754.o
61f78f3a
JA
225T_IEEE_PROGS = t/ieee754
226
6ff38856 227T_ZIPF_OBS = t/genzipf.o
2cac8fcb 228T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
df27f9ac
JA
229 lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
230 oslib/strndup.o
aa7bc282 231T_ZIPF_PROGS = t/fio-genzipf
6ff38856 232
ad1f90aa 233T_AXMAP_OBJS = t/axmap.o
07e71598 234T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o
ad1f90aa
JA
235T_AXMAP_PROGS = t/axmap
236
7a887ffe 237T_LFSR_TEST_OBJS = t/lfsr-test.o
17031c6d
BVA
238T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o fio_sem.o pshared.o \
239 t/log.o t/debug.o t/arch.o
7a887ffe
AP
240T_LFSR_TEST_PROGS = t/lfsr-test
241
323f2086 242T_GEN_RAND_OBJS = t/gen-rand.o
e91ba49a 243T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
df27f9ac 244 oslib/strcasestr.o oslib/strndup.o
323f2086
JA
245T_GEN_RAND_PROGS = t/gen-rand
246
40bafa33
JA
247ifeq ($(CONFIG_TARGET_OS), Linux)
248T_BTRACE_FIO_OBJS = t/btrace2fio.o
984f30c9 249T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o oslib/linux-dev-lookup.o
aa7bc282 250T_BTRACE_FIO_PROGS = t/fio-btrace2fio
40bafa33
JA
251endif
252
bf481692 253T_DEDUPE_OBJS = t/dedupe.o
971caeb1 254T_DEDUPE_OBJS += lib/rbtree.o t/log.o fio_sem.o pshared.o smalloc.o gettime.o \
ae626d4e
BVA
255 crc/md5.o lib/memalign.o lib/bloom.o t/debug.o crc/xxhash.o \
256 t/arch.o crc/murmur3.o crc/crc32c.o crc/crc32c-intel.o \
257 crc/crc32c-arm64.o crc/fnv.o
aa7bc282 258T_DEDUPE_PROGS = t/fio-dedupe
bf481692 259
214e2d56 260T_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
261T_VS_PROGS = t/fio-verify-state
262
6d5a9bc2
JA
263T_PIPE_ASYNC_OBJS = t/read-to-pipe-async.o
264T_PIPE_ASYNC_PROGS = t/read-to-pipe-async
265
ae46d0f5
JA
266T_MEMLOCK_OBJS = t/memlock.o
267T_MEMLOCK_PROGS = t/memlock
268
dcbc7841
VF
269T_TT_OBJS = t/time-test.o
270T_TT_PROGS = t/time-test
271
61f78f3a
JA
272T_OBJS = $(T_SMALLOC_OBJS)
273T_OBJS += $(T_IEEE_OBJS)
6ff38856 274T_OBJS += $(T_ZIPF_OBJS)
ad1f90aa 275T_OBJS += $(T_AXMAP_OBJS)
7a887ffe 276T_OBJS += $(T_LFSR_TEST_OBJS)
323f2086 277T_OBJS += $(T_GEN_RAND_OBJS)
40bafa33 278T_OBJS += $(T_BTRACE_FIO_OBJS)
e5bf5a88 279T_OBJS += $(T_DEDUPE_OBJS)
98996ef9 280T_OBJS += $(T_VS_OBJS)
6d5a9bc2 281T_OBJS += $(T_PIPE_ASYNC_OBJS)
ae46d0f5 282T_OBJS += $(T_MEMLOCK_OBJS)
dcbc7841 283T_OBJS += $(T_TT_OBJS)
6ff38856 284
824d6ff4
BC
285ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
286 T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
287 T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o
288 T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o
289endif
290
aa7bc282
JA
291T_TEST_PROGS = $(T_SMALLOC_PROGS)
292T_TEST_PROGS += $(T_IEEE_PROGS)
6ff38856 293T_PROGS += $(T_ZIPF_PROGS)
aa7bc282
JA
294T_TEST_PROGS += $(T_AXMAP_PROGS)
295T_TEST_PROGS += $(T_LFSR_TEST_PROGS)
323f2086 296T_TEST_PROGS += $(T_GEN_RAND_PROGS)
40bafa33 297T_PROGS += $(T_BTRACE_FIO_PROGS)
e5bf5a88 298T_PROGS += $(T_DEDUPE_PROGS)
98996ef9 299T_PROGS += $(T_VS_PROGS)
e5bf5a88
JA
300
301PROGS += $(T_PROGS)
3427207d 302
b8b0e1ee
TK
303ifdef CONFIG_HAVE_CUNIT
304UT_OBJS = unittests/unittest.o
e37155ef 305UT_OBJS += unittests/lib/memalign.o
ce875031 306UT_OBJS += unittests/lib/strntol.o
cdcd7e99 307UT_OBJS += unittests/oslib/strlcat.o
2f84d0c7 308UT_OBJS += unittests/oslib/strndup.o
e37155ef 309UT_TARGET_OBJS = lib/memalign.o
ce875031 310UT_TARGET_OBJS += lib/strntol.o
cdcd7e99 311UT_TARGET_OBJS += oslib/strlcat.o
2f84d0c7 312UT_TARGET_OBJS += oslib/strndup.o
b8b0e1ee
TK
313UT_PROGS = unittests/unittest
314else
315UT_OBJS =
316UT_TARGET_OBJS =
317UT_PROGS =
318endif
319
4c3ecec4
JA
320ifneq ($(findstring $(MAKEFLAGS),s),s)
321ifndef V
322 QUIET_CC = @echo ' ' CC $@;
79816cf7
JA
323 QUIET_LINK = @echo ' ' LINK $@;
324 QUIET_DEP = @echo ' ' DEP $@;
325 QUIET_YACC = @echo ' ' YACC $@;
326 QUIET_LEX = @echo ' ' LEX $@;
4c3ecec4
JA
327endif
328endif
329
a8168a22
JA
330ifeq ($(CONFIG_TARGET_OS), SunOS)
331 INSTALL = ginstall
332else
333 INSTALL = install
334endif
020d54bd 335prefix = $(INSTALL_PREFIX)
c1d5725e 336bindir = $(prefix)/bin
bcdf7c58 337
53cd4eee 338ifeq ($(CONFIG_TARGET_OS), Darwin)
bcdf7c58 339mandir = /usr/share/man
eab4af4e 340sharedir = /usr/share/fio
bcdf7c58 341else
d60e92d1 342mandir = $(prefix)/man
eab4af4e 343sharedir = $(prefix)/share/fio
bcdf7c58 344endif
c1d5725e 345
b8b0e1ee 346all: $(PROGS) $(T_TEST_PROGS) $(UT_PROGS) $(SCRIPTS) FORCE
f84622e9 347
92ddd6b6 348.PHONY: all install clean test
3d43382c
JA
349.PHONY: FORCE cscope
350
351FIO-VERSION-FILE: FORCE
c61a3a44 352 @$(SHELL) $(SRCDIR)/FIO-VERSION-GEN
3d43382c
JA
353-include FIO-VERSION-FILE
354
7496ea3e 355override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
3d43382c 356
9e85c34e 357%.o : %.c
c61a3a44 358 @mkdir -p $(dir $@)
4feafb1e 359 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
c61a3a44 360 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
f67d6ee2
JA
361 @mv -f $*.d $*.d.tmp
362 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
86fb8d80
TK
363ifeq ($(CONFIG_TARGET_OS), NetBSD)
364 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
365 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
366else
e291cff1 367 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
f67d6ee2 368 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
86fb8d80 369endif
f67d6ee2 370 @rm -f $*.d.tmp
e52947d1 371
b470a02c 372ifdef CONFIG_ARITHMETIC
79816cf7 373lex.yy.c: exp/expression-parser.l
63bda378 374ifdef CONFIG_LEX_USE_O
c61a3a44 375 $(QUIET_LEX)$(LEX) -o $@ $<
63bda378
JA
376else
377 $(QUIET_LEX)$(LEX) $<
378endif
79816cf7 379
b470a02c
SC
380lex.yy.o: lex.yy.c y.tab.h
381 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
382
383y.tab.o: y.tab.c y.tab.h
384 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
385
386y.tab.c: exp/expression-parser.y
c61a3a44 387 $(QUIET_YACC)$(YACC) -o $@ -l -d -b y $<
b470a02c 388
dc68fd2c 389y.tab.h: y.tab.c
b470a02c 390
c9fa1c8d
SC
391lexer.h: lex.yy.c
392
c879ba67
JA
393exp/test-expression-parser.o: exp/test-expression-parser.c
394 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
395exp/test-expression-parser: exp/test-expression-parser.o
396 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS)
397
b470a02c
SC
398parse.o: lex.yy.o y.tab.o
399endif
400
c61a3a44 401init.o: init.c FIO-VERSION-FILE
6a6b11f4 402 @mkdir -p $(dir $@)
c61a3a44 403 $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $<
6a6b11f4
JA
404 @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
405 @mv -f $*.d $*.d.tmp
406 @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
86fb8d80
TK
407ifeq ($(CONFIG_TARGET_OS), NetBSD)
408 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
409 sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
410else
e291cff1 411 @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
6a6b11f4 412 sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
86fb8d80 413endif
6a6b11f4 414 @rm -f $*.d.tmp
32d4cc61 415
f762cef9 416gcompat.o: gcompat.c gcompat.h
c61a3a44 417 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
f762cef9 418
9af4a244 419goptions.o: goptions.c goptions.h
c61a3a44 420 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
9af4a244 421
53e0e85d 422ghelpers.o: ghelpers.c ghelpers.h
c61a3a44 423 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
53e0e85d 424
41666588 425gerror.o: gerror.c gerror.h
c61a3a44 426 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
41666588 427
1252d8f2 428gclient.o: gclient.c gclient.h
c61a3a44 429 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
1252d8f2 430
53e0e85d 431gfio.o: gfio.c ghelpers.c
c61a3a44 432 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
70d07ce1 433
53e0e85d 434graph.o: graph.c graph.h
c61a3a44 435 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
af58ef32 436
ee2f55b2 437cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h
c61a3a44 438 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
ee2f55b2 439
bf3f7027 440printing.o: printing.c printing.h
c61a3a44 441 $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c $<
bf3f7027 442
6d5a9bc2
JA
443t/read-to-pipe-async: $(T_PIPE_ASYNC_OBJS)
444 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_PIPE_ASYNC_OBJS) $(LIBS)
445
ae46d0f5
JA
446t/memlock: $(T_MEMLOCK_OBJS)
447 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_MEMLOCK_OBJS) $(LIBS)
448
61f78f3a 449t/stest: $(T_SMALLOC_OBJS)
a3c86fc4 450 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS)
61f78f3a
JA
451
452t/ieee754: $(T_IEEE_OBJS)
a3c86fc4 453 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS)
fbc2792b 454
33765372 455fio: $(FIO_OBJS)
b492fa32 456 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB)
4c3ecec4 457
70d07ce1 458gfio: $(GFIO_OBJS)
1527dc50 459 $(QUIET_LINK)$(CC) $(filter-out -static, $(LDFLAGS)) -o gfio $(GFIO_OBJS) $(LIBS) $(GFIO_LIBS) $(GTK_LDFLAGS) $(HDFSLIB)
70d07ce1 460
aa7bc282 461t/fio-genzipf: $(T_ZIPF_OBJS)
a3c86fc4 462 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS)
6ff38856 463
ad1f90aa 464t/axmap: $(T_AXMAP_OBJS)
a3c86fc4 465 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS)
ad1f90aa 466
7a887ffe 467t/lfsr-test: $(T_LFSR_TEST_OBJS)
a3c86fc4 468 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS)
7a887ffe 469
323f2086
JA
470t/gen-rand: $(T_GEN_RAND_OBJS)
471 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_GEN_RAND_OBJS) $(LIBS)
472
40bafa33 473ifeq ($(CONFIG_TARGET_OS), Linux)
aa7bc282 474t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS)
40bafa33
JA
475 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS)
476endif
477
aa7bc282 478t/fio-dedupe: $(T_DEDUPE_OBJS)
bf481692
JA
479 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS)
480
98996ef9
JA
481t/fio-verify-state: $(T_VS_OBJS)
482 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_VS_OBJS) $(LIBS)
483
dcbc7841
VF
484t/time-test: $(T_TT_OBJS)
485 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_TT_OBJS) $(LIBS)
486
b8b0e1ee
TK
487ifdef CONFIG_HAVE_CUNIT
488unittests/unittest: $(UT_OBJS) $(UT_TARGET_OBJS)
489 $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(UT_OBJS) $(UT_TARGET_OBJS) -lcunit
490endif
491
3d43382c 492clean: FORCE
b8b0e1ee 493 @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] profiles/*.[do] t/*.[do] unittests/*.[do] unittests/*/*.[do] config-host.mak config-host.h y.tab.[ch] lex.yy.c exp/*.[do] lexer.h
0b422574 494 @rm -rf doc/output
45f944b9
JA
495
496distclean: clean FORCE
d1f6fcad 497 @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf fiologparser_hist.pdf
ebac4655 498
592ef98a 499cscope:
366badd3 500 @cscope -b -R
592ef98a 501
1378cc68
EV
502tools/plot/fio2gnuplot.1:
503 @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1
504
7788b76f
JA
505doc: tools/plot/fio2gnuplot.1
506 @man -t ./fio.1 | ps2pdf - fio.pdf
507 @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf
508 @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
d1f6fcad 509 @man -t tools/hist/fiologparser_hist.py.1 | ps2pdf - fiologparser_hist.pdf
7788b76f 510
92ddd6b6 511test: fio
dbf2214c 512 ./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 513
1378cc68 514install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE
513ba3f7 515 $(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
ebac4655 516 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
d60e92d1 517 $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
c61a3a44
JF
518 $(INSTALL) -m 644 $(SRCDIR)/fio.1 $(DESTDIR)$(mandir)/man1
519 $(INSTALL) -m 644 $(SRCDIR)/tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1
520 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1
d1f6fcad 521 $(INSTALL) -m 644 $(SRCDIR)/tools/hist/fiologparser_hist.py.1 $(DESTDIR)$(mandir)/man1
eab4af4e 522 $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir)
c61a3a44 523 $(INSTALL) -m 644 $(SRCDIR)/tools/plot/*gpm $(DESTDIR)$(sharedir)/