From a37aba91772fabd39ae334c69f57862b51a3be43 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 6 Dec 2022 20:38:09 +0100 Subject: [PATCH] add gitignore and makefile --- .gitignore | 4 ++++ Makefile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .gitignore create mode 100644 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 .