From 52df49337a826f30ef9429af23f25a64f28a2b6b Mon Sep 17 00:00:00 2001 From: "Vesta T. Ballah" <71244383+vballah@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:00:35 -0500 Subject: [PATCH 1/3] Create Makefile Still debugging for some dependencies issues --- Makefile | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f6364cf --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +SOURCES = scanner.mll \ + parser.mly \ + sast.ml \ + ast.ml \ + semant.ml \ + parser.ml \ + scanner.ml \ + test2.ml + + +OCAMLBUILD = ocamlbuild test2.native + +all: + $(OCAMLBUILD) test2.native parser semant + +clean: + $(OCAMLBUILD) -clean + rm -rf *.cmi *.cmo parser.ml parser.mli scanner.ml + + + + From cb6bcbeffd3801a4f0acd0f786e203e6dc3f595d Mon Sep 17 00:00:00 2001 From: "Vesta T. Ballah" <71244383+vballah@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:01:36 -0500 Subject: [PATCH 2/3] Create builk.mk Still cleaning up some dependencies that is not needed. --- builk.mk | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 builk.mk diff --git a/builk.mk b/builk.mk new file mode 100644 index 0000000..1586347 --- /dev/null +++ b/builk.mk @@ -0,0 +1,65 @@ + #For those machine doesn't have ocamlbuild, build the project with this makefile + +OBJ=ast.cmo \ + sast.cmo \ + semant.cmo \ + scanner.cmo \ + parser.cmo \ + test2.cmo \ + printer.cmo + +PythonPlusPlus=pythonpp + +FLAGS:=-g + +$(PythonPlusPlus): $(OBJ) + ocamlc -g -o parser parser.cmo scanner.cmo ast.cmo + ocamlc -g -o semant parser.cmo scanner.cmo ast.cmo sast.cmo + ocamlc -g -o test2 parser.cmo scanner.cmo ast.cmo sast.cmo semant.cmo test2.cmo + +printer: $(OBJ) + ocamlc -o printer.cma -a ast.cmo sast.cmo printer.cmo + +.SUFFIXES: .ml .cmo .cmi .mll .mly .mli +.PRECIOUS: %.ml %.mli %.cmo + +.ml.cmo: + ocamlc -c $(FLAGS) $< + +.mli.cmi: + ocamlc -c $(FLAGS) $< + +.mll.ml: + ocamllex $< + +.mly.ml: + ocamlyacc -v $< + +.mly.mli: + ocamlyacc -v $< + +clean: + rm -f *.cmi *.cmo parser.ml scanner.ml *.output parser.mli parser_test semant test2 *.cma + + +# Generated by ocamldep +ast.cmo: +ast.cmx: +parser.cmo: util.cmo ast.cmo parser.cmi +parser.cmx: util.cmx ast.cmx parser.cmi +parser.cmi: ast.cmo +sast.cmo: util.cmo ast.cmo +sast.cmx: util.cmx ast.cmx +scanner.cmo: parser.cmi +scanner.cmx: parser.cmx +semant.cmo: sast.cmo ast.cmo +semant.cmx: sast.cmx ast.cmx +parser.cmo: scanner.cmo parser.cmi ast.cmo +parser.cmx: scanner.cmx parser.cmx ast.cmx +test2.cmo: scanner.cmo parser.cmi \ + output.cmo interpreter.cmo +test2.cmx: semant.cmx scanner.cmx parser.cmx \ + output.cmx interpreter.cmx + +printer.cmo: ast.cmo sast.cmo +printer.cmx: ast.cmx sast.cmx From 2dd6c6db724aa4c371dd7a5c6807147cc5728be7 Mon Sep 17 00:00:00 2001 From: "Vesta T. Ballah" <71244383+vballah@users.noreply.github.com> Date: Mon, 11 Apr 2022 02:04:58 -0500 Subject: [PATCH 3/3] create build.mk --- builk.mk => build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename builk.mk => build.mk (98%) diff --git a/builk.mk b/build.mk similarity index 98% rename from builk.mk rename to build.mk index 1586347..6b41fb5 100644 --- a/builk.mk +++ b/build.mk @@ -39,7 +39,7 @@ printer: $(OBJ) ocamlyacc -v $< clean: - rm -f *.cmi *.cmo parser.ml scanner.ml *.output parser.mli parser_test semant test2 *.cma + rm -f *.cmi *.cmo parser.ml scanner.ml *.output parser.mli parser_test semant test2 # Generated by ocamldep