From 4778a260b14243ce8ea45089f5ab6909ad57306e Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Sat, 5 Dec 2015 14:33:28 +0000 Subject: [PATCH 1/4] Add separate install targets for native code and byte code. --- Makefile | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8bab311..2c2eec6 100644 --- a/Makefile +++ b/Makefile @@ -7,15 +7,29 @@ SOURCES=higher.mli higher.ml RESULT=higher LIBINSTALL_FILES := higher.mli higher.cmi \ - higher.cma \ + higher.cma + +NATIVE_LIBINSTALL_FILES := \ higher.cmx higher.cmxa higher.a all: byte-code-library native-code-library +meta-install: + $(OCAMLFIND) install higher META + +byte-code-lib-install: byte-code-library + ocamlfind install -add higher $(LIBINSTALL_FILES) + examples-install: ocamlfind install -add higher examples/* -install: libinstall examples-install -uninstall: libuninstall +native-lib-install: native-code-library + ocamlfind install -add higher $(NATIVE_LIBINSTALL_FILES) + +byte-code-install: meta-install byte-code-lib-install examples-install +native-install: byte-code-install native-lib-install +install: native-install +uninstall: + $(OCAMLFIND) remove higher include $(OCAMLMAKEFILE) From d93579285bd36038f7119149edfa7884aac0612e Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Sat, 5 Dec 2015 14:38:56 +0000 Subject: [PATCH 2/4] Distinguish native code and byte code commands in the opam file. --- opam | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/opam b/opam index af8fc66..6261b2a 100644 --- a/opam +++ b/opam @@ -5,8 +5,14 @@ homepage: "https://github.com/ocamllabs/higher" bug-reports: "https://github.com/ocamllabs/higher/issues" dev-repo: "https://github.com/ocamllabs/higher.git" license: "MIT" -build: [[make]] -install: [[make "install"]] +build: [ + [make] {ocaml-native} + [make "bcl"] {!ocaml-native} +] +install: [ + [make "native-install"] {ocaml-native} + [make "byte-code-install"] {!ocaml-native} +] remove: [["ocamlfind" "remove" "higher"]] depends: [ "ocamlfind" ] tags: ["org:ocamllabs"] From 3bde4cec00b393eecb31a23fdcf69402ad632fae Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Mon, 7 Dec 2015 07:42:03 +0000 Subject: [PATCH 3/4] Optionally build and install higher.cmt and higher.cmti --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2c2eec6..d83d207 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,12 @@ SOURCES=higher.mli higher.ml RESULT=higher +OCAMLFLAGS += $(shell ocamlc -bin-annot 2>/dev/null && echo -bin-annot) + LIBINSTALL_FILES := higher.mli higher.cmi \ higher.cma +LIBINSTALL_OPTIONAL_FILES := higher.cmt higher.cmti NATIVE_LIBINSTALL_FILES := \ higher.cmx higher.cmxa higher.a @@ -18,7 +21,8 @@ meta-install: $(OCAMLFIND) install higher META byte-code-lib-install: byte-code-library - ocamlfind install -add higher $(LIBINSTALL_FILES) + ocamlfind install -add higher $(LIBINSTALL_FILES) \ + -optional $(LIBINSTALL_OPTIONAL_FILES) examples-install: ocamlfind install -add higher examples/* From c77617d9aade8a3b8bea7e4e6be7066cc5c18123 Mon Sep 17 00:00:00 2001 From: Jeremy Yallop Date: Mon, 7 Dec 2015 07:42:32 +0000 Subject: [PATCH 4/4] Whitespace. --- Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d83d207..f945046 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,9 @@ RESULT=higher OCAMLFLAGS += $(shell ocamlc -bin-annot 2>/dev/null && echo -bin-annot) -LIBINSTALL_FILES := higher.mli higher.cmi \ - higher.cma - +LIBINSTALL_FILES := higher.mli higher.cmi higher.cma LIBINSTALL_OPTIONAL_FILES := higher.cmt higher.cmti -NATIVE_LIBINSTALL_FILES := \ - higher.cmx higher.cmxa higher.a +NATIVE_LIBINSTALL_FILES := higher.cmx higher.cmxa higher.a all: byte-code-library native-code-library