fio: factor out endian_check
[fio.git] / Makefile
index dc468b5663a349fc63308032cc66d81279a528d5..434ad704d252c057725aa098baab4c9747bcf855 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,12 +9,16 @@ PROGS = fio
 SCRIPTS = fio_generate_plots
 UNAME  := $(shell uname)
 
-SOURCE = gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
+GTKCFLAGS = `pkg-config gtk+-2.0 --cflags`
+GTKLDFLAGS = `pkg-config gtk+-2.0 --libs`
+
+SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \
                eta.c verify.c memory.c io_u.c parse.c mutex.c options.c \
                rbtree.c smalloc.c filehash.c profile.c debug.c lib/rand.c \
                lib/num2str.c lib/ieee754.c $(wildcard crc/*.c) engines/cpu.c \
                engines/mmap.c engines/sync.c engines/null.c engines/net.c \
-               memalign.c server.c client.c iolog.c backend.c libfio.c
+               memalign.c server.c client.c iolog.c backend.c libfio.c flow.c \
+               endian_check.c
 
 ifeq ($(UNAME), Linux)
   SOURCE += diskutil.c fifo.c blktrace.c helpers.c cgroup.c trim.c \
@@ -56,9 +60,11 @@ ifeq ($(UNAME), Darwin)
   LIBS  += -lpthread -ldl
 endif
 ifneq (,$(findstring CYGWIN,$(UNAME)))
-  SOURCE += engines/windowsaio.c
-  LIBS  += -lpthread -lrt -lpsapi
-  CFLAGS += -DPSAPI_VERSION=1
+  SOURCE := $(filter-out engines/mmap.c,$(SOURCE))
+  SOURCE += engines/windowsaio.c os/windows/posix.c
+  LIBS  += -lpthread -lpsapi -lws2_32
+  CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
+  CC     = x86_64-w64-mingw32-gcc
 endif
 
 OBJS = $(SOURCE:.c=.o)
@@ -126,3 +132,8 @@ install: $(PROGS) $(SCRIPTS)
 ifneq ($(wildcard .depend),)
 include .depend
 endif
+
+gfio:  gfio.c
+       $(CC) ${CFLAGS} ${GTKCFLAGS} ${GTKLDFLAGS} -pthread -o gfio gfio.c
+
+