CFLAGS = -std=gnu99 -Wwrite-strings -Wall -Wdeclaration-after-statement $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) -I. -I$(SRCDIR)
LIBS += -lm $(EXTLIBS)
PROGS = fio
-SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/fio_latency2csv.py tools/hist/fiologparser_hist.py)
+SCRIPTS = $(addprefix $(SRCDIR)/,tools/fio_generate_plots tools/plot/fio2gnuplot tools/genfio tools/fiologparser.py tools/hist/fiologparser_hist.py)
ifndef CONFIG_FIO_NO_OPT
CFLAGS += -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
smalloc.c filehash.c profile.c debug.c engines/cpu.c \
engines/mmap.c engines/sync.c engines/null.c engines/net.c \
+ engines/ftruncate.c \
server.c client.c iolog.c backend.c libfio.c flow.c cconv.c \
gettime-thread.c helpers.c json.c idletime.c td_error.c \
profiles/tiobench.c profiles/act.c io_u_queue.c filelock.c \
ifndef CONFIG_STRLCAT
SOURCE += oslib/strlcat.c
endif
+ifndef CONFIG_HAVE_STRNDUP
+ SOURCE += oslib/strndup.c
+endif
ifndef CONFIG_GETOPT_LONG_ONLY
SOURCE += oslib/getopt_long.c
endif
LDFLAGS += -rdynamic
endif
ifeq ($(CONFIG_TARGET_OS), Android)
- SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c \
+ SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c profiles/tiobench.c \
oslib/linux-dev-lookup.c
LIBS += -ldl
LDFLAGS += -rdynamic
LIBS += -lpthread -ldl
endif
ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
- SOURCE := $(filter-out engines/mmap.c,$(SOURCE))
SOURCE += os/windows/posix.c
LIBS += -lpthread -lpsapi -lws2_32
CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format -static
T_ZIPF_OBS = t/genzipf.o
T_ZIPF_OBJS += t/log.o lib/ieee754.o lib/rand.o lib/pattern.o lib/zipf.o \
- lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o
+ lib/strntol.o lib/gauss.o t/genzipf.o oslib/strcasestr.o \
+ oslib/strndup.o
T_ZIPF_PROGS = t/fio-genzipf
T_AXMAP_OBJS = t/axmap.o
T_GEN_RAND_OBJS = t/gen-rand.o
T_GEN_RAND_OBJS += t/log.o t/debug.o lib/rand.o lib/pattern.o lib/strntol.o \
- oslib/strcasestr.o
+ oslib/strcasestr.o oslib/strndup.o
T_GEN_RAND_PROGS = t/gen-rand
ifeq ($(CONFIG_TARGET_OS), Linux)
T_MEMLOCK_OBJS = t/memlock.o
T_MEMLOCK_PROGS = t/memlock
+T_TT_OBJS = t/time-test.o
+T_TT_PROGS = t/time-test
+
T_OBJS = $(T_SMALLOC_OBJS)
T_OBJS += $(T_IEEE_OBJS)
T_OBJS += $(T_ZIPF_OBJS)
T_OBJS += $(T_VS_OBJS)
T_OBJS += $(T_PIPE_ASYNC_OBJS)
T_OBJS += $(T_MEMLOCK_OBJS)
+T_OBJS += $(T_TT_OBJS)
ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
all: $(PROGS) $(T_TEST_PROGS) $(SCRIPTS) FORCE
-.PHONY: all install clean
+.PHONY: all install clean test
.PHONY: FORCE cscope
FIO-VERSION-FILE: FORCE
@$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
+ifeq ($(CONFIG_TARGET_OS), NetBSD)
+ @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
+ sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
+else
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
+endif
@rm -f $*.d.tmp
ifdef CONFIG_ARITHMETIC
@$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SRCDIR)/$*.c > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
+ifeq ($(CONFIG_TARGET_OS), NetBSD)
+ @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | tr -cs "[:graph:]" "\n" | \
+ sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d
+else
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
+endif
@rm -f $*.d.tmp
gcompat.o: gcompat.c gcompat.h
t/fio-verify-state: $(T_VS_OBJS)
$(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_VS_OBJS) $(LIBS)
+t/time-test: $(T_TT_OBJS)
+ $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_TT_OBJS) $(LIBS)
+
clean: FORCE
@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 oslib/*.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
@rm -rf doc/output
@man -t tools/plot/fio2gnuplot.1 | ps2pdf - fio2gnuplot.pdf
@man -t tools/hist/fiologparser_hist.py.1 | ps2pdf - fiologparser_hist.pdf
-test:
+test: fio
+ ./fio --minimal --thread --ioengine=null --runtime=1s --name=nulltest --rw=randrw --iodepth=2 --norandommap --random_generator=tausworthe64 --size=16T --name=verifynulltest --rw=write --verify=crc32c --verify_state_save=0 --size=100M
install: $(PROGS) $(SCRIPTS) tools/plot/fio2gnuplot.1 FORCE
$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)