X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=e93bf4d748f0b1d112bcef031bde7ac6af578ee0;hp=7a175552d4121d7e040c612ddb07555a2fe1d177;hb=7089165b973c6bc48e11cadcb5a39c7adbae124c;hpb=ff01f0f16e1c065809a5be06b57d2a92f8886561 diff --git a/Makefile b/Makefile index 7a175552..e93bf4d7 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,3 @@ -DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG -CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(DEBUGFLAGS) -OPTFLAGS= -O3 -g -ffast-math $(EXTFLAGS) -CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS) -LIBS = -lm $(EXTLIBS) -PROGS = fio -SCRIPTS = fio_generate_plots -UNAME := $(shell uname) - ifneq ($(wildcard config-host.mak),) all: include config-host.mak @@ -21,15 +12,27 @@ all: include config-host.mak endif -SOURCE := gettime.c fio.c ioengines.c init.c stat.c log.c time.c filesetup.c \ +DEBUGFLAGS = -D_FORTIFY_SOURCE=2 -DFIO_INC_DEBUG +CPPFLAGS= -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(DEBUGFLAGS) +OPTFLAGS= -O3 -g -ffast-math +CFLAGS = -std=gnu99 -Wwrite-strings -Wall $(OPTFLAGS) $(EXTFLAGS) $(BUILD_CFLAGS) +LIBS += -lm $(EXTLIBS) +PROGS = fio +SCRIPTS = fio_generate_plots + +ifdef CONFIG_GFIO + PROGS += gfio +endif + +SOURCE := gettime.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/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 \ - json.c lib/zipf.c lib/axmap.c lib/lfsr.c gettime-thread.c \ - helpers.c lib/flist_sort.c lib/hweight.c lib/getrusage.c \ - idletime.c + cconv.c lib/prio_tree.c json.c lib/zipf.c lib/axmap.c \ + lib/lfsr.c gettime-thread.c helpers.c lib/flist_sort.c \ + lib/hweight.c lib/getrusage.c idletime.c ifdef CONFIG_64BIT_LLP64 CFLAGS += -DBITS_PER_LONG=32 @@ -73,6 +76,9 @@ endif ifndef CONFIG_STRSEP SOURCE += lib/strsep.c endif +ifndef CONFIG_STRCASESTR + SOURCE += lib/strcasestr.c +endif ifndef CONFIG_GETOPT_LONG_ONLY SOURCE += lib/getopt_long.c endif @@ -80,42 +86,42 @@ ifndef CONFIG_INET_ATON SOURCE += lib/inet_aton.c endif -ifeq ($(UNAME), Linux) +ifeq ($(CONFIG_TARGET_OS), Linux) SOURCE += diskutil.c fifo.c blktrace.c cgroup.c trim.c engines/sg.c \ engines/binject.c profiles/tiobench.c LIBS += -lpthread -ldl LDFLAGS += -rdynamic endif -ifeq ($(UNAME), Android) +ifeq ($(CONFIG_TARGET_OS), Android) SOURCE += diskutil.c fifo.c blktrace.c trim.c profiles/tiobench.c LIBS += -ldl LDFLAGS += -rdynamic endif -ifeq ($(UNAME), SunOS) +ifeq ($(CONFIG_TARGET_OS), SunOS) LIBS += -lpthread -ldl CPPFLAGS += -D__EXTENSIONS__ endif -ifeq ($(UNAME), FreeBSD) +ifeq ($(CONFIG_TARGET_OS), FreeBSD) LIBS += -lpthread -lrt LDFLAGS += -rdynamic endif -ifeq ($(UNAME), NetBSD) +ifeq ($(CONFIG_TARGET_OS), NetBSD) LIBS += -lpthread -lrt LDFLAGS += -rdynamic endif -ifeq ($(UNAME), AIX) +ifeq ($(CONFIG_TARGET_OS), AIX) LIBS += -lpthread -ldl -lrt CPPFLAGS += -D_LARGE_FILES -D__ppc__ LDFLAGS += -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000 endif -ifeq ($(UNAME), HP-UX) +ifeq ($(CONFIG_TARGET_OS), HP-UX) LIBS += -lpthread -ldl -lrt CFLAGS += -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE_EXTENDED endif -ifeq ($(UNAME), Darwin) +ifeq ($(CONFIG_TARGET_OS), Darwin) LIBS += -lpthread -ldl endif -ifneq (,$(findstring CYGWIN,$(UNAME))) +ifneq (,$(findstring CYGWIN,$(CONFIG_TARGET_OS))) SOURCE := $(filter-out engines/mmap.c,$(SOURCE)) SOURCE += os/windows/posix.c LIBS += -lpthread -lpsapi -lws2_32 @@ -123,6 +129,11 @@ ifneq (,$(findstring CYGWIN,$(UNAME))) endif OBJS = $(SOURCE:.c=.o) + +FIO_OBJS = $(OBJS) fio.o +GFIO_OBJS = $(OBJS) gfio.o graph.o tickmarks.o ghelpers.o goptions.o gerror.o \ + gclient.o gcompat.o cairo_text_helpers.o printing.o + -include $(OBJS:.o=.d) T_SMALLOC_OBJS = t/stest.o @@ -165,11 +176,15 @@ ifndef V endif endif -INSTALL = install +ifeq ($(CONFIG_TARGET_OS), SunOS) + INSTALL = ginstall +else + INSTALL = install +endif prefix = /usr/local bindir = $(prefix)/bin -ifeq ($(UNAME), Darwin) +ifeq ($(CONFIG_TARGET_OS), Darwin) mandir = /usr/share/man else mandir = $(prefix)/man @@ -198,12 +213,45 @@ override CFLAGS += -DFIO_VERSION='"$(FIO_VERSION)"' init.o: FIO-VERSION-FILE init.c $(QUIET_CC)$(CC) -o init.o $(CFLAGS) $(CPPFLAGS) -c init.c +gcompat.o: gcompat.c gcompat.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gcompat.c + +goptions.o: goptions.c goptions.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c goptions.c + +ghelpers.o: ghelpers.c ghelpers.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c ghelpers.c + +gerror.o: gerror.c gerror.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gerror.c + +gclient.o: gclient.c gclient.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gclient.c + +gfio.o: gfio.c ghelpers.c + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c gfio.c + +graph.o: graph.c graph.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c graph.c + +cairo_text_helpers.o: cairo_text_helpers.c cairo_text_helpers.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c cairo_text_helpers.c + +printing.o: printing.c printing.h + $(QUIET_CC)$(CC) $(CFLAGS) $(GTK_CFLAGS) $(CPPFLAGS) -c printing.c + t/stest: $(T_SMALLOC_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_SMALLOC_OBJS) $(LIBS) $(LDFLAGS) t/ieee754: $(T_IEEE_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_IEEE_OBJS) $(LIBS) $(LDFLAGS) +fio: $(FIO_OBJS) + $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(FIO_OBJS) $(LIBS) $(LDFLAGS) + +gfio: $(GFIO_OBJS) + $(QUIET_LINK)$(CC) $(LIBS) -o gfio $(GFIO_OBJS) $(LIBS) $(GTK_LDFLAGS) + t/genzipf: $(T_ZIPF_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_ZIPF_OBJS) $(LIBS) $(LDFLAGS) @@ -213,11 +261,8 @@ t/axmap: $(T_AXMAP_OBJS) t/lfsr-test: $(T_LFSR_TEST_OBJS) $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(T_LFSR_TEST_OBJS) $(LIBS) $(LDFLAGS) -fio: $(OBJS) - $(QUIET_LINK)$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(LDFLAGS) - clean: FORCE - -rm -f .depend $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core FIO-VERSION-FILE config-host.mak config-host.h cscope.out *.d + -rm -f .depend $(FIO_OBJS) $(GFIO_OBJS) $(OBJS) $(T_OBJS) $(PROGS) $(T_PROGS) core.* core gfio FIO-VERSION-FILE config-host.mak config-host.h cscope.out *.d cscope: @cscope -b -R