diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..35b401f --- /dev/null +++ b/Makefile @@ -0,0 +1,17 @@ +SRC_FOLDER=src/ +TEST_FOLDER=tests/ + +all: compile + +compile: + $(MAKE) -C $(SRC_FOLDER) + + +.PHONY: clean tests + +tests: compile + ./$(SRC_FOLDER)comp ./$(TEST_FOLDER)rectangles.c ./$(TEST_FOLDER)out/rectangles.ps + ./$(SRC_FOLDER)comp ./$(TEST_FOLDER)progsimple.c ./$(TEST_FOLDER)out/progsimple.ps + +clean: + $(MAKE) $@ -C $(SRC_FOLDER) \ No newline at end of file diff --git a/README.md b/README.md index 3d5f79e..0fa543c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@

Welcome to Postscript Compiler 👋

Version - - License: MIT -

> Compilateur du langage Postscript en Ocaml diff --git a/src/Makefile b/src/Makefile index 43621e7..2b1d67e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ # Compile -all: comp +all: comp #lib # Compilation of Ocaml files # Attention: order of object files important @@ -29,11 +29,9 @@ comp.cmo: comp.ml gen.cmo typing.cmo parser.cmo interf.cmo # ocaml lexer and parser -# Comment in for your own lexer lexer.ml: lexer.mll lang.cmo ocamllex $< -# Comment in for your own parser parser.ml parser.mli: parser.mly lang.cmo ocamlyacc $< @@ -55,10 +53,6 @@ parser.cmo: parser.ml parser.cmi lang.cmo # lib: # cp ../lib/* ./ -## Remove compiled modules and lib +## Remove compiled modules clean: - rm -f lexer.ml parser.ml *.mli *.cmi *.cmo - -## Run tests -tests: - ./comp ./../tests/rectangles.c ./../tests/out/rectangles.ps \ No newline at end of file + rm -f lexer.ml parser.ml *.mli *.cmi *.cmo \ No newline at end of file