Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 1 | ifneq ($(wildcard config-host.mak),) |
| 2 | all: |
| 3 | include config-host.mak |
| 4 | config-host-mak: configure |
| 5 | @echo $@ is out-of-date, running configure |
| 6 | @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh |
| 7 | else |
| 8 | config-host.mak: |
Jens Axboe | d443abc | 2013-05-29 21:49:21 +0200 | [diff] [blame] | 9 | ifneq ($(MAKECMDGOALS),clean) |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 10 | @echo "Running configure for you..." |
| 11 | @./configure |
Jens Axboe | d443abc | 2013-05-29 21:49:21 +0200 | [diff] [blame] | 12 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 13 | all: |
| 14 | include config-host.mak |
| 15 | endif |
| 16 | |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 17 | DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG |
Daniel Gollub | 9195552 | 2014-05-01 14:07:02 +0200 | [diff] [blame] | 18 | CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DFIO_INTERNAL $(DEBUGFLAGS) |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 19 | OPTFLAGS= -O3 -g -ffast-math |
Jens Axboe | eb19930 | 2013-04-17 10:54:53 -0700 | [diff] [blame] | 20 | CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 21 | LIBS += -lm $(EXTLIBS) |
| 22 | PROGS = fio |
Erwan Velu | 265a202 | 2013-08-07 15:32:02 +0200 | [diff] [blame] | 23 | SCRIPTS = tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio |
Jens Axboe | af4862b | 2013-03-29 08:55:32 -0600 | [diff] [blame] | 24 | |
Jens Axboe | 91f94d5 | 2013-01-24 10:25:42 -0700 | [diff] [blame] | 25 | ifdef CONFIG_GFIO |
| 26 | PROGS += gfio |
| 27 | endif |
| 28 | |
Jens Axboe | ea783f8 | 2013-04-05 12:54:03 +0200 | [diff] [blame] | 29 | SOURCE := gettime.c ioengines.c init.c stat.c log.c time.c filesetup.c \ |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 30 | eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \ |
Jens Axboe | 0577543 | 2012-03-21 14:07:11 +0100 | [diff] [blame] | 31 | lib/rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \ |
Jens Axboe | c7c6cb4 | 2011-10-13 14:12:40 +0200 | [diff] [blame] | 32 | lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \ |
Jens Axboe | d48a979 | 2011-07-09 08:54:26 +0200 | [diff] [blame] | 33 | engines/mmap.c engines/sync.c engines/null.c engines/net.c \ |
Jens Axboe | 2dc1cbb | 2012-03-08 14:52:25 +0100 | [diff] [blame] | 34 | memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \ |
Jens Axboe | 9a0db1e | 2012-12-03 14:38:08 +0100 | [diff] [blame] | 35 | cconv.c lib/prio_tree.c json.c lib/zipf.c lib/axmap.c \ |
Jens Axboe | 836fcc0 | 2013-01-24 09:08:45 -0700 | [diff] [blame] | 36 | lib/lfsr.c gettime-thread.c helpers.c lib/flist_sort.c \ |
Jens Axboe | d4afedf | 2013-05-22 22:21:29 +0200 | [diff] [blame] | 37 | lib/hweight.c lib/getrusage.c idletime.c td_error.c \ |
Jens Axboe | 38a812d | 2014-07-03 09:10:39 -0600 | [diff] [blame] | 38 | profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \ |
Jens Axboe | b0e1bb9 | 2014-09-27 09:30:56 -0600 | [diff] [blame] | 39 | lib/tp.c lib/bloom.c |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 40 | |
Manish Mandlik | d60aa36 | 2014-08-13 13:36:52 -0600 | [diff] [blame] | 41 | ifdef CONFIG_LIBHDFS |
| 42 | HDFSFLAGS= -I $(JAVA_HOME)/include -I $(JAVA_HOME)/include/linux -I $(FIO_LIBHDFS_INCLUDE) |
| 43 | HDFSLIB= $(JAVA_HOME)/jre/lib/amd64/server/libjvm.so $(FIO_LIBHDFS_LIB)/liblibhdfs.a |
| 44 | CFLAGS += $(HDFSFLAGS) |
| 45 | SOURCE += engines/libhdfs.c |
| 46 | endif |
| 47 | |
Bruce Cran | c81f934 | 2013-01-13 17:09:22 +0000 | [diff] [blame] | 48 | ifdef CONFIG_64BIT_LLP64 |
| 49 | CFLAGS += -DBITS_PER_LONG=32 |
| 50 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 51 | ifdef CONFIG_64BIT |
| 52 | CFLAGS += -DBITS_PER_LONG=64 |
| 53 | endif |
| 54 | ifdef CONFIG_32BIT |
| 55 | CFLAGS += -DBITS_PER_LONG=32 |
| 56 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 57 | ifdef CONFIG_LIBAIO |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 58 | SOURCE += engines/libaio.c |
| 59 | endif |
| 60 | ifdef CONFIG_RDMA |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 61 | SOURCE += engines/rdma.c |
| 62 | endif |
| 63 | ifdef CONFIG_POSIXAIO |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 64 | SOURCE += engines/posixaio.c |
| 65 | endif |
| 66 | ifdef CONFIG_LINUX_FALLOCATE |
| 67 | SOURCE += engines/falloc.c |
| 68 | endif |
| 69 | ifdef CONFIG_LINUX_EXT4_MOVE_EXTENT |
| 70 | SOURCE += engines/e4defrag.c |
| 71 | endif |
| 72 | ifdef CONFIG_LINUX_SPLICE |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 73 | SOURCE += engines/splice.c |
| 74 | endif |
| 75 | ifdef CONFIG_GUASI |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 76 | SOURCE += engines/guasi.c |
| 77 | endif |
| 78 | ifdef CONFIG_FUSION_AW |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 79 | SOURCE += engines/fusion-aw.c |
| 80 | endif |
| 81 | ifdef CONFIG_SOLARISAIO |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 82 | SOURCE += engines/solarisaio.c |
| 83 | endif |
Jens Axboe | 4700b23 | 2013-01-24 15:33:33 -0700 | [diff] [blame] | 84 | ifdef CONFIG_WINDOWSAIO |
Jens Axboe | 4700b23 | 2013-01-24 15:33:33 -0700 | [diff] [blame] | 85 | SOURCE += engines/windowsaio.c |
| 86 | endif |
Daniel Gollub | fc5c034 | 2014-02-17 14:35:28 +0100 | [diff] [blame] | 87 | ifdef CONFIG_RBD |
| 88 | SOURCE += engines/rbd.c |
| 89 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 90 | ifndef CONFIG_STRSEP |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 91 | SOURCE += lib/strsep.c |
| 92 | endif |
Jens Axboe | 9ad8da8 | 2013-04-05 14:44:03 +0200 | [diff] [blame] | 93 | ifndef CONFIG_STRCASESTR |
| 94 | SOURCE += lib/strcasestr.c |
| 95 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 96 | ifndef CONFIG_GETOPT_LONG_ONLY |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 97 | SOURCE += lib/getopt_long.c |
| 98 | endif |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 99 | ifndef CONFIG_INET_ATON |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 100 | SOURCE += lib/inet_aton.c |
| 101 | endif |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 102 | ifdef CONFIG_GFAPI |
| 103 | SOURCE += engines/glusterfs.c |
chenh | cb92c7f | 2014-04-02 13:01:01 -0400 | [diff] [blame] | 104 | SOURCE += engines/glusterfs_sync.c |
| 105 | SOURCE += engines/glusterfs_async.c |
chenh | 54fe20f | 2014-04-08 13:02:26 -0400 | [diff] [blame] | 106 | ifdef CONFIG_GF_FADVISE |
| 107 | CFLAGS += "-DGFAPI_USE_FADVISE" |
| 108 | endif |
chenh | 0e55d6b | 2014-03-27 15:19:43 -0400 | [diff] [blame] | 109 | endif |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 110 | |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 111 | ifeq ($(CONFIG_TARGET_OS), Linux) |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 112 | SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \ |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 113 | engines/binject.c lib/linux-dev-lookup.c |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 114 | LIBS += -lpthread -ldl |
Jens Axboe | 213a01b | 2011-10-07 13:24:16 +0200 | [diff] [blame] | 115 | LDFLAGS += -rdynamic |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 116 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 117 | ifeq ($(CONFIG_TARGET_OS), Android) |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 118 | SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c \ |
| 119 | lib/linux-dev-lookup.c |
Aaron Carroll | ec5c6b1 | 2012-11-21 10:39:00 +0100 | [diff] [blame] | 120 | LIBS += -ldl |
| 121 | LDFLAGS += -rdynamic |
Aaron Carroll | ec5c6b1 | 2012-11-21 10:39:00 +0100 | [diff] [blame] | 122 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 123 | ifeq ($(CONFIG_TARGET_OS), SunOS) |
Jens Axboe | 7366ad0 | 2013-02-28 20:34:31 +0100 | [diff] [blame] | 124 | LIBS += -lpthread -ldl |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 125 | CPPFLAGS += -D__EXTENSIONS__ |
| 126 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 127 | ifeq ($(CONFIG_TARGET_OS), FreeBSD) |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 128 | LIBS += -lpthread -lrt |
Jens Axboe | 213a01b | 2011-10-07 13:24:16 +0200 | [diff] [blame] | 129 | LDFLAGS += -rdynamic |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 130 | endif |
John | 3cd4c66 | 2013-12-29 19:20:35 -0700 | [diff] [blame] | 131 | ifeq ($(CONFIG_TARGET_OS), OpenBSD) |
| 132 | LIBS += -lpthread |
| 133 | LDFLAGS += -rdynamic |
| 134 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 135 | ifeq ($(CONFIG_TARGET_OS), NetBSD) |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 136 | LIBS += -lpthread -lrt |
Jens Axboe | 213a01b | 2011-10-07 13:24:16 +0200 | [diff] [blame] | 137 | LDFLAGS += -rdynamic |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 138 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 139 | ifeq ($(CONFIG_TARGET_OS), AIX) |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 140 | LIBS += -lpthread -ldl -lrt |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 141 | CPPFLAGS += -D_LARGE_FILES -D__ppc__ |
Michael Perzl | 48b35be | 2011-07-13 20:28:07 +0200 | [diff] [blame] | 142 | LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 143 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 144 | ifeq ($(CONFIG_TARGET_OS), HP-UX) |
Jens Axboe | b5ffb75 | 2011-07-09 13:28:19 +0200 | [diff] [blame] | 145 | LIBS += -lpthread -ldl -lrt |
Jens Axboe | 67bf982 | 2013-01-10 11:23:19 +0100 | [diff] [blame] | 146 | CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED |
Jens Axboe | c00a228 | 2011-07-08 20:56:06 +0200 | [diff] [blame] | 147 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 148 | ifeq ($(CONFIG_TARGET_OS), Darwin) |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 149 | LIBS += -lpthread -ldl |
| 150 | endif |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 151 | ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) |
Bruce Cran | 93bcfd2 | 2012-02-20 20:18:19 +0100 | [diff] [blame] | 152 | SOURCE := $(filter-out engines/mmap.c,$(SOURCE)) |
Jens Axboe | 4700b23 | 2013-01-24 15:33:33 -0700 | [diff] [blame] | 153 | SOURCE += os/windows/posix.c |
Bruce Cran | 93bcfd2 | 2012-02-20 20:18:19 +0100 | [diff] [blame] | 154 | LIBS += -lpthread -lpsapi -lws2_32 |
Bruce Cran | 9aa5fe3 | 2014-01-28 12:56:53 -0700 | [diff] [blame] | 155 | CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static |
Bruce Cran | d015e39 | 2011-01-28 08:39:09 +0100 | [diff] [blame] | 156 | endif |
| 157 | |
Bruce Cran | 9b83656 | 2011-01-08 19:49:54 +0100 | [diff] [blame] | 158 | OBJS = $(SOURCE:.c=.o) |
Jens Axboe | 90b7a96 | 2013-02-04 12:51:09 +0100 | [diff] [blame] | 159 | |
Stephen M. Cameron | 8232e28 | 2012-02-24 08:17:31 +0100 | [diff] [blame] | 160 | FIO_OBJS = $(OBJS) fio.o |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 161 | |
Jens Axboe | 1252d8f | 2012-03-21 11:13:31 +0100 | [diff] [blame] | 162 | GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \ |
Stephen M. Cameron | bf3f702 | 2012-03-27 08:14:48 +0200 | [diff] [blame] | 163 | gclient.o gcompat.o cairo_text_helpers.o printing.o |
Jens Axboe | 79d1631 | 2010-03-04 12:43:20 +0100 | [diff] [blame] | 164 | |
Jens Axboe | cc481fd | 2014-10-07 20:43:04 -0600 | [diff] [blame] | 165 | ifdef CONFIG_ARITHMETIC |
| 166 | FIO_OBJS += lex.yy.o y.tab.o |
| 167 | GFIO_OBJS += lex.yy.o y.tab.o |
| 168 | endif |
| 169 | |
Jens Axboe | f67d6ee | 2013-02-01 15:51:23 +0100 | [diff] [blame] | 170 | -include $(OBJS:.o=.d) |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 171 | |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 172 | T_SMALLOC_OBJS = t/stest.o |
Jens Axboe | 7a74197 | 2014-09-26 09:58:29 -0600 | [diff] [blame] | 173 | T_SMALLOC_OBJS += gettime.o mutex.o smalloc.o t/log.o t/debug.o |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 174 | T_SMALLOC_PROGS = t/stest |
| 175 | |
| 176 | T_IEEE_OBJS = t/ieee754.o |
Jens Axboe | 84f43c6 | 2012-03-31 16:02:08 -0700 | [diff] [blame] | 177 | T_IEEE_OBJS += lib/ieee754.o |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 178 | T_IEEE_PROGS = t/ieee754 |
| 179 | |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 180 | T_ZIPF_OBS = t/genzipf.o |
Jens Axboe | 24baa4c | 2012-11-12 20:54:12 -0700 | [diff] [blame] | 181 | T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/zipf.o t/genzipf.o |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 182 | T_ZIPF_PROGS = t/fio-genzipf |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 183 | |
Jens Axboe | ad1f90a | 2012-11-28 21:29:14 +0100 | [diff] [blame] | 184 | T_AXMAP_OBJS = t/axmap.o |
| 185 | T_AXMAP_OBJS += lib/lfsr.o lib/axmap.o |
| 186 | T_AXMAP_PROGS = t/axmap |
| 187 | |
Alex Pyrgiotis | 7a887ff | 2013-03-08 14:37:04 +0200 | [diff] [blame] | 188 | T_LFSR_TEST_OBJS = t/lfsr-test.o |
Jens Axboe | 7a74197 | 2014-09-26 09:58:29 -0600 | [diff] [blame] | 189 | T_LFSR_TEST_OBJS += lib/lfsr.o gettime.o t/log.o t/debug.o |
Alex Pyrgiotis | 7a887ff | 2013-03-08 14:37:04 +0200 | [diff] [blame] | 190 | T_LFSR_TEST_PROGS = t/lfsr-test |
| 191 | |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 192 | ifeq ($(CONFIG_TARGET_OS), Linux) |
| 193 | T_BTRACE_FIO_OBJS = t/btrace2fio.o |
| 194 | T_BTRACE_FIO_OBJS += fifo.o lib/flist_sort.o t/log.o lib/linux-dev-lookup.o |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 195 | T_BTRACE_FIO_PROGS = t/fio-btrace2fio |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 196 | endif |
| 197 | |
Jens Axboe | 5aa702c | 2014-09-23 14:10:35 -0600 | [diff] [blame] | 198 | T_DEDUPE_OBJS = t/dedupe.o |
| 199 | T_DEDUPE_OBJS += lib/rbtree.o t/log.o mutex.o smalloc.o gettime.o crc/md5.o \ |
Jens Axboe | 91d9721 | 2014-09-27 21:28:47 -0600 | [diff] [blame] | 200 | memalign.o lib/bloom.o t/debug.o crc/xxhash.o crc/murmur3.o \ |
| 201 | crc/crc32c.o crc/crc32c-intel.o crc/fnv.o |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 202 | T_DEDUPE_PROGS = t/fio-dedupe |
Jens Axboe | 5aa702c | 2014-09-23 14:10:35 -0600 | [diff] [blame] | 203 | |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 204 | T_OBJS = $(T_SMALLOC_OBJS) |
| 205 | T_OBJS += $(T_IEEE_OBJS) |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 206 | T_OBJS += $(T_ZIPF_OBJS) |
Jens Axboe | ad1f90a | 2012-11-28 21:29:14 +0100 | [diff] [blame] | 207 | T_OBJS += $(T_AXMAP_OBJS) |
Alex Pyrgiotis | 7a887ff | 2013-03-08 14:37:04 +0200 | [diff] [blame] | 208 | T_OBJS += $(T_LFSR_TEST_OBJS) |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 209 | T_OBJS += $(T_BTRACE_FIO_OBJS) |
Jens Axboe | e1ecce5 | 2014-09-23 15:53:32 -0600 | [diff] [blame] | 210 | T_OBJS += $(T_DEDUPE_OBJS) |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 211 | |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 212 | T_TEST_PROGS = $(T_SMALLOC_PROGS) |
| 213 | T_TEST_PROGS += $(T_IEEE_PROGS) |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 214 | T_PROGS += $(T_ZIPF_PROGS) |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 215 | T_TEST_PROGS += $(T_AXMAP_PROGS) |
| 216 | T_TEST_PROGS += $(T_LFSR_TEST_PROGS) |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 217 | T_PROGS += $(T_BTRACE_FIO_PROGS) |
Jens Axboe | e1ecce5 | 2014-09-23 15:53:32 -0600 | [diff] [blame] | 218 | T_PROGS += $(T_DEDUPE_PROGS) |
| 219 | |
| 220 | PROGS += $(T_PROGS) |
Jens Axboe | 3427207 | 2011-08-16 10:01:03 +0200 | [diff] [blame] | 221 | |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 222 | ifneq ($(findstring $(MAKEFLAGS),s),s) |
| 223 | ifndef V |
| 224 | QUIET_CC = @echo ' ' CC $@; |
Jens Axboe | aa2eda7 | 2014-09-29 21:39:53 -0600 | [diff] [blame] | 225 | QUIET_LINK = @echo ' ' LINK $@; |
| 226 | QUIET_DEP = @echo ' ' DEP $@; |
| 227 | QUIET_YACC = @echo ' ' YACC $@; |
| 228 | QUIET_LEX = @echo ' ' LEX $@; |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 229 | endif |
| 230 | endif |
| 231 | |
Jens Axboe | a8168a2 | 2013-04-05 22:13:42 +0200 | [diff] [blame] | 232 | ifeq ($(CONFIG_TARGET_OS), SunOS) |
| 233 | INSTALL = ginstall |
| 234 | else |
| 235 | INSTALL = install |
| 236 | endif |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 237 | prefix = /usr/local |
| 238 | bindir = $(prefix)/bin |
Jens Axboe | bcdf7c5 | 2012-02-08 14:19:27 +0100 | [diff] [blame] | 239 | |
Aaron Carroll | 53cd4ee | 2013-03-14 16:57:38 +1100 | [diff] [blame] | 240 | ifeq ($(CONFIG_TARGET_OS), Darwin) |
Jens Axboe | bcdf7c5 | 2012-02-08 14:19:27 +0100 | [diff] [blame] | 241 | mandir = /usr/share/man |
Erwan Velu | eab4af4 | 2013-07-30 11:45:18 +0200 | [diff] [blame] | 242 | sharedir = /usr/share/fio |
Jens Axboe | bcdf7c5 | 2012-02-08 14:19:27 +0100 | [diff] [blame] | 243 | else |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 244 | mandir = $(prefix)/man |
Erwan Velu | eab4af4 | 2013-07-30 11:45:18 +0200 | [diff] [blame] | 245 | sharedir = $(prefix)/share/fio |
Jens Axboe | bcdf7c5 | 2012-02-08 14:19:27 +0100 | [diff] [blame] | 246 | endif |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 247 | |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 248 | all: $(PROGS) $(T_TEST_PROGS) $(SCRIPTS) FORCE |
Michael Zappe | f84622e | 2011-06-01 20:15:18 +0200 | [diff] [blame] | 249 | |
Jens Axboe | 3d43382 | 2012-03-21 22:25:22 +0100 | [diff] [blame] | 250 | .PHONY: all install clean |
| 251 | .PHONY: FORCE cscope |
| 252 | |
| 253 | FIO-VERSION-FILE: FORCE |
Bruce Cran | 84306c1 | 2012-04-16 19:33:03 +0200 | [diff] [blame] | 254 | @$(SHELL) ./FIO-VERSION-GEN |
Jens Axboe | 3d43382 | 2012-03-21 22:25:22 +0100 | [diff] [blame] | 255 | -include FIO-VERSION-FILE |
| 256 | |
David M. Lee | 7496ea3 | 2013-01-31 18:37:41 +0100 | [diff] [blame] | 257 | override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' |
Jens Axboe | 3d43382 | 2012-03-21 22:25:22 +0100 | [diff] [blame] | 258 | |
George Dowding | 41bfff8 | 2014-06-18 09:36:53 -0700 | [diff] [blame] | 259 | %.o : %.c |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 260 | $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< |
Jens Axboe | f67d6ee | 2013-02-01 15:51:23 +0100 | [diff] [blame] | 261 | @$(CC) -MM $(CFLAGS) $(CPPFLAGS) $*.c > $*.d |
| 262 | @mv -f $*.d $*.d.tmp |
| 263 | @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d |
| 264 | @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \ |
| 265 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d |
| 266 | @rm -f $*.d.tmp |
Diego Elio Pettenò | e52947d | 2011-03-21 20:13:53 +0100 | [diff] [blame] | 267 | |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 268 | ifdef CONFIG_ARITHMETIC |
Jens Axboe | aa2eda7 | 2014-09-29 21:39:53 -0600 | [diff] [blame] | 269 | lex.yy.c: exp/expression-parser.l |
Jens Axboe | e2e7032 | 2014-10-14 21:12:22 -0600 | [diff] [blame] | 270 | $(QUIET_LEX)$(LEX) exp/expression-parser.l |
Jens Axboe | aa2eda7 | 2014-09-29 21:39:53 -0600 | [diff] [blame] | 271 | |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 272 | lex.yy.o: lex.yy.c y.tab.h |
| 273 | $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< |
| 274 | |
| 275 | y.tab.o: y.tab.c y.tab.h |
| 276 | $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< |
| 277 | |
| 278 | y.tab.c: exp/expression-parser.y |
Bruce Cran | 6bde6be | 2014-10-15 14:16:35 -0600 | [diff] [blame] | 279 | $(QUIET_YACC)$(YACC) -l -d -b y exp/expression-parser.y |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 280 | |
Jens Axboe | 8cf2b45 | 2014-09-29 20:24:23 -0600 | [diff] [blame] | 281 | y.tab.h: y.tab.c |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 282 | |
Stephen M. Cameron | 50979ab | 2014-10-06 17:58:32 -0500 | [diff] [blame] | 283 | lexer.h: lex.yy.c |
| 284 | |
Jens Axboe | e27dadc | 2014-09-29 14:58:21 -0600 | [diff] [blame] | 285 | exp/test-expression-parser.o: exp/test-expression-parser.c |
| 286 | $(QUIET_CC)$(CC) -o $@ $(CFLAGS) $(CPPFLAGS) -c $< |
| 287 | exp/test-expression-parser: exp/test-expression-parser.o |
| 288 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) $< y.tab.o lex.yy.o -o $@ $(LIBS) |
| 289 | |
Stephen M. Cameron | 88b635b | 2014-09-29 12:10:49 -0600 | [diff] [blame] | 290 | parse.o: lex.yy.o y.tab.o |
| 291 | endif |
| 292 | |
Jens Axboe | cb340b1 | 2013-02-05 11:03:12 +0100 | [diff] [blame] | 293 | init.o: FIO-VERSION-FILE init.c |
Jens Axboe | 4feafb1 | 2013-01-24 23:07:55 -0700 | [diff] [blame] | 294 | $(QUIET_CC)$(CC) -o init.o $(CFLAGS) $(CPPFLAGS) -c init.c |
Jens Axboe | 32d4cc6 | 2012-04-13 14:06:08 +0200 | [diff] [blame] | 295 | |
Jens Axboe | f762cef | 2012-03-26 13:51:11 +0200 | [diff] [blame] | 296 | gcompat.o: gcompat.c gcompat.h |
| 297 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gcompat.c |
| 298 | |
Jens Axboe | 9af4a24 | 2012-03-16 10:13:49 +0100 | [diff] [blame] | 299 | goptions.o: goptions.c goptions.h |
| 300 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c goptions.c |
| 301 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 302 | ghelpers.o: ghelpers.c ghelpers.h |
| 303 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c ghelpers.c |
| 304 | |
Jens Axboe | 4166658 | 2012-03-21 10:25:29 +0100 | [diff] [blame] | 305 | gerror.o: gerror.c gerror.h |
| 306 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gerror.c |
| 307 | |
Jens Axboe | 1252d8f | 2012-03-21 11:13:31 +0100 | [diff] [blame] | 308 | gclient.o: gclient.c gclient.h |
| 309 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gclient.c |
| 310 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 311 | gfio.o: gfio.c ghelpers.c |
Jens Axboe | 70d07ce | 2012-02-24 13:11:35 +0100 | [diff] [blame] | 312 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gfio.c |
| 313 | |
Jens Axboe | 53e0e85 | 2012-03-15 19:38:01 +0100 | [diff] [blame] | 314 | graph.o: graph.c graph.h |
Stephen M. Cameron | af58ef3 | 2012-03-07 07:56:16 +0100 | [diff] [blame] | 315 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c graph.c |
| 316 | |
Stephen M. Cameron | ee2f55b | 2012-03-27 08:14:09 +0200 | [diff] [blame] | 317 | cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h |
| 318 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c cairo_text_helpers.c |
| 319 | |
Stephen M. Cameron | bf3f702 | 2012-03-27 08:14:48 +0200 | [diff] [blame] | 320 | printing.o: printing.c printing.h |
| 321 | $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c printing.c |
| 322 | |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 323 | t/stest: $(T_SMALLOC_OBJS) |
Grant Grundler | a3c86fc | 2013-09-04 14:12:09 -0600 | [diff] [blame] | 324 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS) |
Jens Axboe | 61f78f3 | 2011-10-05 10:25:54 +0200 | [diff] [blame] | 325 | |
| 326 | t/ieee754: $(T_IEEE_OBJS) |
Grant Grundler | a3c86fc | 2013-09-04 14:12:09 -0600 | [diff] [blame] | 327 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS) |
Jens Axboe | fbc2792 | 2011-08-16 09:56:27 +0200 | [diff] [blame] | 328 | |
Jens Axboe | 3376537 | 2012-04-11 22:25:26 +0200 | [diff] [blame] | 329 | fio: $(FIO_OBJS) |
Jens Axboe | 0b8d3cb | 2014-09-29 21:25:54 -0600 | [diff] [blame] | 330 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(HDFSLIB) |
Jens Axboe | 4c3ecec | 2008-03-01 16:20:13 +0100 | [diff] [blame] | 331 | |
Jens Axboe | 70d07ce | 2012-02-24 13:11:35 +0100 | [diff] [blame] | 332 | gfio: $(GFIO_OBJS) |
Jens Axboe | 0b8d3cb | 2014-09-29 21:25:54 -0600 | [diff] [blame] | 333 | $(QUIET_LINK)$(CC) $(LDFLAGS) -o gfio $(GFIO_OBJS) $(LIBS) $(GTK_LDFLAGS) |
Jens Axboe | 70d07ce | 2012-02-24 13:11:35 +0100 | [diff] [blame] | 334 | |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 335 | t/fio-genzipf: $(T_ZIPF_OBJS) |
Grant Grundler | a3c86fc | 2013-09-04 14:12:09 -0600 | [diff] [blame] | 336 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS) |
Jens Axboe | 6ff3885 | 2012-11-06 16:09:14 +0100 | [diff] [blame] | 337 | |
Jens Axboe | ad1f90a | 2012-11-28 21:29:14 +0100 | [diff] [blame] | 338 | t/axmap: $(T_AXMAP_OBJS) |
Grant Grundler | a3c86fc | 2013-09-04 14:12:09 -0600 | [diff] [blame] | 339 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_AXMAP_OBJS) $(LIBS) |
Jens Axboe | ad1f90a | 2012-11-28 21:29:14 +0100 | [diff] [blame] | 340 | |
Alex Pyrgiotis | 7a887ff | 2013-03-08 14:37:04 +0200 | [diff] [blame] | 341 | t/lfsr-test: $(T_LFSR_TEST_OBJS) |
Grant Grundler | a3c86fc | 2013-09-04 14:12:09 -0600 | [diff] [blame] | 342 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS) |
Alex Pyrgiotis | 7a887ff | 2013-03-08 14:37:04 +0200 | [diff] [blame] | 343 | |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 344 | ifeq ($(CONFIG_TARGET_OS), Linux) |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 345 | t/fio-btrace2fio: $(T_BTRACE_FIO_OBJS) |
Jens Axboe | 42a80e3 | 2014-09-16 17:06:52 +0200 | [diff] [blame] | 346 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_BTRACE_FIO_OBJS) $(LIBS) |
| 347 | endif |
| 348 | |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 349 | t/fio-dedupe: $(T_DEDUPE_OBJS) |
Jens Axboe | 5aa702c | 2014-09-23 14:10:35 -0600 | [diff] [blame] | 350 | $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_DEDUPE_OBJS) $(LIBS) |
| 351 | |
Jens Axboe | 3d43382 | 2012-03-21 22:25:22 +0100 | [diff] [blame] | 352 | clean: FORCE |
Jens Axboe | 500b4f4 | 2014-10-11 10:19:42 -0600 | [diff] [blame] | 353 | @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 Axboe | 45f944b | 2013-04-27 15:51:25 -0600 | [diff] [blame] | 354 | |
| 355 | distclean: clean FORCE |
Jens Axboe | 7788b76 | 2014-04-04 08:28:17 -0600 | [diff] [blame] | 356 | @rm -f cscope.out fio.pdf fio_generate_plots.pdf fio2gnuplot.pdf |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 357 | |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 358 | cscope: |
Jens Axboe | 366badd | 2010-07-19 16:18:35 -0600 | [diff] [blame] | 359 | @cscope -b -R |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 360 | |
Erwan Velu | 1378cc6 | 2013-08-07 16:02:25 +0200 | [diff] [blame] | 361 | tools/plot/fio2gnuplot.1: |
| 362 | @cat tools/plot/fio2gnuplot.manpage | txt2man -t fio2gnuplot > tools/plot/fio2gnuplot.1 |
| 363 | |
Jens Axboe | 7788b76 | 2014-04-04 08:28:17 -0600 | [diff] [blame] | 364 | doc: tools/plot/fio2gnuplot.1 |
| 365 | @man -t ./fio.1 | ps2pdf - fio.pdf |
| 366 | @man -t tools/fio_generate_plots.1 | ps2pdf - fio_generate_plots.pdf |
| 367 | @man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf |
| 368 | |
Erwan Velu | 1378cc6 | 2013-08-07 16:02:25 +0200 | [diff] [blame] | 369 | install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE |
Jens Axboe | 513ba3f | 2011-04-29 08:24:10 +0200 | [diff] [blame] | 370 | $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 371 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Aaron Carroll | d60e92d | 2007-09-17 10:32:59 +0200 | [diff] [blame] | 372 | $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1 |
| 373 | $(INSTALL) -m 644 fio.1 $(DESTDIR)$(mandir)/man1 |
Erwan Velu | 0460eb9 | 2013-07-30 11:54:45 +0200 | [diff] [blame] | 374 | $(INSTALL) -m 644 tools/fio_generate_plots.1 $(DESTDIR)$(mandir)/man1 |
Erwan Velu | 1378cc6 | 2013-08-07 16:02:25 +0200 | [diff] [blame] | 375 | $(INSTALL) -m 644 tools/plot/fio2gnuplot.1 $(DESTDIR)$(mandir)/man1 |
Erwan Velu | eab4af4 | 2013-07-30 11:45:18 +0200 | [diff] [blame] | 376 | $(INSTALL) -m 755 -d $(DESTDIR)$(sharedir) |
| 377 | $(INSTALL) -m 644 tools/plot/*gpm $(DESTDIR)$(sharedir)/ |