# name: Makefile ######################################################################## # # Variables # ######################################################################## INFRA := prelude.cmo abstract.cmi tags.cmo coderep.cmi BASE := stateCPSMonad.cmo bubblesort.cmo BASE2 := direct.cmo code.cmo TEST := testsDirect testsCode #bubblesort_direct.out testBubbleSortCommon.cmo VERSION := 0.1 ######################################################################## # # Special Targets # ######################################################################## .PHONY: all all: test $(TEST) .PHONY: test test: $(SYNTAX_EXTENSION) $(OBJ) $(BASE) $(BASE2) $(TEST) ./testsCode -runner sequential -shards 1 #2> /dev/null #to avoid CSP is closure/too deep to serialize warnings ./testsDirect mytop: $(BASE) $(BASE2) testBubbleSortCommon.cmo OCAMLFIND_COMMANDS="ocamlmktop=metaocamlmktop" ocamlfind ocamlmktop -linkpkg -package oUnit -o mytop $(BASE) $(BASE2) testBubbleSortCommon.cmo #Traverse exercise traverse: testsEx #prelude.cmo stateCPSMonad.cmo coderep.cmi code.cmo traverseExercise.cmo ./testsEx .PHONY: clean clean: rm -f $(TEST) *.cm[io] $(OBJ): $(INFRA) $(BASE) ######################################################################## # # Implicit Rules # ######################################################################## .SUFFIXES: .ml .mli .cmo .cmi .ml.cmo: metaocamlc -w Ax -g -c $< .mli.cmi: metaocamlc -c $< %.out: test-%.ml %.cmo mytop ./mytop $(BASE) ./$*.cmo < $< > $@ ######################################################################## # # Explicit Rules # ######################################################################## # bubblesort_direct.out: testBubbleSortDirect.ml $(BASE2) bubblesort.cmo mytop testBubbleSortCommon.cmo # ./mytop < $< > $@ #Unix EAGAIN and EBADF errors - file not found, try again and bad file descriptor - presumably logging issues testsDirect: stateCPSMonad.ml bubblesort.ml testBubbleSortCommon.ml direct.ml testBubbleSortDirect.ml OCAMLFIND_COMMANDS="ocamlc=metaocamlc" ocamlfind ocamlc -w Ax -g -o $@ -package oUnit -linkpkg -g stateCPSMonad.ml bubblesort.ml direct.ml testBubbleSortCommon.ml testBubbleSortDirect.ml testsCode: stateCPSMonad.ml bubblesort.ml testBubbleSortCommon.ml code.ml testBubbleSortCode.ml OCAMLFIND_COMMANDS="ocamlc=metaocamlc" ocamlfind ocamlc -w Ax -g -o $@ -package oUnit -linkpkg -g stateCPSMonad.ml bubblesort.ml code.ml testBubbleSortCommon.ml testBubbleSortCode.ml #Traverse exercise testsEx: coderep.cmi stateCPSMonad.cmo code.cmo traverseExercise.cmo metaocamlc -w Ax -g -o $@ stateCPSMonad.ml code.ml traverseExercise.ml # Dependencies. Needed! Otherwise, old versions of files are compiled. coderep.cmi: abstract.cmi prelude.cmo stateCPSMonad.cmo tags.cmo bubblesort.cmo : stateCPSMonad.cmo prelude.cmo coderep.cmi tags.cmo testBubbleSortDirect.ml : bubblesort.cmo direct.cmo testBubbleSortCommon.cmo testBubbleSortCode.ml : bubblesort.cmo code.cmo testBubbleSortCommon.cmo testBubbleSortCommon.cmo : testBubbleSortCommon.ml stateCPSMonad.cmo OCAMLFIND_COMMANDS="ocamlc=metaocamlc" ocamlfind ocamlc -w Ax -g -c -linkpkg -package oUnit $<