[Pkg-ocaml-maint-commits] [biniou] 02/11: Imported Upstream version 1.0.10

Stéphane Glondu glondu at moszumanska.debian.org
Wed Aug 3 11:31:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

glondu pushed a commit to branch master
in repository biniou.

commit 9d70b84006698a2026782917396b428a767589b9
Author: Stephane Glondu <steph at glondu.net>
Date:   Wed Aug 3 13:20:46 2016 +0200

    Imported Upstream version 1.0.10
---
 .gitignore | 11 +++++++++
 Makefile   | 77 +++++++++++++++++++++++++++++++++++++++-----------------------
 README.md  |  7 ++++--
 3 files changed, 64 insertions(+), 31 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2ff1963
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+*~
+*.cm[ioxat]
+*.[oa]
+*.cmx[as]
+*.cmti
+*.annot
+META
+bdump
+test-stream.dat
+test2.bin
+test_biniou
diff --git a/Makefile b/Makefile
index 824ed3b..93681b9 100644
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,36 @@
-VERSION = 1.0.9
+VERSION = 1.0.10
 
-FLAGS = -dtypes -g
+FLAGS = -g -annot -bin-annot
 PACKS = easy-format
 
-ifeq "$(shell ocamlc -config |grep os_type)" "os_type: Win32"
+ifeq "$(shell ocamlfind ocamlc -config |grep os_type)" "os_type: Win32"
 EXE=.exe
 else
 EXE=
 endif
 
-NATDYNLINK := $(shell if [ -f `ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi)
+BEST != if ocamlfind ocamlopt 2>/dev/null; then echo .native; else echo .byte; fi
+NATDYNLINK != if [ -f `ocamlfind ocamlc -where`/dynlink.cmxa ]; then echo YES; else echo NO; fi
 
 ifeq "${NATDYNLINK}" "YES"
 CMXS=biniou.cmxs
 endif
 
-.PHONY: default all opt install doc test
-default: all opt test_biniou$(EXE) META
-all: biniou.cma
-opt: biniou.cmxa $(CMXS) bdump$(EXE)
+.PHONY: default all byte opt install doc test
+default: all test_biniou$(EXE)
+ifeq "$(BEST)" ".native"
+all: byte opt doc META
+else
+all: byte doc META
+endif
+byte: biniou.cma bdump.byte
+opt: biniou.cmxa $(CMXS) bdump.native
 
 test: test_biniou$(EXE)
-	./test_biniou
+	./$<
 
 ifndef PREFIX
-  PREFIX = $(shell dirname $$(dirname $$(which ocamlfind)))
+  PREFIX != dirname $$(dirname $$(which ocamlfind))
   export PREFIX
 endif
 
@@ -44,7 +50,9 @@ SOURCES = bi_util.mli bi_util.ml \
 
 MLI = $(filter %.mli, $(SOURCES))
 ML = $(filter %.ml, $(SOURCES))
-CMI = $(ML:.ml=.cmi)
+CMI = $(MLI:.mli=.cmi)
+CMT = $(MLI:.mli=.cmt)
+ANNOT = $(MLI:.mli=.annot)
 CMO = $(ML:.ml=.cmo)
 CMX = $(ML:.ml=.cmx)
 O = $(ML:.ml=.o)
@@ -58,40 +66,51 @@ biniou.cmxa: $(SOURCES) Makefile
 		-o biniou.cmxa -package "$(PACKS)" $(SOURCES)
 
 biniou.cmxs: biniou.cmxa
-	ocamlopt -shared -linkall -I . -o biniou.cmxs biniou.cmxa
+	ocamlfind ocamlopt -shared -linkall -I . -o $@ $^
+
+bdump.byte: biniou.cma bdump.ml
+	ocamlfind ocamlc -o $@ $(FLAGS) \
+		-package $(PACKS) -linkpkg $^
 
-bdump$(EXE): $(SOURCES) bdump.ml
-	ocamlfind ocamlopt -o bdump$(EXE) $(FLAGS) \
-		-package $(PACKS) -linkpkg \
-		biniou.cmxa bdump.ml
+bdump.native: biniou.cmxa bdump.ml
+	ocamlfind ocamlopt -o $@ $(FLAGS) \
+		-package $(PACKS) -linkpkg $^
 
-test_biniou$(EXE): biniou.cmxa test_biniou.ml
-	ocamlfind ocamlopt -o test_biniou$(EXE) $(FLAGS) \
-		-package "$(PACKS) unix" -linkpkg \
-		biniou.cmxa test_biniou.ml
+test_biniou.byte: biniou.cma test_biniou.ml
+	ocamlfind ocamlc -o $@ $(FLAGS) \
+		-package "$(PACKS) unix" -linkpkg $^
+
+test_biniou.native: biniou.cmxa test_biniou.ml
+	ocamlfind ocamlopt -o $@ $(FLAGS) \
+		-package "$(PACKS) unix" -linkpkg $^
+
+%$(EXE): %$(BEST)
+	cp $< $@
 
 doc: doc/index.html
 doc/index.html: $(MLI)
 	mkdir -p doc
 	ocamlfind ocamldoc -d doc -html -package easy-format $(MLI)
 
-install: META
-	test ! -f bdump || cp bdump $(BINDIR)/
-	test ! -f bdump.exe || cp bdump.exe $(BINDIR)/
+install: META byte
+	if [ -f bdump.native ]; then \
+		cp bdump.native $(BINDIR)/bdump$(EXE); \
+	else \
+		cp bdump.byte $(BINDIR)/bdump$(EXE); \
+	fi
 	ocamlfind install biniou META \
-          $$(ls $(MLI) $(CMI) $(CMO) $(CMX) $(O) \
-             biniou.cma biniou.cmxa biniou.cmxs biniou.a)
+	  $(MLI) $(CMI) $(CMT) $(ANNOT) $(CMO) biniou.cma \
+	  -optional $(CMX) $(O) biniou.cmxa biniou.a biniou.cmxs
 
 uninstall:
-	test ! -f $(BINDIR)/bdump || rm $(BINDIR)/bdump
-	test ! -f $(BINDIR)/bdump.exe || rm $(BINDIR)/bdump.exe
+	rm -f $(BINDIR)/bdump{.exe,}
 	ocamlfind remove biniou
 
 .PHONY: clean
 
 clean:
-	rm -f *.o *.a *.cm[ioxa] *.cmxa *~ *.annot
-	rm -f bdump bdump.exe test_biniou test_biniou.exe META
+	rm -f *.o *.a *.cm[ioxa] *.cmxa *~ *.annot META
+	rm -f {bdump,test_biniou}{.exe,.byte,.native,}
 	rm -rf doc
 	rm -f test.bin test_channels.bin
 
diff --git a/README.md b/README.md
index 3c6f879..193adc8 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,9 @@ of type definitions except for field and variant names which are
 represented by 31-bit hashes. A program named `bdump` is provided for
 routine visualization of biniou data files.
 
-The program [atdgen](https://github.com/MyLifeLabs/atdgen)
-can be used to derive OCaml-Biniou serializers and
+The program [atdgen](https://mjambon.github.io/atdgen-doc/)
+is used to derive OCaml-Biniou serializers and
 deserializers from type definitions.
+
+Biniou format specification:
+https://mjambon.github.io/atdgen-doc/biniou-format.txt

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/biniou.git



More information about the Pkg-ocaml-maint-commits mailing list