commit a37aba91772fabd39ae334c69f57862b51a3be43 Author: Mylloon Date: Tue Dec 6 20:38:09 2022 +0100 add gitignore and makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f7d72fb --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +_build + +*.byte +*.cmi diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..75620c9 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +MAIN = main +TESTS_DIR = tests +OUTPUT = output + +TESTS = $(wildcard $(TESTS_DIR)/*.test) + +main: + ocamlbuild -use-menhir -no-hygiene $(MAIN).byte + +test: main +test: $(TESTS) + @for f in $(TESTS); do \ + ./$(MAIN).byte $$f 1> /dev/null 2> $(OUTPUT); \ + if [ -s $(OUTPUT) ]; then \ + printf "%s : ❌ => " $$f; \ + cat $(OUTPUT); \ + else \ + printf "%s : 🎉\n" $$f; \ + fi; \ + done; \ + rm $(OUTPUT) + +clean: + rm -r *.cmi $(MAIN).byte _build/ + +archive: + tar czf "IC.tar.gz" *.ml Makefile $(TESTS_DIR) + +symlinks: + ln -s _build/*.cmi .