| 1 |
# |
| 2 |
# Pure OCaml, package from Opam, two directories |
| 3 |
# |
| 4 |
|
| 5 |
# - The -I flag introduces sub-directories |
| 6 |
# - -use-ocamlfind is required to find packages (from Opam) |
| 7 |
# - _tags file introduces packages, bin_annot |
| 8 |
|
| 9 |
.PHONY: all clean byte native profile debug lib sanity test |
| 10 |
|
| 11 |
OCB_FLAGS = -use-ocamlfind -I src -I libdemo |
| 12 |
OCB = ocamlbuild $(OCB_FLAGS) |
| 13 |
|
| 14 |
all: native byte lib # profile debug |
| 15 |
|
| 16 |
clean: |
| 17 |
$(OCB) -clean |
| 18 |
|
| 19 |
lib: |
| 20 |
$(OCB) libdemo.cma |
| 21 |
$(OCB) libdemo.cmxa |
| 22 |
$(OCB) libdemo.cmxs |
| 23 |
|
| 24 |
native: sanity |
| 25 |
$(OCB) main.native |
| 26 |
|
| 27 |
byte: sanity |
| 28 |
$(OCB) main.byte |
| 29 |
|
| 30 |
profile: sanity |
| 31 |
$(OCB) -tag profile main.native |
| 32 |
|
| 33 |
debug: sanity |
| 34 |
$(OCB) -tag debug main.byte |
| 35 |
|
| 36 |
sanity: |
| 37 |
ocamlfind query yojson |
| 38 |
|
| 39 |
test: native |
| 40 |
echo '{"hello": "json"}' | ./main.native |