all: test1 test2 test3 test4 test5 test6 test7

platform:
	touch platform

#-----------------------------------------------------------------------------
# TEST 1
#-----------------------------------------------------------------------------

test1mat: test1mat.cpp platform
	g++ -O2 -o test1mat test1mat.cpp

test1pull: test1pull.cpp platform
	g++ -O2 -o test1pull test1pull.cpp

test1push: test1push.cpp platform
	g++ -O2 -o test1push test1push.cpp

test1opt: test1opt.cpp platform
	g++ -O2 -o test1opt test1opt.cpp

test1pushS: test1pushS.cpp platform
	g++ -O2 -o test1pushS test1pushS.cpp

test1pushL: test1pushL.cpp platform
	g++ -O2 -o test1pushL test1pushL.cpp

test1main: test1main.cpp platform
	g++ -O2 -o test1main test1main.cpp

test1pushN: test1pushN.cpp platform
	g++ -O2 -o test1pushN test1pushN.cpp

test1: test1mat test1pull test1push test1opt test1pushS test1pushL test1main
	@echo "*** Test 1: Materialization ***"
	./test1mat
	./test1mat
	./test1mat
	@echo
	@echo "*** Test 1: Pull ***"
	./test1pull
	./test1pull
	./test1pull
	@echo
	@echo "*** Test 1: Push ***"
	./test1push
	./test1push
	./test1push
	@echo
	@echo "*** Test 1: Push (with optimization) ***"
	./test1opt
	./test1opt
	./test1opt
	@echo
	@echo "*** Test 1: Push (static variables) ***"
	./test1pushS
	./test1pushS
	./test1pushS
	@echo
	@echo "*** Test 1: Push (local variables) ***"
	./test1pushL
	./test1pushL
	./test1pushL
	@echo
	@echo "*** Test 1: Push (in main program) ***"
	./test1main
	./test1main
	./test1main

test1extra: test1pushN
	@echo "*** Test 1: Push (no goto, local variables) ***"
	./test1pushN
	./test1pushN
	./test1pushN

#-----------------------------------------------------------------------------
# TEST 2
#-----------------------------------------------------------------------------


test2mat: test2mat.cpp platform
	g++ -O2 -o test2mat test2mat.cpp

test2pull: test2pull.cpp platform
	g++ -O2 -o test2pull test2pull.cpp

test2push: test2push.cpp platform
	g++ -O2 -o test2push test2push.cpp

test2bind: test2bind.cpp platform
	g++ -O2 -o test2bind test2bind.cpp

test2: test2mat test2pull test2push test2bind
	@echo "*** Test 2: Materialization ***"
	./test2mat
	@echo
	@echo "*** Test 2: Pull ***"
	./test2pull
	@echo
	@echo "*** Test 2: Push (local vars) ***"
	./test2push
	@echo
	@echo "*** Test 2: Pull with passing of bindings ***"
	./test2bind

#-----------------------------------------------------------------------------
# TEST 3
#-----------------------------------------------------------------------------

test3mat: test3mat.cpp platform
	g++ -O2 -o test3mat test3mat.cpp

test3push: test3push.cpp platform
	g++ -O2 -o test3push test3push.cpp

test3bind: test3bind.cpp platform
	g++ -O2 -o test3bind test3bind.cpp

test3bindF: test3bindF.cpp platform
	g++ -O2 -o test3bindF test3bindF.cpp

test3: test3mat test3push test3bind test3bindF
	@echo "*** Test 3: Materialization ***"
	./test3mat
	./test3mat
	./test3mat
	@echo
	@echo "*** Test 3: Push (local vars) ***"
	./test3push
	./test3push
	./test3push
	@echo
	@echo "*** Test 3: Pull with passing of bindings ***"
	./test3bind
	./test3bind
	./test3bind
	@echo
	@echo "*** Test 3: Pull with passing of bindings, Function ***"
	./test3bindF
	./test3bindF
	./test3bindF

#-----------------------------------------------------------------------------
# TEST 4
#-----------------------------------------------------------------------------

test4mat: test4mat.cpp platform
	g++ -O2 -o test4mat test4mat.cpp

test4pull: test4pull.cpp platform
	g++ -O2 -o test4pull test4pull.cpp

test4push: test4push.cpp platform
	g++ -O2 -o test4push test4push.cpp

test4: test4mat test4pull test4push
	@echo "*** Test 4: Materialization ***"
	./test4mat
	./test4mat
	./test4mat
	@echo
	@echo "*** Test 4: Pull ***"
	./test4pull
	./test4pull
	./test4pull
	@echo
	@echo "*** Test 4: Push ***"
	./test4push
	./test4push
	./test4push

#-----------------------------------------------------------------------------
# TEST 5
#-----------------------------------------------------------------------------


test5mat: test5mat.cpp platform
	g++ -O2 -o test5mat test5mat.cpp

test5pull: test5pull.cpp platform
	g++ -O2 -o test5pull test5pull.cpp

test5push: test5push.cpp platform
	g++ -O2 -o test5push test5push.cpp

test5opt: test5opt.cpp platform
	g++ -O2 -o test5opt test5opt.cpp

test5: test5mat test5pull test5push test5opt
	@echo "*** Test 5: Materialization ***"
	./test5mat
	./test5mat
	./test5mat
	@echo
	@echo "*** Test 5: Pull ***"
	./test5pull
	./test5pull
	./test5pull
	@echo
	@echo "*** Test 5: Push ***"
	./test5push
	./test5push
	./test5push
	@echo
	@echo "*** Test 5: Push (with opt) ***"
	./test5opt
	./test5opt
	./test5opt

#-----------------------------------------------------------------------------
# TEST 6
#-----------------------------------------------------------------------------

test6mat: test6mat.cpp platform
	g++ -O2 -o test6mat test6mat.cpp

test6pull: test6pull.cpp platform
	g++ -O2 -o test6pull test6pull.cpp

test6push: test6push.cpp platform
	g++ -O2 -o test6push test6push.cpp

test6: test6mat test6pull test6push
	@echo "*** Test 6: Materialization ***"
	./test6mat
	./test6mat
	./test6mat
	@echo
	@echo "*** Test 6: Pull ***"
	./test6pull
	./test6pull
	./test6pull
	@echo
	@echo "*** Test 6: Push ***"
	./test6push
	./test6push
	./test6push

#-----------------------------------------------------------------------------
# TEST 7
#-----------------------------------------------------------------------------

test7mat: test7mat.cpp platform
	g++ -O2 -o test7mat test7mat.cpp

test7pull: test7pull.cpp platform
	g++ -O2 -o test7pull test7pull.cpp

test7push: test7push.cpp platform
	g++ -O2 -o test7push test7push.cpp

test7: test7mat test7pull test7push
	@echo "*** Test 7: Materialization ***"
	./test7mat
	./test7mat
	./test7mat
	@echo
	@echo "*** Test 7: Pull ***"
	./test7pull
	./test7pull
	./test7pull
	@echo
	@echo "*** Test 7: Push ***"
	./test7push
	./test7push
	./test7push

#-----------------------------------------------------------------------------
# TEST 8
#-----------------------------------------------------------------------------

test8mat: test8mat.cpp platform
	g++ -O2 -o test8mat test8mat.cpp

test8bind: test8bind.cpp platform
	g++ -O2 -o test8bind test8bind.cpp

test8push: test8push.cpp platform
	g++ -O2 -o test8push test8push.cpp

test8: test8mat test8bind test8push
	@echo "*** Test 8: Materialization ***"
	./test8mat
	./test8mat
	./test8mat
	@echo
	@echo "*** Test 8: Pull with Passing of Bindings ***"
	./test8bind
	./test8bind
	./test8bind
	@echo
	@echo "*** Test 8: Push ***"
	./test8push
	./test8push
	./test8push


#-----------------------------------------------------------------------------
# Remove all Executables:
#-----------------------------------------------------------------------------

clean:
	rm -f test1mat test1pull test1push test1opt test1pushS test1pushL
	rm -f test1main
	rm -f test1pushN
	rm -f test2mat test2pull test2push test2bind
	rm -f test3mat test3push test3bind test3bindF
	rm -f test4mat test4pull test4push
	rm -f test5mat test5pull test5push test5opt
	rm -f test6mat test6pull test6push
	rm -f test7mat test7pull test7push
	rm -f test8mat test8bind test8push
