|
1 | | -COMPILE_ARG=-g -bin-annot -annot -keep-locs -w +a-37 -warn-error +a |
2 | | -COMPILE_OPT_ARG=$(COMPILE_ARG) |
| 1 | +INSTALL_ARGS := $(if $(PREFIX),--prefix $(PREFIX),) |
3 | 2 |
|
4 | | -all: natdynlink |
| 3 | +# Default rule |
| 4 | +default: |
| 5 | + jbuilder build @install |
5 | 6 |
|
6 | | -byte: lib/nullable_array.cma |
7 | | -native: lib/nullable_array.cmxa byte |
8 | | -natdynlink: lib/nullable_array.cmxs native |
| 7 | +test: |
| 8 | + jbuilder runtest |
9 | 9 |
|
10 | | -lib/nullable_array.cmi: lib/nullable_array.mli |
11 | | - ocamlc $(COMPILE_ARG) -c $< -o $@ |
12 | | - |
13 | | -lib/nullable_array.cmo: lib/nullable_array.ml lib/nullable_array.cmi |
14 | | - ocamlc $(COMPILE_ARG) -I lib -c $< -o $@ |
15 | | - |
16 | | -lib/nullable_array.cmx: lib/nullable_array.ml lib/nullable_array.cmi |
17 | | - ocamlopt $(COMPILE_OPT_ARG) -I lib -c $< -o $@ |
18 | | - |
19 | | -lib/nullable_array.cmxa: lib/nullable_array.cmx |
20 | | - ocamlopt $(COMPILE_OPT_ARG) -I lib -a $? -o $@ |
21 | | - |
22 | | -lib/nullable_array.cmxs: lib/nullable_array.cmx |
23 | | - ocamlopt $(COMPILE_OPT_ARG) -I lib -shared $? -o $@ |
24 | | - |
25 | | -lib/nullable_array.cma: lib/nullable_array.cmo |
26 | | - ocamlc $(COMPILE_ARG) -I lib -a $? -o $@ |
27 | | - |
28 | | -clean:: |
29 | | - rm -f lib/*.a lib/*.o lib/*.cma lib/*.cmo lib/*.cmx lib/*.cmi \ |
30 | | - lib/*.cmxa lib/*.cmxs lib/*.cmt lib/*.cmti lib/*.annot |
31 | | - |
32 | | -TEST_COMPILE_ARG=-g -I lib -I test -w +a |
33 | | - |
34 | | -test: test_native |
35 | | - |
36 | | -test_byte: test/basic.byte test/basic_float.byte |
37 | | -test_native: test_byte test/basic.opt test/basic_float.opt |
38 | | - |
39 | | -test/basic.byte: test/basic.mli test/basic.ml byte |
40 | | - ocamlc $(TEST_COMPILE_ARG) lib/nullable_array.cma test/basic.mli test/basic.ml -o $@ |
41 | | - $@ |
42 | | - |
43 | | -test/basic.opt: test/basic.mli test/basic.ml native |
44 | | - ocamlopt $(TEST_COMPILE_ARG) lib/nullable_array.cmxa test/basic.mli test/basic.ml -o $@ |
45 | | - $@ |
46 | | - |
47 | | -test/basic_float.byte: test/basic_float.mli test/basic_float.ml byte |
48 | | - ocamlc $(TEST_COMPILE_ARG) lib/nullable_array.cma test/basic_float.mli test/basic_float.ml -o $@ |
49 | | - $@ |
50 | | - |
51 | | -test/basic_float.opt: test/basic_float.mli test/basic_float.ml native |
52 | | - ocamlopt $(TEST_COMPILE_ARG) lib/nullable_array.cmxa test/basic_float.mli test/basic_float.ml -o $@ |
53 | | - $@ |
54 | | - |
55 | | -html: |
56 | | - mkdir -p html |
57 | | - |
58 | | -html_doc: lib/nullable_array.mli | html |
59 | | - ocamldoc -html -d html/ $? |
60 | | - |
61 | | -man: |
62 | | - mkdir -p man |
63 | | - |
64 | | -man_doc: lib/nullable_array.mli | man |
65 | | - ocamldoc -man -man-mini -d man/ $? |
66 | | - |
67 | | -doc: man_doc html_doc |
68 | | - |
69 | | -clean:: |
70 | | - rm -f test/*.a test/*.o test/*.cma test/*.cmo test/*.cmx test/*.cmi \ |
71 | | - test/*.cmxa test/*.cmxs test/*.cmt test/*.cmti test/*.annot \ |
72 | | - html/* man/* test/*.byte test/*.opt |
73 | | - rmdir -p html man |
| 10 | +dev: |
| 11 | + jbuilder build --dev @install |
74 | 12 |
|
75 | 13 | install: |
76 | | - ocamlfind install nullable_array META \ |
77 | | - lib/*.a lib/*.o lib/*.cma lib/*.cmo lib/*.cmx lib/*.cmi \ |
78 | | - lib/*.cmxa lib/*.cmxs lib/*.cmt lib/*.cmti lib/*.annot |
| 14 | + jbuilder install $(INSTALL_ARGS) |
79 | 15 |
|
80 | 16 | uninstall: |
81 | | - ocamlfind remove nullable_array |
| 17 | + jbuilder uninstall $(INSTALL_ARGS) |
| 18 | + |
| 19 | +reinstall: uninstall reinstall |
| 20 | + |
| 21 | +clean: |
| 22 | + rm -rf _build |
82 | 23 |
|
83 | | -.PHONY: all html_doc man_doc doc install uninstall clean |
| 24 | +.PHONY: default test dev install uninstall reinstall clean |
0 commit comments