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 | |
| 6 | all: depend $(PROGS) $(SCRIPTS) |
| 7 | |
Jens Axboe | 6796209 | 2006-06-07 08:45:01 +0200 | [diff] [blame] | 8 | fio: fio.o ioengines.o init.o stat.o log.o time.o md5.o crc32.o |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 9 | $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) -lpthread -laio -lm -lrt |
| 10 | |
| 11 | clean: |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 12 | -rm -f *.o .depend cscope.out $(PROGS) |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 13 | |
| 14 | depend: |
| 15 | @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend |
| 16 | |
Jens Axboe | 592ef98 | 2006-06-06 20:58:57 +0200 | [diff] [blame] | 17 | cscope: |
| 18 | @cscope -b |
| 19 | |
Jens Axboe | ebac465 | 2005-12-08 15:25:21 +0100 | [diff] [blame] | 20 | INSTALL = install |
| 21 | prefix = /usr/local |
| 22 | bindir = $(prefix)/bin |
| 23 | |
| 24 | install: $(PROGS) $(SCRIPTS) |
| 25 | $(INSTALL) -m755 -d $(DESTDIR)$(bindir) |
| 26 | $(INSTALL) $(PROGS) $(SCRIPTS) $(DESTDIR)$(bindir) |
| 27 | |
| 28 | ifneq ($(wildcard .depend),) |
| 29 | include .depend |
| 30 | endif |