This repository has been archived by the owner on May 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (57 loc) · 1.98 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
ML_FILES=$(shell find . -type f -name "*.ml" -not -path "./_build/*")
MLI_FILES=$(shell find . -type f -name "*.mli" -not -path "./_build/*")
MLD_FILES=$(shell find . -type f -name "*.mld" -not -path "./_build/*")
MD_FILES=$(shell find . -type f -name "*.md" -not -path "./_build/*")
WAV_FILES=$(shell find . -type f -name "*.wav" -not -path "./_build/*")
DUNE_FILES=$(shell find . -type f -name "dune" -not -path "./_build/*")
ZIPFILES= $(ML_FILES) $(MLI_FILES) $(MLD_FILES) $(MD_FILES) $(WAV_FILES) $(DUNE_FILES) dune-project battleship.opam Makefile .ocamlinit
EXEC=./_build/default/bin/main.exe
RED=\033[0;31m
GREEN=\033[0;32m
BLUE=\033[0;34m
YELLOW=\033[1;33m
BOLD=\033[1m
CLEAR=\033[0m
HOURS_WORKED=echo "$$(cat author.ml) in (print_int hours_worked)" | ocaml -stdin
default: play
build:
dune build
play: build
$(EXEC) -l
serve: build
$(EXEC)
test:
OUNIT_CI=true dune runtest
serve-docs:
cd ./_build/default/_doc/_html && \
python -m SimpleHTTPServer 5000
docs:
dune build @doc
docs-serve: docs serve-docs
docs-private:
dune build @doc-private
docs-private-serve: docs-private serve-docs
clean:
rm main.byte battleship.zip .merlin || true
rm -rf coverage _coverage || true
dune clean
zip: clean
rm battleship.zip || true
@zip battleship.zip $(ZIPFILES)
@echo "\nThe MD5 hash for submission to CMSX is $(BOLD)$(BLUE)$$(md5 -q battleship.zip)$(CLEAR)."
cloc:
@cloc $(ZIPFILES) .github/*
count: clean cloc
bisect:
find . -name '*.coverage' | xargs rm -f
dune runtest --instrument-with bisect_ppx --force
bisect-ppx-report html
bisect-ppx-report summary
utop:
dune utop
check: build
@echo "\n$(GREEN)✓$(CLEAR) Your code passed $(BOLD)make build$(CLEAR), therefore, everything is working"
finalcheck: build zip check
@echo "$(GREEN)✓$(CLEAR) Your code passed $(BOLD)make zip$(CLEAR) and is ready for submission."
@dune exec bin/author.exe
@echo "$(YELLOW)!$(CLEAR) Friendly reminder to tag your changes before submitted: $(BOLD)git tag -v <MS> -m <short description>$(CLEAR)"