X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=f6001ad3a825c1fec06008b55113dfb25535fd14;hb=aad39f4a045ea562c8e4b93db194d65d1e3570db;hp=091b858932ec726f6bcc2a24e9b4998c6da21fa4;hpb=ebac4655dd3624f3296ff83be48e0cdc02852f18;p=fio.git diff --git a/Makefile b/Makefile index 091b8589..f6001ad3 100644 --- a/Makefile +++ b/Makefile @@ -3,24 +3,35 @@ 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 fio-io.o fio-ini.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 + $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt -ldl clean: - -rm -f *.o .depend $(PROGS) + -rm -f *.o .depend cscope.out $(PROGS) engines/*.o depend: @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend -INSTALL = install -prefix = /usr/local -bindir = $(prefix)/bin +cscope: + @cscope -b 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