# $dotat: syncstone/Makefile,v 1.5 2006/10/02 20:46:12 fanf2 Exp $

CFLAGS	=	-pipe -O -g -pedantic -W -Wall -Wbad-function-cast	\
		-Wcast-align -Wcast-qual -Wchar-subscripts -Winline	\
		-Wmissing-prototypes -Wnested-externs -Wpointer-arith	\
		-Wredundant-decls -Wshadow -Wstrict-prototypes		\
		-Wwrite-strings

LDFLAGS	=	-lm


.SUFFIXES: .png .txt .args


all:	syncstone					\
	results/append1.png  results/append2.png	\
	results/syncapp1.png results/syncapp2.png	\
	results/sync1.png    results/sync2.png		\
	results/overwrite.png


results/overwrite.args: .dummy
	echo '' >$@

results/append1.args: .dummy
	echo ' -A' >$@

results/append2.args: .dummy
	echo ' -a' >$@

results/syncapp1.args: .dummy
	echo ' -A -S -w 10240' >$@

results/syncapp2.args: .dummy
	echo ' -A -s -w 10240' >$@

results/sync1.args: .dummy
	echo ' -S -w 10240' >$@

results/sync2.args: .dummy
	echo ' -s -w 10240' >$@



.args.txt: runss.sh
	./runss.sh $@ `cat $<`

.txt.png: gnuplot.in
	cp $< gnuplot.data
	gnuplot gnuplot.in >$@
	rm gnuplot.data


syncstone: syncstone.c


realclean: clean
	rm -rf results

clean:
	rm -rf working syncstone .dummy


# use a dummy file to avoid problems with directory timestamps
working results: .dummy

.dummy: Makefile
	mkdir -p working results
	touch .dummy
