add gitignore and makefile
This commit is contained in:
commit
a37aba9177
2 changed files with 34 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
_build
|
||||
|
||||
*.byte
|
||||
*.cmi
|
30
Makefile
Normal file
30
Makefile
Normal 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 .
|
Reference in a new issue