
CC	=	gcc
CFLAGS	+= 	-O -Wall -g -DAIO
CXXFLAGS+=	-O -Wall -g

ALL	=	no-write-to wait-for-readonly truncate-to otrunc \
		kswapd-writepage bash-shared-mapping usemem \
		check-hacked-dbench-file create-delete-data \
		owcmuowc copy-user-test chains jasper synctest \
		bsmith make-many-files qs qsbench write-and-fsync \
		atime-timer enospc-writepage fsx-linux enospc-write-middle \
		dribble mmap-eof time-read ra-thrash pwrite time-msync \
		write-super keep-file-dirty vm-eviction fsstress \
		create-and-unlink odwrite odread writev-speed mremap-test \
		create-delete make-teeny-files aio-test aio-stress \
		randfiles o1 fadvise ftruncate open-o_trunc \
		mmap-truncate mmap-munmap remap_file_pages randread \
		seek-then-straight rmap-test randwrite madvise \
		rawread bmap ext3_add_blocks sys_readahead direct_read_under \
		remap-test mq_test wbtest test_remap read-and-fsync \
		sync_file_range

%.o : %.c
	$(CC) $(CFLAGS) -Dlinux -DNO_XFS -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -c $<

all:	$(ALL)

check-hacked-dbench-file.o:	write-struct.h
owcmuowc.o:			write-struct.h

no-write-to:		no-write-to.o
truncate-ro:		truncate-to.o
wait-for-readonly:	wait-for-readonly.o
otrunc:			otrunc.o
kswapd-writepage:	kswapd-writepage.o
bash-shared-mapping:	bash-shared-mapping.o
usemem:			usemem.o
check-hacked-dbench-file: check-hacked-dbench-file.o
create-delete-data:	create-delete-data.o
owcmuowc:		owcmuowc.o
copy-user-test:		copy-user-test.o
chains:			chains.o
jasper:			jasper.o
synctest:		synctest.o
make-many-files:	make-many-files.o
bsmith:			bsmith.o
			g++ -O -Wall -g -o bsmith bsmith.cc
qs:			qs.o
qsbench:		qsbench.o
write-and-fsync:	write-and-fsync.o
atime-timer:		atime-timer.o
enospc-writepage:	enospc-writepage.o
enospc-write-middle:	enospc-write-middle.o
dribble:		dribble.o
mmap-eof:		mmap-eof.o
time-read:		time-read.o
ra-thrash:		ra-thrash.o
pwrite:			pwrite.o
time-msync:		time-msync.o
write-super:		write-super.o
keep-file-dirty:	keep-file-dirty.o
vm-eviction:		vm-eviction.o
fsstress:		fsstress.o
create-and-unlink:	create-and-unlink.o
odwrite:		odwrite.o
odread:			odread.o
writev-speed:		writev-speed.o
mremap-test:		mremap-test.o
create-delete:		create-delete.o
make-teeny-files:	make-teeny-files.o
google:			google.o
pollbench:		pollbench.o
randfiles:		randfiles.o
o1:			o1.o
fadvise:		fadvise.o
ftruncate:		ftruncate.o
open-o_trunc:		open-o_trunc.o
mmap-truncate:		mmap-truncate.o
mmap-munmap:		mmap-munmap.o
remap_file_pages:	remap_file_pages.o
randread:		randread.o
seek-then-straight:	seek-then-straight.o
rmap-test:		rmap-test.o
randwrite:		randwrite.o
statfs64:		statfs64.o
madvise:		madvise.o
bmap:			bmap.o
ext3_add_blocks:	ext3_add_blocks.o
sys_readahead:		sys_readahead.o
direct_read_under:	direct_read_under.o
remap-test:		remap-test.o
mq_test:		mq_test.o
wbtest:			wbtest.o
test_remap:		test_remap.o
read-and-fsync:		read-and-fsync.o
sync_file_range:	sync_file_range.o

fsstress.c:		global.h xfscompat.h

aio-test:		aio-test.o
	$(CC) $(LDFLAGS) -laio aio-test.o -o aio-test

aio-stress:		aio-stress.o
	$(CC) $(LDFLAGS) -laio -lpthread aio-stress.o -o aio-stress

fsx-linux:		fsx-linux.o
	$(CC) $(LDFLAGS) -laio fsx-linux.o -o fsx-linux

rawread:		rawread.o
	$(CC) $(LDFLAGS) -laio -lpthread rawread.o -o rawread

#pollbench:		pollbench.o
#	$(CXX) $(LDFLAGS) -lpthread polbench.o -o pollbench

clean:
	$(RM) *.o $(ALL)


