X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=Makefile;h=b1a498635975bf0fef363d0dd0442a4a9d5d7853;hp=684e8e04277b9fc23a9884ab70cdbc802e22c6d2;hb=53cdc6864f7471b28cc9b40a5314ab43e5b1cb5e;hpb=6796209a7e3d39522b0f5599aba277809786335e;ds=sidebyside diff --git a/Makefile b/Makefile index 684e8e04..b1a49863 100644 --- a/Makefile +++ b/Makefile @@ -3,13 +3,23 @@ CFLAGS = -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 ioengines.o init.o stat.o log.o 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 + $(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