# $Id: Makefile,v 1.4 2005/11/12 00:51:57 connolly Exp $
W=../../../..
PD=$(W)/2001/02pd
SWAP=$(W)/2000/10/swap

include $(PD)/XSLTPROC.mak
include $(PD)/GVDOT.mak
#@@
DOT=/Applications/Graphviz.app/Contents/MacOS/dot

PYTHON=python

.SUFFIXES: .xgraph .dot

.xgraph.dot:
	$(XSLTPROC) --novalid $(PD)/rdf2dot.xsl $< >$@

# KLUDGE
# thanks to JibberJim in #swig 2005-11-11 for clues on svg/object size stuff
PERL=perl
.dot.svg:
	$(DOT) -Tsvg <$< >$@
	$(PERL) -i -pe 's/<svg width="\w+" height="\w+"/<svg width="100%" height="100%"/' $@


all: owl_smush1.png owl_smush2.png \
	owl_smush1.svg owl_smush2.svg \
	e1c.xgraph e1c.png e1c.svg \
	mash.png mash.svg

owl_smush1.xgraph: owl_smush1.n3
	$(PYTHON) $(SWAP)/cwm.py owl_smush1.n3 \
		--think --data --bySubject --rdf=br >$@

owl_smush2.xgraph: owl_smush1.n3
	$(PYTHON) $(SWAP)/cwm.py --closure=e owl_smush1.n3 \
		--think --data --bySubject --rdf=br >$@

../,mash.rdf:
	(cd ..; make ,mash.rdf)

# depends on using an old version of cwm 1.162 2004/8/8
mash.xgraph: ../,mash.rdf whowhere.n3
	$(PYTHON) $(SWAP)/cwm.py  ../,mash.rdf whowhere.n3 \
		--think --data --bySubject --rdf=br >$@


e1c.xgraph: ../,e1.rdf calbg.n3
	$(PYTHON) $(SWAP)/cwm.py ../,e1.rdf calbg.n3 whowhere.n3 --think --base=abs: --data --rdf=br >$@

