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