aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2016-11-15 13:00:01 +0100
committerSébastien Dailly <sebastien@chimrod.com>2016-11-15 13:00:01 +0100
commitef312564ca84a2b49fc291434d8fb2f8501bb618 (patch)
tree79415fcf225e6da1042c8edaae5e4a74c7a983cb /Makefile
Initial commit
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile44
1 files changed, 44 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100755
index 0000000..a792dd6
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+OCAMLBUILD ?= ocamlbuild
+PACKAGES=num,curses,camlzip,ezxmlm,text,calendar,menhirLib
+PATHS=.,odf
+
+MENHIR=-use-menhir
+
+LIB = licht
+LIB_STUB = $(LIB)_stub
+
+STUB_OPTIONS=-lflags -ccopt,-L.,-cclib,-l$(LIB_STUB)
+BYTE_STUB_OPTIONS=$(STUB_OPTIONS)#,-dllib,-l$(LIB_STUB)
+
+.PHONY: stub
+
+all: native
+
+stub:
+ $(MAKE) -C stub LIB=$(LIB)
+
+deps:
+ opam install ocamlbuild curses camlzip ezxmlm ounit text menhir calendar
+
+byte: stub
+ $(OCAMLBUILD) -pkgs $(PACKAGES) $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS) main.byte
+
+native: stub
+ $(OCAMLBUILD) -pkgs $(PACKAGES) $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS) main.native
+
+doc:
+ $(OCAMLBUILD) -pkgs $(PACKAGES) -menhir -Is $(PATHS) licht.docdir/index.html
+
+test: stub
+ $(OCAMLBUILD) -pkgs $(PACKAGES),oUnit -cflag -g -lflag -g $(STUB_OPTIONS) $(MENHIR) -Is $(PATHS),tests test.byte --
+
+relink: stub
+ rm -f _build/main.native
+ rm -f _build/main.byte
+ rm -f _build/tests.byte
+ make
+
+clean:
+ make -C stub clean
+ $(OCAMLBUILD) -clean
+