Add a simple json encoder and use it to print fio output in json format
[fio.git] / Makefile
index 252b0a9fa723192f9d654680d0a44d26993b8460..bac062c65c14e66578ac397965d463e6278f49f7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CC     = gcc
+CC     ?= gcc
 DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG
 CPPFLAGS= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
        $(DEBUGFLAGS)
@@ -14,7 +14,7 @@ SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.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 flow.c
+               memalign.c server.c client.c iolog.c backend.c libfio.c flow.c json.c
 
 ifeq ($(UNAME), Linux)
   SOURCE += diskutil.c fifo.c blktrace.c helpers.c cgroup.c trim.c \
@@ -61,6 +61,7 @@ ifneq (,$(findstring CYGWIN,$(UNAME)))
   LIBS  += -lpthread -lpsapi -lws2_32
   CFLAGS += -DPSAPI_VERSION=1 -Ios/windows/posix/include -Wno-format
   CC     = x86_64-w64-mingw32-gcc
+  #CC    = i686-w64-mingw32-gcc
 endif
 
 OBJS = $(SOURCE:.c=.o)
@@ -99,7 +100,7 @@ all: .depend $(PROGS) $(SCRIPTS) FORCE
 .PHONY: FORCE cscope
 
 FIO-VERSION-FILE: FORCE
-       @$(SHELL_PATH) ./FIO-VERSION-GEN
+       @$(SHELL) ./FIO-VERSION-GEN
 -include FIO-VERSION-FILE
 
 CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
@@ -107,6 +108,9 @@ CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"'
 .c.o: .depend FORCE
        $(QUIET_CC)$(CC) -o $@ -c $(CFLAGS) $(CPPFLAGS) $<
 
+init.o: FIO-VERSION-FILE
+       $(QUIET_CC)$(CC) -o init.o -c $(CFLAGS) $(CPPFLAGS) -c init.c
+
 t/stest: $(T_SMALLOC_OBJS)
        $(QUIET_CC)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS) $(LDFLAGS)
 
@@ -119,7 +123,7 @@ fio: $(OBJS)
 .depend: $(SOURCE)
        $(QUIET_DEP)$(CC) -MM $(CFLAGS) $(CPPFLAGS) $(SOURCE) 1> .depend
 
-$(PROGS): .depend FORCE
+$(PROGS): .depend
 
 clean: FORCE
        -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE