blob: 7951751d9f95c3c9b91b786de5a3b083fee28647 [file] [log] [blame]
Jens Axboeebac4652005-12-08 15:25:21 +01001CC = gcc
Jens Axboe0ab8db82006-10-18 17:16:23 +02002CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
Jens Axboeebac4652005-12-08 15:25:21 +01003PROGS = fio
4SCRIPTS = fio_generate_plots
Jens Axboe2f9ade32006-10-20 11:25:52 +02005OBJS = fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \
Jens Axboecb2c86f2006-10-26 13:48:34 +02006 filesetup.o eta.o verify.o memory.o io_u.o parse.o
Jens Axboeebac4652005-12-08 15:25:21 +01007
Jens Axboec1d57252006-10-09 19:56:04 +02008INSTALL = install
9prefix = /usr/local
10bindir = $(prefix)/bin
11libdir = $(prefix)/lib/fio
12
13FIO_INST_DIR = $(subst ','\'',$(prefix))
14
15CFLAGS += '-D_INST_PREFIX="$(FIO_INST_DIR)"'
16
Jens Axboeebac4652005-12-08 15:25:21 +010017all: depend $(PROGS) $(SCRIPTS)
Jens Axboe2866c822006-10-09 15:57:48 +020018 $(MAKE) -C engines
Jens Axboeebac4652005-12-08 15:25:21 +010019
Jens Axboe2f9ade32006-10-20 11:25:52 +020020fio: $(OBJS)
Jens Axboe2953f572006-10-20 09:20:11 +020021 $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -lm -ldl
Jens Axboeebac4652005-12-08 15:25:21 +010022
23clean:
Jens Axboe2866c822006-10-09 15:57:48 +020024 -rm -f *.o .depend cscope.out $(PROGS) engines/*.o
Jens Axboeebac4652005-12-08 15:25:21 +010025
26depend:
27 @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
28
Jens Axboe592ef982006-06-06 20:58:57 +020029cscope:
30 @cscope -b
31
Jens Axboeebac4652005-12-08 15:25:21 +010032install: $(PROGS) $(SCRIPTS)
33 $(INSTALL) -m755 -d $(DESTDIR)$(bindir)
34 $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir)
Jens Axboe2866c822006-10-09 15:57:48 +020035 $(INSTALL) -m755 -d $(DESTDIR) $(libdir)
36 $(INSTALL) engines/*.o $(libdir)
Jens Axboeebac4652005-12-08 15:25:21 +010037
38ifneq ($(wildcard .depend),)
39include .depend
40endif