# Makefile for PSM-DB2 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 schemas/ddl


data: 
	@ echo "\n=============================="
	@ echo "Loading/creating data:"
	@ echo "=============================="
	@ echo ""
	@ # Link to the data from the parent benchmark
	ln -sf ../PSM/data

schema: 
	@ echo "\n=============================="
	@ echo "Loading/creating schema:"
	@ echo "=============================="
	@ echo ""
	@ # Link to the schema from the parent benchmark
	ln -sf ../PSM/schemas/ddl schemas/ddl
	@ echo "  (Load script (load.txt) was created manually, and is in place.)"

workload: 
	@ echo "\n=============================="
	@ echo "Loading/creating workload:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (Workload currently needs to be transformmed manually.)"
	@ echo "  (TODO: Insert TXL script when done.)"

vschema:
	@ echo "\n=============================="
	@ echo "Validating the schema:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (No validation required; component is copied from parent.)"

vdata:
	@ echo "\n=============================="
	@ echo "Validating the data against the schema:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (No validation required; component is copied from parent.)"

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

execute: 
	@ echo "\n=============================="
	@ echo "Executing the workload against the data:"
	@ echo "=============================="
	@ echo ""
	@ echo "  (TODO: insert script to execute the workload.)"

