X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=ccfa802bfb9bfc74158b3fe5ffa4171ec1297e07;hp=673107f0d1dffb9a9c58719ba52fab2e865d60e2;hb=62cb17de316e5aa755228fef8ce19b5f5353a3cf;hpb=93bcfd20e37cef8cec350fe06d3a086724c9f257 diff --git a/Makefile b/Makefile index 673107f0..ccfa802b 100644 --- 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,13 +14,15 @@ 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 \ engines/libaio.c engines/posixaio.c engines/sg.c \ engines/splice.c engines/syslet-rw.c engines/guasi.c \ - engines/binject.c engines/rdma.c profiles/tiobench.c + engines/binject.c engines/rdma.c profiles/tiobench.c \ + engines/fusion-aw.c engines/falloc.c engines/e4defrag.c LIBS += -lpthread -ldl -lrt -laio LDFLAGS += -rdynamic endif @@ -61,6 +63,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) @@ -93,11 +96,23 @@ else mandir = $(prefix)/man endif -all: .depend $(PROGS) $(SCRIPTS) +all: .depend $(PROGS) $(SCRIPTS) FORCE -.c.o: .depend +.PHONY: all install clean +.PHONY: FORCE cscope + +FIO-VERSION-FILE: FORCE + @$(SHELL) ./FIO-VERSION-GEN +-include FIO-VERSION-FILE + +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) @@ -112,13 +127,13 @@ fio: $(OBJS) $(PROGS): .depend -clean: - -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core +clean: FORCE + -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE cscope: @cscope -b -R -install: $(PROGS) $(SCRIPTS) +install: $(PROGS) $(SCRIPTS) FORCE $(INSTALL) -m 755 -d $(DESTDIR)$(bindir) $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) $(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1