| 1 |
# |
| 2 |
# Pure OCaml, no packages, no _tags, code in several directories |
| 3 |
# Targets starting with "doc_" generate documentation for the Util and Hello |
| 4 |
# modules |
| 5 |
# |
| 6 |
|
| 7 |
# bin-annot is required for Merlin and other IDE-like tools |
| 8 |
# The -I flag introduces sub-directories to search for code |
| 9 |
|
| 10 |
.PHONY: all clean byte native profile debug test |
| 11 |
|
| 12 |
OCB_FLAGS = -tag bin_annot -I src -I lib |
| 13 |
OCB = ocamlbuild $(OCB_FLAGS) |
| 14 |
|
| 15 |
all: native byte # profile debug |
| 16 |
|
| 17 |
clean: |
| 18 |
$(OCB) -clean |
| 19 |
|
| 20 |
native: |
| 21 |
$(OCB) main.native |
| 22 |
|
| 23 |
byte: |
| 24 |
$(OCB) main.byte |
| 25 |
|
| 26 |
profile: |
| 27 |
$(OCB) -tag profile main.native |
| 28 |
|
| 29 |
debug: |
| 30 |
$(OCB) -tag debug main.byte |
| 31 |
|
| 32 |
doc_html: |
| 33 |
$(OCB) doc/api.docdir/index.html |
| 34 |
|
| 35 |
doc_man: |
| 36 |
$(OCB) doc/api.docdir/man |
| 37 |
|
| 38 |
# the name of the .tex file can be anything |
| 39 |
doc_tex: |
| 40 |
$(OCB) doc/api.docdir/api.tex |
| 41 |
|
| 42 |
# the name of the .texi file can be anything |
| 43 |
doc_texinfo: |
| 44 |
$(OCB) doc/api.docdir/api.texi |
| 45 |
|
| 46 |
# the .dot graph represents inter-module dependencies |
| 47 |
# as before, the name doesn't matter |
| 48 |
doc_dot: |
| 49 |
$(OCB) doc/api.docdir/api.dot |
| 50 |
|
| 51 |
test: native |
| 52 |
./main.native "OCaml" "OCamlBuild" "users" |