X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=9dc4729f75e6626b5b0361a988ba4ef25cf78011;hp=16c8413643a69300228eb518189a3809be397bf6;hb=0ab8db8943acc6b9ea778735563bfad2a79e8ddd;hpb=592ef98a623407437c1807bc29deaa87726de5b4 diff --git a/Makefile b/Makefile index 16c84136..9dc4729f 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,25 @@ CC = gcc -CFLAGS = -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 PROGS = fio SCRIPTS = fio_generate_plots +INSTALL = install +prefix = /usr/local +bindir = $(prefix)/bin +libdir = $(prefix)/lib/fio + +FIO_INST_DIR = $(subst ','\'',$(prefix)) + +CFLAGS += '-D_INST_PREFIX="$(FIO_INST_DIR)"' + all: depend $(PROGS) $(SCRIPTS) + $(MAKE) -C engines -fio: fio.o fio-io.o fio-ini.o fio-stat.o fio-log.o fio-time.o md5.o crc32.o - $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt +fio: fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o filesetup.o eta.o verify.o + $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt -ldl clean: - -rm -f *.o .depend cscope.out $(PROGS) + -rm -f *.o .depend cscope.out $(PROGS) engines/*.o depend: @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend @@ -17,13 +27,11 @@ depend: cscope: @cscope -b -INSTALL = install -prefix = /usr/local -bindir = $(prefix)/bin - install: $(PROGS) $(SCRIPTS) $(INSTALL) -m755 -d $(DESTDIR)$(bindir) $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) + $(INSTALL) -m755 -d $(DESTDIR) $(libdir) + $(INSTALL) engines/*.o $(libdir) ifneq ($(wildcard .depend),) include .depend