# Makefile for PVS directories

.PHONY: all clean pvsclean deps

all:
	true

pvsfiles=\
	abstract_data.pvs \
	allocators.pvs \
	bits.pvs \
	challenge-linear.pvs \
	challenge-phymem.pvs \
	challenge-ptab-sync-master.pvs \
	constants.pvs \
	conversions.pvs \
	cpp-examples.pvs \
	cpp-verification.pvs \
	datatype_model.pvs \
	device_memory.pvs \
	everything.pvs \
	expressions.pvs \
	graph.pvs \
	hoare.pvs \
	linear_memory.pvs \
	memory.pvs \
	paging-data-models.pvs \
	paging-data.pvs \
	physical_memory.pvs \
	plain_memory.pvs \
	plain_memory_rewrites.pvs \
	ptab-sync-master-defs.pvs \
	ptab-sync-master.pvs \
	random_device.pvs \
	result.pvs \
	search-example.pvs \
	state-transformer.pvs \
	statement-rewrites.pvs \
	statements.pvs \
	types.pvs \
	vfiasco-prelude.pvs

deps-pag:
	pvscona -dep-file -paginate -size 1x1 $(pvsfiles)
	tred file-hierarchy.dot | dot -Tps > file-hierarchy-a4.ps
	pvscona -dep -paginate -size 6x1 $(pvsfiles)
	tred theory-hierarchy.dot | dot -Tps > theory-hierarchy-a4.ps
	pvscona -dep -cluster -paginate -size 4x2 -landscape $(pvsfiles)
	tred theory-hierarchy.dot | dot -Tps > theory-hierarchy-cluster-a4.ps

deps:
	pvscona -dep-file $(pvsfiles)
	tred file-hierarchy.dot | dot -Tps > file-hierarchy.ps
	pvscona -dep -thloc $(pvsfiles)
	tred theory-hierarchy.dot | dot -Tps > theory-hierarchy.ps
	pvscona -dep -cluster $(pvsfiles)
	tred theory-hierarchy.dot | dot -Tps > theory-hierarchy-cluster.ps


pvsclean: clean

clean:
	rm -rf pvsbin
	rm -f *bin
	rm -f .pvscontext
	rm -f *_adt.p*
	mkdir pvsbin

almostclean:
	rm -rf pvsbin
	rm -f *bin
	rm -f .pvscontext
	mkdir pvsbin

cleanall:
	rm -rf pvsbin
	rm -f *bin
	rm -f .pvscontext
	rm -f *_adt.p*
	rm -f *~
