Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #7 from lukyanov/rebar-compatible-structure

Rebar compatible structure
  • Loading branch information...
commit 4bf160f94be1b081f1feb1284522a44eee11f7fd 2 parents 6707f92 + 6c261bc
@vlm vlm authored
View
8 .gitignore
@@ -1,4 +1,6 @@
-*.o
-*.a
-*.cm*
+ocaml-erlang-port/*.o
+ocaml-erlang-port/*.a
+ocaml-erlang-port/*.cm*
erlterm_check
+ebin
+deps
View
59 Makefile
@@ -1,54 +1,29 @@
-# If nothing works, try `ocamlmklib -o $(PACKAGE) *.ml`
-
-PACKAGE=ocaml-erlang-port
-LIBSRCS=ErlangTerm.ml ErlangPort.ml
-LIBCMIS=${LIBSRCS:.ml=.cmi}
-LIBCMOS=${LIBSRCS:.ml=.cmo}
-LIBCMXS=${LIBSRCS:.ml=.cmx}
-
-LIBS=$(PACKAGE).cma $(PACKAGE).cmxa $(PACKAGE).a lib$(PACKAGE).a
-
-all: $(LIBCMIS) $(LIBS)
+all:
+ $(REBAR) compile
install:
- @echo "Use install-package if you want to do a system-wide install"
+ cd ocaml-erlang-port; $(MAKE) install
-install-package: uninstall $(LIBCMIS) $(LIBS)
- ocamlfind install $(PACKAGE) $(LIBS) $(LIBCMIS) META
+install-package:
+ cd ocaml-erlang-port; $(MAKE) install-package
uninstall:
- ocamlfind remove $(PACKAGE)
-
-$(PACKAGE).cma: $(LIBCMIS) $(LIBCMOS)
- ocamlmklib -o $(PACKAGE) $(LIBCMOS)
-
-$(PACKAGE).cmxa: $(LIBCMIS) $(LIBCMXS)
- ocamlmklib -o $(PACKAGE) $(LIBCMXS)
-
-lib$(PACKAGE).a: $(LIBCMIS) $(LIBCMXS)
- ocamlmklib -o lib$(PACKAGE) $(LIBCMXS)
+ cd ocaml-erlang-port; $(MAKE) uninstall
-check: erlterm_check
- @echo "Running embedded self-check"
- ./erlterm_check
- @echo "Running external tests"
- ./erlterm_check ./erlterm_tests/*.et
- @echo "make check: OK"
+ocaml-check:
+ cd ocaml-erlang-port; $(MAKE) check
-erlterm_check: $(LIBCMXS) ErlangTerm_Check.cmx
- ocamlfind ocamlopt -package num -linkpkg -o erlterm_check $(LIBCMXS) ErlangTerm_Check.cmx
+ocaml:
+ cd ocaml-erlang-port; $(MAKE)
-.SUFFIXES: .ml .mli .cmx .cmo .cmi
+ocaml-clean:
+ cd ocaml-erlang-port; $(MAKE) clean
-.ml.cmx:
- ocamlfind ocamlopt -o $@ -c $<
+check: ocaml-check
-.ml.cmo:
- ocamlfind ocamlc -o $@ -c $<
+clean: ocaml-clean
+ $(REBAR) clean
-.mli.cmi:
- ocamlfind ocamlc -o $@ $<
+.PHONY: ocaml ocaml-clean ocaml-check
-clean:
- rm -f *.cm* *.[ao]
- rm -f erlterm_check
+REBAR ?= $(shell which ./rebar)
View
0  ErlangPort.ml → ocaml-erlang-port/ErlangPort.ml
File renamed without changes
View
0  ErlangPort.mli → ocaml-erlang-port/ErlangPort.mli
File renamed without changes
View
0  ErlangTerm.ml → ocaml-erlang-port/ErlangTerm.ml
File renamed without changes
View
0  ErlangTerm.mli → ocaml-erlang-port/ErlangTerm.mli
File renamed without changes
View
0  ErlangTerm_Check.ml → ocaml-erlang-port/ErlangTerm_Check.ml
File renamed without changes
View
0  META → ocaml-erlang-port/META
File renamed without changes
View
54 ocaml-erlang-port/Makefile
@@ -0,0 +1,54 @@
+# If nothing works, try `ocamlmklib -o $(PACKAGE) *.ml`
+
+PACKAGE=ocaml-erlang-port
+LIBSRCS=ErlangTerm.ml ErlangPort.ml
+LIBCMIS=${LIBSRCS:.ml=.cmi}
+LIBCMOS=${LIBSRCS:.ml=.cmo}
+LIBCMXS=${LIBSRCS:.ml=.cmx}
+
+LIBS=$(PACKAGE).cma $(PACKAGE).cmxa $(PACKAGE).a lib$(PACKAGE).a
+
+all: $(LIBCMIS) $(LIBS)
+
+install:
+ @echo "Use install-package if you want to do a system-wide install"
+
+install-package: uninstall $(LIBCMIS) $(LIBS)
+ ocamlfind install $(PACKAGE) $(LIBS) $(LIBCMIS) META
+
+uninstall:
+ ocamlfind remove $(PACKAGE)
+
+$(PACKAGE).cma: $(LIBCMIS) $(LIBCMOS)
+ ocamlmklib -o $(PACKAGE) $(LIBCMOS)
+
+$(PACKAGE).cmxa: $(LIBCMIS) $(LIBCMXS)
+ ocamlmklib -o $(PACKAGE) $(LIBCMXS)
+
+lib$(PACKAGE).a: $(LIBCMIS) $(LIBCMXS)
+ ocamlmklib -o lib$(PACKAGE) $(LIBCMXS)
+
+check: erlterm_check
+ @echo "Running embedded self-check"
+ ./erlterm_check
+ @echo "Running external tests"
+ ./erlterm_check ../erlterm_tests/*.et
+ @echo "make check: OK"
+
+erlterm_check: $(LIBCMXS) ErlangTerm_Check.cmx
+ ocamlfind ocamlopt -package num -linkpkg -o erlterm_check $(LIBCMXS) ErlangTerm_Check.cmx
+
+.SUFFIXES: .ml .mli .cmx .cmo .cmi
+
+.ml.cmx:
+ ocamlfind ocamlopt -o $@ -c $<
+
+.ml.cmo:
+ ocamlfind ocamlc -o $@ -c $<
+
+.mli.cmi:
+ ocamlfind ocamlc -o $@ $<
+
+clean:
+ rm -f *.cm* *.[ao]
+ rm -f erlterm_check
View
BIN  rebar
Binary file not shown
View
9 rebar.config
@@ -0,0 +1,9 @@
+{erl_opts,[debug_info, warnings_as_errors]}.
+
+{deps, [
+ {mavg, ".*", {git, "https://github.com/EchoTeam/mavg", {branch, "master"}}}
+]}.
+
+{pre_hooks, [{compile, "make ocaml"}]}.
+{post_hooks, [{clean, "make ocaml-clean"}]}.
+
View
8 src/ocaml_erlang_port.app.src
@@ -0,0 +1,8 @@
+{application, ocaml_erlang_port,
+ [
+ {description, ""},
+ {vsn, "1"},
+ {registered, []},
+ {applications, []},
+ {env, []}
+ ]}.
View
0  portserver.erl → src/portserver.erl
File renamed without changes
Please sign in to comment.
Something went wrong with that request. Please try again.