Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 1 | CC = gcc |
Jens Axboe | 0ab8db8 | 2006-10-18 17:16:23 +0200 | [diff] [blame] | 2 | CFLAGS = -W -Wall -O2 -g -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 3 | PROGS = fio |
| 4 | SCRIPTS = fio_generate_plots |
Jens Axboe | 2f9ade3 | 2006-10-20 11:25:52 +0200 | [diff] [blame] | 5 | OBJS = fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o \ |
Jens Axboe | cb2c86f | 2006-10-26 13:48:34 +0200 | [diff] [blame] | 6 | filesetup.o eta.o verify.o memory.o io_u.o parse.o |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 7 | |
Jens Axboe | c1d5725 | 2006-10-09 19:56:04 +0200 | [diff] [blame] | 8 | INSTALL = install |
| 9 | prefix = /usr/local |
| 10 | bindir = $(prefix)/bin |
| 11 | libdir = $(prefix)/lib/fio |
| 12 | |
| 13 | FIO_INST_DIR = $(subst ','\'',$(prefix)) |
| 14 | |
| 15 | CFLAGS += '-D_INST_PREFIX="$(FIO_INST_DIR)"' |
| 16 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 17 | all: depend $(PROGS) $(SCRIPTS) |
Jens Axboe | 2866c82 | 2006-10-09 15:57:48 +0200 | [diff] [blame] | 18 | $(MAKE) -C engines |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 19 | |
Jens Axboe | 2f9ade3 | 2006-10-20 11:25:52 +0200 | [diff] [blame] | 20 | fio: $(OBJS) |
Jens Axboe | 2953f57 | 2006-10-20 09:20:11 +0200 | [diff] [blame] | 21 | $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -lm -ldl |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 22 | |
| 23 | clean: |
Jens Axboe | 2866c82 | 2006-10-09 15:57:48 +0200 | [diff] [blame] | 24 | -rm -f *.o .depend cscope.out $(PROGS) engines/*.o |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 25 | |
| 26 | depend: |
| 27 | @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend |
| 28 | |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 29 | cscope: |
| 30 | @cscope -b |
| 31 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 32 | install: $(PROGS) $(SCRIPTS) |
| 33 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 34 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
Jens Axboe | 2866c82 | 2006-10-09 15:57:48 +0200 | [diff] [blame] | 35 | $(INSTALL) -m755 -d $(DESTDIR) $(libdir) |
| 36 | $(INSTALL) engines/*.o $(libdir) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 37 | |
| 38 | ifneq ($(wildcard .depend),) |
| 39 | include .depend |
| 40 | endif |