add gitignore and makefile

This commit is contained in:
Mylloon 2022-12-06 20:38:09 +01:00
commit a37aba9177
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 34 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
_build
*.byte
*.cmi

30
Makefile Normal file
View file

@ -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 .