1

次のような構造のプロジェクトがあります。

Makefile
src/
  main.ml
tests/
  tests.ml

Makefile次のようなものです。

tests:
    ocamlbuild -Is src,tests tests.byte -build-dir $(BUILDDIR) $(TESTFLAGS) -lflags -I,/usr/lib/ocaml/oUnit -cflags -I,/usr/lib/ocaml/oUnit -libs oUnit

を実行するmake testsと (ビルド後にmain.byte)、次のエラーが返されます。

ocamlbuild -Is src,tests tests.byte -build-dir build -lflags -I,/usr/lib/ocaml/oUnit -cflags -I,/usr/lib/ocaml/oUnit -libs oUnit 
+ /usr/bin/ocamlc -c -I /usr/lib/ocaml/oUnit -I tests -I src -o tests/tests.cmo tests/tests.ml
File "tests/tests.ml", line 3, characters 46-50:
Error: Unbound value main
Command exited with code 2.
Compilation unsuccessful after building 2 targets (0 cached) in 00:00:00.
make: *** [tests] Error 10

ocamlbuildにリンクできないことを示していますmain.byte。見た目のtestsルールはどうあるべきですか?Makefile

4

2 に答える 2