# Makefile for tXSchema benchmark.
# Last updated: January 24, 2013 (Stephen W. Thomas)
#
# See the main tBench README.txt file for usage instructions.
#

# First, load the default settings and paths from the parent Makefile.inc. 
include ../../Makefile.inc

# Targets
all: clean create validate execute
create: data schema workload
validate: vschema vdata vworkload

# Make these targets always run (not dependent on any timestamps)
.PHONY: clean data schema workload vdata vschema vworkload execute

clean: 
	@ echo "\n=============================="
	@ echo "Cleaning the benchmark:"
	@ echo "=============================="
	@ echo ""
	rm -rf data 
	rm -rf logs
	mkdir logs
    

data: 
	@ echo "\n=============================="
	@ echo "Loading/creating data:"
	@ echo "=============================="
	@ echo ""
	ln -sf ../tXBench/data


schema: 
	@ echo "\n=============================="
	@ echo "Loading/creating schema:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (Schemas currently needs to be created manually.)"
	@ echo "  (TODO - Make changes with additional constraints.)"


workload: 
	@ echo "\n=============================="
	@ echo "Loading/creating workload:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (There is no workload in this benchmark. (The schema is the workload.))"
    

vschema:
	@ echo "\n=============================="
	@ echo "Validating the schema:"
	@ echo "=============================="
	@ echo ""
	xmllint --noout schemas/DCSD-base.xsd
	xmllint --noout schemas/representational.xsd
	@ echo "  (TODO - Add ts schema check.)"


vdata:
	@ echo "\n=============================="
	@ echo "Validating the data against the schema:"
	@ echo "=============================="
	@ echo ""
	@ # First, check the temporal data vs. rep schema
	# xmllint --noout --schema schemas/representational.xsd
	@ # TODO: call runAll and runOne as appropriate
    


vworkload:
	@ echo "\n=============================="
	@ echo "Validating the workload against the schema:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (No workload to validate.)"

execute: 
	@ echo "\n=============================="
	@ echo "Executing the workload against the data:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (No workload to execute. See the "vdata" target.)"

