fio: groundwork for adding slat, lat percentiles
[fio.git] / Makefile
index 271269f9256485ac16364a6f41aee6092f3c0987..027b62bcbb6f0bf573a15ddf6488e20cb7818567 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ SOURCE :=     $(sort $(patsubst $(SRCDIR)/%,%,$(wildcard $(SRCDIR)/crc/*.c)) \
                pshared.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 engines/filecreate.c \
+               engines/ftruncate.c engines/filecreate.c engines/filestat.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 \
@@ -208,7 +208,8 @@ ifeq ($(CONFIG_TARGET_OS), Darwin)
   LIBS  += -lpthread -ldl
 endif
 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
-  SOURCE += os/windows/posix.c
+  SOURCE += os/windows/cpu-affinity.c os/windows/posix.c
+  WINDOWS_OBJS = os/windows/cpu-affinity.o os/windows/posix.o lib/hweight.o
   LIBS  += -lpthread -lpsapi -lws2_32 -lssp
   CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
 endif
@@ -299,9 +300,9 @@ T_OBJS += $(T_TT_OBJS)
 T_OBJS += $(T_IOU_RING_OBJS)
 
 ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS)))
-    T_DEDUPE_OBJS += os/windows/posix.o lib/hweight.o
-    T_SMALLOC_OBJS += os/windows/posix.o lib/hweight.o
-    T_LFSR_TEST_OBJS += os/windows/posix.o lib/hweight.o
+    T_DEDUPE_OBJS += $(WINDOWS_OBJS)
+    T_SMALLOC_OBJS += $(WINDOWS_OBJS)
+    T_LFSR_TEST_OBJS += $(WINDOWS_OBJS)
 endif
 
 T_TEST_PROGS = $(T_SMALLOC_PROGS)
@@ -387,13 +388,14 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
        @$(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
+       @if type -p fmt >/dev/null 2>&1; then                           \
+               sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -w 1 |  \
+               sed -e 's/^ *//' -e 's/$$/:/' >> $*.d;                  \
+       else                                                            \
+               sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp |             \
+               tr -cs "[:graph:]" "\n" |                               \
+               sed -e 's/^ *//' -e '/^$$/ d' -e 's/$$/:/' >> $*.d;     \
+       fi
        @rm -f $*.d.tmp
 
 ifdef CONFIG_ARITHMETIC