Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from rgrinberg/jbuilder
Port to jbuilder
- Loading branch information
Showing
13 changed files
with
52 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,3 @@ | ||
*~ | ||
*.cmi | ||
*.cmo | ||
*.cmx | ||
*.cma | ||
*.cmxa | ||
*.cmxs | ||
*.a | ||
*.o | ||
*.annot | ||
*.run | ||
*.opt | ||
*.exe | ||
META | ||
bytecode | ||
nativecode | ||
*.out | ||
lambda_example | ||
simple_example | ||
test_easy_format | ||
easy_format_example.html | ||
easy_format_example.ml | ||
ocamldoc | ||
_build | ||
.merlin | ||
*.install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,12 @@ | ||
VERSION = 1.2.0 | ||
export VERSION | ||
|
||
NATDYNLINK := $(shell if [ -f `ocamlfind ocamlc -where`/dynlink.cmxa ]; \ | ||
then echo YES; else echo NO; fi) | ||
|
||
ifeq "${NATDYNLINK}" "YES" | ||
CMXS=easy_format.cmxs | ||
endif | ||
|
||
.PHONY: default all opt test doc soft-clean clean | ||
default: all opt | ||
all: | ||
ocamlfind ocamlc -c easy_format.mli | ||
ocamlfind ocamlc -c -dtypes easy_format.ml | ||
touch bytecode | ||
|
||
opt: easy_format.cmx $(CMXS) | ||
touch nativecode | ||
|
||
easy_format.cmx: | ||
ocamlfind ocamlc -c easy_format.mli | ||
ocamlfind ocamlopt -c -dtypes easy_format.ml | ||
|
||
easy_format.cmxs: easy_format.cmx | ||
ocamlfind ocamlopt -I . -shared -linkall \ | ||
-o easy_format.cmxs easy_format.cmx | ||
|
||
test: all simple_example.out | ||
ocamlfind ocamlc -o test_easy_format -dtypes \ | ||
easy_format.cmo test_easy_format.ml | ||
./test_easy_format > test_easy_format.out | ||
ocamlfind ocamlc -o lambda_example -dtypes \ | ||
easy_format.cmo lambda_example.ml | ||
./lambda_example > lambda_example.out | ||
|
||
simple_example: all simple_example.ml | ||
ocamlfind ocamlc -o simple_example -dtypes \ | ||
easy_format.cmo simple_example.ml | ||
simple_example.out: simple_example | ||
./simple_example > simple_example.out | ||
|
||
doc: ocamldoc/index.html easy_format_example.html | ||
ocamldoc/index.html: easy_format.mli | ||
mkdir -p ocamldoc | ||
ocamlfind ocamldoc -d ocamldoc -html $< | ||
easy_format_example.html: simple_example.out simple_example.ml | ||
cat simple_example.ml > easy_format_example.ml | ||
echo '(* Output: ' >> easy_format_example.ml | ||
cat simple_example.out >> easy_format_example.ml | ||
echo '*)' >> easy_format_example.ml | ||
ocamlfind ocamlc -c -dtypes easy_format_example.ml | ||
caml2html easy_format_example.ml -t -o easy_format_example.html | ||
|
||
soft-clean: | ||
rm -f *.cm[iox] *.cmxs *.o *.annot \ | ||
test_easy_format lambda_example simple_example \ | ||
bytecode nativecode | ||
|
||
clean: soft-clean | ||
rm -f *.out ocamldoc/* \ | ||
easy_format_example.* | ||
cd examples; $(MAKE) clean | ||
@jbuilder build @install @DEFAULT | ||
|
||
test: | ||
@jbuilder runtest | ||
|
||
COMMON_INSTALL_FILES = META easy_format.cmi easy_format.mli | ||
BC_INSTALL_FILES = easy_format.cmo | ||
NC_INSTALL_FILES = easy_format.cmx easy_format.o $(CMXS) | ||
check: test | ||
|
||
install: | ||
echo "version = \"$(VERSION)\"" > META; cat META.tpl >> META | ||
INSTALL_FILES="$(COMMON_INSTALL_FILES)"; \ | ||
if test -f bytecode; then \ | ||
INSTALL_FILES="$$INSTALL_FILES $(BC_INSTALL_FILES)"; \ | ||
fi; \ | ||
if test -f nativecode; then \ | ||
INSTALL_FILES="$$INSTALL_FILES $(NC_INSTALL_FILES)"; \ | ||
fi; \ | ||
ocamlfind install easy-format $$INSTALL_FILES | ||
.PHONY: clean all test check | ||
|
||
uninstall: | ||
ocamlfind remove easy-format | ||
clean: | ||
jbuilder clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
opam-version: "1.2" | ||
maintainer: "martin@mjambon.com" | ||
authors: ["Martin Jambon"] | ||
homepage: "http://mjambon.com/easy-format.html" | ||
bug-reports: "https://github.com/mjambon/easy-format/issues" | ||
dev-repo: "https://github.com/mjambon/easy-format.git" | ||
build: [ | ||
["jbuilder" "build" "-p" name "-j" jobs] | ||
] | ||
|
||
build-test: [ | ||
["jbuilder" "runtest" "-p" name] | ||
] | ||
depends: ["jbuilder" {build}] | ||
available: [ ocaml-version >= "4.02.3"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
(jbuild_version 1) | ||
|
||
;; we don't include jsonpp here b/c it requires json-wheel | ||
(executables | ||
((names (simple_example lambda_example)) | ||
(modules (:standard \ jsonpp)) | ||
(libraries (easy-format)))) | ||
|
||
(alias | ||
((name DEFAULT) | ||
(deps (simple_example.exe lambda_example.exe)))) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(jbuild_version 1) | ||
|
||
(library | ||
((name easy_format) | ||
(public_name easy-format) | ||
(synopsis "Indentation made easy(ier)"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(jbuild_version 1) | ||
|
||
(executable | ||
((name test_easy_format) | ||
(libraries (easy-format)))) | ||
|
||
(alias | ||
((name runtest) | ||
(deps (test_easy_format.exe)) | ||
(action (run ${<})))) |
File renamed without changes.