Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to dune and fix compilation #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
*.annot
*.cmo
*.cma
*.cmi
*.a
*.o
*.cmx
*.cmxs
*.cmxa

# ocamlbuild working directory
_build/

# ocamlbuild targets
*.byte
*.native

# oasis generated files
setup.data
setup.log
.merlin

/mlgrope
/img/src
16 changes: 16 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version=0.11.0
break-sequences=true
doc-comments=before
field-space=loose
let-and=sparse
sequence-style=terminator
type-decl=sparse
wrap-comments=true
if-then-else=k-r
let-and=sparse
space-around-records
space-around-lists
space-around-arrays
cases-exp-indent=2
max-indent=2
break-cases=all
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
OCAMLC ?= ocamlc
CFLAGS = -thread
CMAS = graphics.cma unix.cma threads.cma
MODULES = util image math2d collide mlgrope backend frontend level player editor menu
CMIS = $(MODULES:=.cmi)
CMOS = $(MODULES:=.cmo) main.cmo
all:
dune build @all
cp _build/default/src/main.exe mlgrope

all: mlgrope
clean:
rm -rf mlgrope *.cmo *.cmi
.PHONY: all clean
dune clean

indent:
ocamlformat -i src/*.ml

%.cmi: %.mli
$(OCAMLC) $(CFLAGS) -c $<
%.cmo: %.ml $(CMIS)
$(OCAMLC) $(CFLAGS) -c $<
mlgrope: $(CMOS)
$(OCAMLC) $(CFLAGS) -o $@ $(CMAS) $^
.PHONY: all clean
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Cut the Rope - MLG version

## Building

Requires Linux and OCaml 4.04+.
Requires Linux, OCaml 4.04+ and dune.

```shell
make
Expand Down
242 changes: 0 additions & 242 deletions backend.ml

This file was deleted.

6 changes: 0 additions & 6 deletions backend.mli

This file was deleted.

Loading