X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=61e2163fb604f254b1e84e846e8ee8a1e49182fd;hp=8d8802d6ab7b34d0810ef91b0e0986e7007eba06;hb=a6204b6818e0b5bf7c7aae0bd8fd840f71e2c4a3;hpb=bcdf7c586610734ad617ffd4efeb0e56fe9ac440 diff --git a/Makefile b/Makefile index 8d8802d6..61e2163f 100644 --- a/Makefile +++ b/Makefile @@ -9,12 +9,12 @@ 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 \ +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 + memalign.c server.c client.c iolog.c backend.c libfio.c flow.c ifeq ($(UNAME), Linux) SOURCE += diskutil.c fifo.c blktrace.c helpers.c cgroup.c trim.c \ @@ -56,9 +56,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) @@ -91,11 +93,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_PATH) ./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) @@ -110,13 +124,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